Change quotation char usage, remarked code cleanups

This commit is contained in:
Roberto Rosario
2014-06-25 02:22:11 -04:00
parent c4439f45de
commit 0209d13150
6 changed files with 11 additions and 21 deletions

View File

@@ -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():

View File

@@ -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]:

View File

@@ -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:

View File

@@ -1,4 +1,4 @@
'''Configuration options for the linking app'''
"""Configuration options for the linking app"""
from django.utils.translation import ugettext_lazy as _

View File

@@ -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)

View File

@@ -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)