Cleanups
This commit is contained in:
@@ -1,22 +1,12 @@
|
||||
from __future__ import absolute_import
|
||||
|
||||
import base64
|
||||
import errno
|
||||
import os
|
||||
import urllib
|
||||
|
||||
from django.core.exceptions import ObjectDoesNotExist
|
||||
from django.core.files import File
|
||||
from django.core.files.storage import FileSystemStorage
|
||||
from django.utils.encoding import smart_str
|
||||
from django.utils.translation import ugettext
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from common.utils import fs_cleanup
|
||||
from converter.api import convert, cache_cleanup
|
||||
from converter.literals import (DEFAULT_ZOOM_LEVEL, DEFAULT_ROTATION,
|
||||
DEFAULT_PAGE_NUMBER, DEFAULT_FILE_FORMAT_MIMETYPE)
|
||||
from documents.conf.settings import DISPLAY_SIZE, THUMBNAIL_SIZE
|
||||
from converter.api import convert
|
||||
from mimetype.api import get_mimetype
|
||||
|
||||
|
||||
@@ -54,7 +44,7 @@ class StagingFile(object):
|
||||
image.close()
|
||||
return u'data:%s;base64,%s' % (mimetype, base64_data)
|
||||
else:
|
||||
return file_path
|
||||
return converted_file_path
|
||||
|
||||
def delete(self):
|
||||
os.unlink(self.get_full_path())
|
||||
|
||||
@@ -7,7 +7,6 @@ import os
|
||||
from django.contrib.contenttypes import generic
|
||||
from django.contrib.contenttypes.models import ContentType
|
||||
from django.core.exceptions import ValidationError
|
||||
from django.core.files.storage import FileSystemStorage
|
||||
from django.db import models, transaction
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@ import logging
|
||||
from rest_framework import serializers
|
||||
from rest_framework.reverse import reverse
|
||||
|
||||
from .classes import StagingFile
|
||||
from .models import StagingFolder
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -2,7 +2,8 @@ from __future__ import absolute_import
|
||||
|
||||
from django.conf.urls import patterns, url
|
||||
|
||||
from .api import APIStagingSourceListView,APIStagingSourceView, APIStagingSourceFileView, APIStagingSourceFileImageView
|
||||
from .api import (APIStagingSourceListView, APIStagingSourceView,
|
||||
APIStagingSourceFileView, APIStagingSourceFileImageView)
|
||||
from .literals import (SOURCE_CHOICE_WEB_FORM, SOURCE_CHOICE_STAGING,
|
||||
SOURCE_CHOICE_WATCH)
|
||||
from .wizards import DocumentCreateWizard
|
||||
|
||||
@@ -3,7 +3,6 @@ from __future__ import absolute_import
|
||||
from django.conf import settings
|
||||
from django.contrib import messages
|
||||
from django.core.exceptions import PermissionDenied
|
||||
from django.core.files.storage import FileSystemStorage
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.http import HttpResponseRedirect
|
||||
from django.shortcuts import render_to_response, get_object_or_404
|
||||
@@ -13,11 +12,8 @@ from django.utils.safestring import mark_safe
|
||||
from django.utils.translation import ugettext
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
import sendfile
|
||||
|
||||
from acls.models import AccessEntry
|
||||
from common.utils import encapsulate
|
||||
from documents.conf.settings import THUMBNAIL_SIZE
|
||||
from documents.exceptions import NewDocumentVersionNotAllowed
|
||||
from documents.models import DocumentType, Document
|
||||
from documents.permissions import (PERMISSION_DOCUMENT_CREATE,
|
||||
@@ -35,7 +31,6 @@ from .models import (WebForm, StagingFolder, SourceTransformation,
|
||||
from .permissions import (PERMISSION_SOURCES_SETUP_VIEW,
|
||||
PERMISSION_SOURCES_SETUP_EDIT, PERMISSION_SOURCES_SETUP_DELETE,
|
||||
PERMISSION_SOURCES_SETUP_CREATE)
|
||||
from .staging import create_staging_file_class
|
||||
|
||||
|
||||
def document_create_siblings(request, document_id):
|
||||
|
||||
@@ -8,8 +8,7 @@ from django.utils.safestring import mark_safe
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from converter.literals import DEFAULT_PAGE_NUMBER, DEFAULT_ROTATION, DEFAULT_ZOOM_LEVEL
|
||||
from documents.conf.settings import (THUMBNAIL_SIZE, PREVIEW_SIZE,
|
||||
DISPLAY_SIZE, MULTIPAGE_PREVIEW_SIZE)
|
||||
from documents.conf.settings import THUMBNAIL_SIZE, PREVIEW_SIZE
|
||||
|
||||
|
||||
class FamFamRadioFieldRenderer(forms.widgets.RadioFieldRenderer):
|
||||
|
||||
Reference in New Issue
Block a user