Skip to content

Commit

Permalink
Some documentation warnings has been removed, #112, #113
Browse files Browse the repository at this point in the history
  • Loading branch information
pylover committed Aug 5, 2018
1 parent 9c1c3c1 commit 6ab9496
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 42 deletions.
2 changes: 0 additions & 2 deletions sphinx/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,6 @@ exceptions Module

.. autoexception:: MaximumLengthIsReachedError

.. autoexception:: MinimumLengthIsNotReachedError

.. autoexception:: ContextError

.. autoexception:: DefaultStoreError
Expand Down
5 changes: 2 additions & 3 deletions sphinx/tutorials/analyzers_and_validators.rst
Original file line number Diff line number Diff line change
Expand Up @@ -97,16 +97,15 @@ For the first, let to create a type called ``CV``

import io

from sqlalchemy_media.exceptions import ContentTypeValidationError, \
MinimumLengthIsNotReachedError
from sqlalchemy_media.exceptions import ContentTypeValidationError

person1 = Person(cv=CV())
with StoreManager(session):
person1.cv.attach('../sqlalchemy_media/tests/stuff/cat.jpg') # OK

try:
person1.cv.attach(io.BytesIO(b'Plain text'))
except (ContentTypeValidationError, MinimumLengthIsNotReachedError):
except ContentTypeValidationError:
print("ContentTypeValidationError is raised. It's so bad!")

.. testoutput:: content_type
Expand Down
6 changes: 2 additions & 4 deletions sqlalchemy_media/attachments.py
Original file line number Diff line number Diff line change
Expand Up @@ -913,8 +913,6 @@ def get_orphaned_objects(self):
Mark thumbnails for deletion when the :class:`.Image` is being deleted.
:return: An iterable of :class:`.Thumbnail` to mark as orphan.
.. versionadded:: 0.11.0
"""
if not self.thumbnails:
return
Expand All @@ -925,9 +923,9 @@ def get_orphaned_objects(self):

class ImageList(AttachmentList):
"""
Used to create a collection of :class:`.Image`es
Used to create a collection of :class:`.Image`.
.. versionadded:: 0.11.0
"""

__item_type__ = Image

36 changes: 3 additions & 33 deletions sqlalchemy_media/processors.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,7 @@ def process(self, descriptor: StreamDescriptor, context: dict) -> None:

class Analyzer(Processor):
"""
.. versionadded:: 0.2
.. versionchanged:: 0.5
- Inherited from :class:`.Processor`
- The ``analyze`` method renamed to ``process`` to override the parent
method.
The abstract base class for all analyzers.
"""

def process(self, descriptor: StreamDescriptor, context: dict):
Expand Down Expand Up @@ -264,9 +253,6 @@ def process(self, descriptor: StreamDescriptor, context: dict) -> None:

class ImageProcessor(Processor):
"""
.. versionadded:: 0.5
Used to re-sampling, resizing, reformatting bitmaps.
.. warning::
Expand All @@ -276,32 +262,16 @@ class ImageProcessor(Processor):
- If you pass both ``width`` and ``height``, aspect ratio may not be
preserved.
:param format: The image format. i.e jpeg, gif, png
:param format: The image format. i.e jpeg, gif, png.
:param width: The new image width.
:param height: The new image height.
:param crop: Used to crop the image.
.. versionadded:: 0.6
The crop argument is 4-tuple of (left, top, right, bottom)
ImageProcessor(crop=(10, 10, 120, 230))
+--------------------------------------------------+
| ^ ^ |
| | | |
| top | |
| | | |
| v | |
| <-- left --> +-------------------+ bottom |
| | ^ | | |
| | <-- width --|---> | | |
| | height | | |
| | | | | |
| | v | | |
| +-------------------+ v |
| <--------------- right ----------> |
+--------------------------------------------------+
ImageProcessor(crop=(10, 10, 120, 230))
"""

Expand Down

0 comments on commit 6ab9496

Please sign in to comment.