diff --git a/mayan/apps/converter/api.py b/mayan/apps/converter/api.py index d695d4cb69..ba8e1cd7ab 100644 --- a/mayan/apps/converter/api.py +++ b/mayan/apps/converter/api.py @@ -1,7 +1,7 @@ from __future__ import absolute_import -import logging import hashlib +import logging import os from django.utils.encoding import smart_str @@ -116,17 +116,6 @@ def get_page_count(input_filepath): return backend.get_page_count(input_filepath) -''' -def get_document_dimensions(document, *args, **kwargs): - document_filepath = create_image_cache_filename(document.checksum, *args, **kwargs) - if os.path.exists(document_filepath): - options = [u'-format', u'%w %h'] - return [int(dimension) for dimension in backend.identify_file(unicode(document_filepath), options).split()] - else: - return [0, 0] -''' - - def get_available_transformations_choices(): result = [] for transformation in backend.get_available_transformations(): diff --git a/mayan/apps/converter/backends/python/base.py b/mayan/apps/converter/backends/python/base.py index 80f9916e77..fdd3436840 100644 --- a/mayan/apps/converter/backends/python/base.py +++ b/mayan/apps/converter/backends/python/base.py @@ -156,12 +156,13 @@ class ConverterClass(ConverterBase): # From: http://united-coders.com/christian-harms/image-resizing-tips-general-and-for-python def resize(self, img, box, fit=False, out=None): - '''Downsample the image. + """ + Downsample the image. @param img: Image - an Image-object @param box: tuple(x, y) - the bounding box of the result image @param fit: boolean - crop the image to fill the box @param out: file-like-object - save the image into the output stream - ''' + """ # preresize image with factor 2, 4, 8 and fast algorithm factor = 1 while img.size[0] / factor > 2 * box[0] and img.size[1] * 2 / factor > 2 * box[1]: diff --git a/mayan/apps/document_comments/views.py b/mayan/apps/document_comments/views.py index 4a87435fa3..e02cd65d3b 100644 --- a/mayan/apps/document_comments/views.py +++ b/mayan/apps/document_comments/views.py @@ -110,9 +110,9 @@ def comment_add(request, document_id): def comments_for_document(request, document_id): - ''' + """ Show a list of all the comments related to the passed object - ''' + """ document = get_object_or_404(Document, pk=document_id) try: diff --git a/mayan/apps/linking/conf/settings.py b/mayan/apps/linking/conf/settings.py index cf0d855350..5890a559b3 100644 --- a/mayan/apps/linking/conf/settings.py +++ b/mayan/apps/linking/conf/settings.py @@ -1,4 +1,4 @@ -'''Configuration options for the linking app''' +"""Configuration options for the linking app""" from django.utils.translation import ugettext_lazy as _ diff --git a/mayan/apps/ocr/models.py b/mayan/apps/ocr/models.py index fdf22a023a..aeebb77e36 100644 --- a/mayan/apps/ocr/models.py +++ b/mayan/apps/ocr/models.py @@ -89,9 +89,9 @@ class ArgumentsValidator(object): self.code = code def __call__(self, value): - ''' + """ Validates that the input evaluates correctly. - ''' + """ value = value.strip() try: literal_eval(value) diff --git a/mayan/apps/ocr/views.py b/mayan/apps/ocr/views.py index 81efeadfa7..de432b5d29 100644 --- a/mayan/apps/ocr/views.py +++ b/mayan/apps/ocr/views.py @@ -137,9 +137,9 @@ def submit_document(request, document_id): def submit_document_to_queue(request, document, post_submit_redirect=None): - ''' + """ This view is meant to be reusable - ''' + """ try: document_queue = DocumentQueue.objects.queue_document(document)