PEP8 cleanups
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
from __future__ import absolute_import, unicode_literals
|
||||
|
||||
import tempfile
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from actstream import registry
|
||||
@@ -15,7 +13,7 @@ from common import (
|
||||
from common.api import register_maintenance_links
|
||||
from common.classes import ModelAttribute
|
||||
from common.signals import post_initial_setup
|
||||
from common.utils import encapsulate, validate_path
|
||||
from common.utils import encapsulate
|
||||
from converter.links import link_transformation_list
|
||||
from converter.permissions import (
|
||||
PERMISSION_TRANSFORMATION_CREATE,
|
||||
@@ -74,10 +72,6 @@ class DocumentsApp(MayanAppConfig):
|
||||
def ready(self):
|
||||
super(DocumentsApp, self).ready()
|
||||
|
||||
# TODO: validate cache_path or create new
|
||||
#if (not validate_path(document_settings.CACHE_PATH)) or (not document_settings.CACHE_PATH):
|
||||
# setattr(document_settings, 'CACHE_PATH', tempfile.mkdtemp())
|
||||
|
||||
APIEndPoint('documents')
|
||||
|
||||
MissingItem(label=_('Create a document type'), description=_('Every uploaded document must be assigned a document type, it is the basic way Mayan EDMS categorizes documents.'), condition=lambda: not DocumentType.objects.exists(), view='documents:document_type_list')
|
||||
|
||||
@@ -410,8 +410,6 @@ class DocumentVersion(models.Model):
|
||||
logger.debug('Intermidiate file "%s" found.', cache_filename)
|
||||
|
||||
return open(cache_filename)
|
||||
#converter = converter_class(file_object=open(cache_filename))
|
||||
#converter.seek(0)
|
||||
else:
|
||||
logger.debug('Intermidiate file "%s" not found.', cache_filename)
|
||||
|
||||
@@ -539,7 +537,7 @@ class DocumentPage(models.Model):
|
||||
file_object.write(page_image.getvalue())
|
||||
except Exception as exception:
|
||||
# Cleanup in case of error
|
||||
logger.error('Error creating page cache file "%s".', cache_filename)
|
||||
logger.error('Error creating page cache file "%s"; %s', cache_filename, exception)
|
||||
fs_cleanup(cache_filename)
|
||||
raise
|
||||
|
||||
|
||||
@@ -21,8 +21,7 @@ from common.utils import encapsulate, pretty_size
|
||||
from common.views import ParentChildListView, SingleObjectListView
|
||||
from common.widgets import two_state_template
|
||||
from converter.literals import (
|
||||
DEFAULT_FILE_FORMAT_MIMETYPE, DEFAULT_PAGE_NUMBER, DEFAULT_ROTATION,
|
||||
DEFAULT_ZOOM_LEVEL
|
||||
DEFAULT_PAGE_NUMBER, DEFAULT_ROTATION, DEFAULT_ZOOM_LEVEL
|
||||
)
|
||||
from converter.models import Transformation
|
||||
from converter.permissions import PERMISSION_TRANSFORMATION_DELETE
|
||||
|
||||
Reference in New Issue
Block a user