Removed unused import, PEP8 cleanups
This commit is contained in:
@@ -25,7 +25,6 @@ from documents.literals import HISTORY_DOCUMENT_CREATED, \
|
||||
HISTORY_DOCUMENT_EDITED, HISTORY_DOCUMENT_DELETED
|
||||
from documents.conf.settings import ZOOM_MAX_LEVEL
|
||||
from documents.conf.settings import ZOOM_MIN_LEVEL
|
||||
from documents.conf.settings import CACHE_PATH
|
||||
from documents.conf import settings as document_settings
|
||||
from documents.widgets import document_thumbnail
|
||||
|
||||
|
||||
@@ -9,7 +9,6 @@ from django.utils.translation import ugettext
|
||||
from django.contrib.auth.models import User
|
||||
from django.contrib.contenttypes import generic
|
||||
from django.contrib.comments.models import Comment
|
||||
from django.conf import settings
|
||||
from django.core.exceptions import ValidationError
|
||||
|
||||
from taggit.managers import TaggableManager
|
||||
@@ -31,8 +30,6 @@ from documents.conf.settings import CACHE_PATH
|
||||
from documents.managers import RecentDocumentManager, \
|
||||
DocumentPageTransformationManager
|
||||
from documents.utils import document_save_to_temp_dir
|
||||
from documents.literals import PICTURE_ERROR_SMALL, PICTURE_ERROR_MEDIUM, \
|
||||
PICTURE_UNKNOWN_SMALL, PICTURE_UNKNOWN_MEDIUM
|
||||
from converter.literals import DEFAULT_ZOOM_LEVEL, DEFAULT_ROTATION, \
|
||||
DEFAULT_PAGE_NUMBER
|
||||
|
||||
@@ -168,7 +165,7 @@ class Document(models.Model):
|
||||
def update_page_count(self, save=True):
|
||||
handle, filepath = tempfile.mkstemp()
|
||||
# Just need the filepath, close the file description
|
||||
os.close(handle)
|
||||
os.close(handle)
|
||||
|
||||
self.save_to_file(filepath)
|
||||
try:
|
||||
@@ -236,7 +233,7 @@ class Document(models.Model):
|
||||
)
|
||||
|
||||
page_transformation.save()
|
||||
|
||||
|
||||
def get_cached_image_name(self, page):
|
||||
document_page = self.documentpage_set.get(page_number=page)
|
||||
transformations, warnings = document_page.get_transformation_list()
|
||||
|
||||
+9
-10
@@ -8,7 +8,6 @@ from django.template import RequestContext
|
||||
from django.contrib import messages
|
||||
from django.views.generic.list_detail import object_list
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.views.generic.create_update import delete_object, update_object
|
||||
from django.utils.http import urlencode
|
||||
|
||||
import sendfile
|
||||
@@ -19,7 +18,7 @@ from common.literals import PAGE_SIZE_DIMENSIONS, \
|
||||
PAGE_ORIENTATION_PORTRAIT, PAGE_ORIENTATION_LANDSCAPE
|
||||
from common.conf.settings import DEFAULT_PAPER_SIZE
|
||||
from converter.literals import DEFAULT_ZOOM_LEVEL, DEFAULT_ROTATION, \
|
||||
DEFAULT_FILE_FORMAT, DEFAULT_PAGE_NUMBER
|
||||
DEFAULT_PAGE_NUMBER
|
||||
from filetransfers.api import serve_file
|
||||
from grouping.utils import get_document_group_subtemplate
|
||||
from metadata.forms import MetadataFormSet, MetadataSelectionForm
|
||||
@@ -388,13 +387,13 @@ def document_page_transformation_edit(request, document_page_transformation_id):
|
||||
'navigation_object_list': [
|
||||
{'object': 'page'},
|
||||
{'object': 'transformation', 'name': _(u'transformation')}
|
||||
],
|
||||
],
|
||||
'title': _(u'Edit transformation "%(transformation)s" for: %(document_page)s') % {
|
||||
'transformation': document_page_transformation.get_transformation_display(),
|
||||
'document_page': document_page_transformation.document_page},
|
||||
'web_theme_hide_menus': True,
|
||||
}, context_instance=RequestContext(request))
|
||||
|
||||
|
||||
|
||||
def document_page_transformation_delete(request, document_page_transformation_id):
|
||||
check_permissions(request.user, [PERMISSION_DOCUMENT_TRANSFORM])
|
||||
@@ -417,7 +416,7 @@ def document_page_transformation_delete(request, document_page_transformation_id
|
||||
'navigation_object_list': [
|
||||
{'object': 'page'},
|
||||
{'object': 'transformation', 'name': _(u'transformation')}
|
||||
],
|
||||
],
|
||||
'title': _(u'Are you sure you wish to delete transformation "%(transformation)s" for: %(document_page)s') % {
|
||||
'transformation': document_page_transformation.get_transformation_display(),
|
||||
'document_page': document_page_transformation.document_page},
|
||||
@@ -865,7 +864,7 @@ def document_type_document_list(request, document_type_id):
|
||||
extra_context={
|
||||
'object_name': _(u'document type'),
|
||||
'navigation_object_name': 'document_type',
|
||||
'document_type': document_type,
|
||||
'document_type': document_type,
|
||||
}
|
||||
)
|
||||
|
||||
@@ -926,11 +925,11 @@ def document_type_delete(request, document_type_id):
|
||||
'delete_view': True,
|
||||
'previous': previous,
|
||||
'next': next,
|
||||
|
||||
|
||||
'object_name': _(u'document type'),
|
||||
'navigation_object_name': 'document_type',
|
||||
'document_type': document_type,
|
||||
|
||||
|
||||
'title': _(u'Are you sure you wish to delete the document type: %s?') % document_type,
|
||||
'message': _(u'The document type of all documents using this document type will be set to none.'),
|
||||
'form_icon': u'layout_delete.png',
|
||||
@@ -1018,7 +1017,7 @@ def document_type_filename_edit(request, document_type_filename_id):
|
||||
'navigation_object_list': [
|
||||
{'object': 'document_type', 'name': _(u'document type')},
|
||||
{'object': 'filename', 'name': _(u'document type filename')}
|
||||
],
|
||||
],
|
||||
},
|
||||
context_instance=RequestContext(request))
|
||||
|
||||
@@ -1052,7 +1051,7 @@ def document_type_filename_delete(request, document_type_filename_id):
|
||||
'navigation_object_list': [
|
||||
{'object': 'document_type', 'name': _(u'document type')},
|
||||
{'object': 'filename', 'name': _(u'document type filename')}
|
||||
],
|
||||
],
|
||||
'title': _(u'Are you sure you wish to delete the filename: %(filename)s, from document type "%(document_type)s"?') % {
|
||||
'document_type': document_type_filename.document_type, 'filename': document_type_filename
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user