PEP8 and general cleanups
This commit is contained in:
@@ -1,6 +1,5 @@
|
|||||||
from django import forms
|
from django import forms
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import ugettext_lazy as _
|
||||||
from django.utils.translation import ugettext
|
|
||||||
|
|
||||||
|
|
||||||
class KeySearchForm(forms.Form):
|
class KeySearchForm(forms.Form):
|
||||||
|
|||||||
@@ -9,12 +9,11 @@ from django.template import RequestContext
|
|||||||
from django.contrib import messages
|
from django.contrib import messages
|
||||||
|
|
||||||
from permissions.models import Permission
|
from permissions.models import Permission
|
||||||
from common.utils import (urlquote, encapsulate)
|
from common.utils import encapsulate
|
||||||
|
|
||||||
from .api import Key, SIGNATURE_STATES
|
from .api import Key
|
||||||
from .runtime import gpg
|
from .runtime import gpg
|
||||||
from .exceptions import (GPGVerificationError, KeyFetchingError,
|
from .exceptions import KeyFetchingError, KeyImportError
|
||||||
KeyImportError)
|
|
||||||
from .forms import KeySearchForm
|
from .forms import KeySearchForm
|
||||||
from .permissions import (PERMISSION_KEY_VIEW, PERMISSION_KEY_DELETE,
|
from .permissions import (PERMISSION_KEY_VIEW, PERMISSION_KEY_DELETE,
|
||||||
PERMISSION_KEYSERVER_QUERY, PERMISSION_KEY_RECEIVE)
|
PERMISSION_KEYSERVER_QUERY, PERMISSION_KEY_RECEIVE)
|
||||||
|
|||||||
@@ -2,13 +2,11 @@ from __future__ import absolute_import
|
|||||||
|
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import ugettext_lazy as _
|
||||||
from django.utils.translation import ugettext
|
from django.utils.translation import ugettext
|
||||||
from django.core.urlresolvers import reverse
|
|
||||||
from django.template.defaultfilters import slugify
|
from django.template.defaultfilters import slugify
|
||||||
|
|
||||||
from metadata.classes import MetadataClass
|
from metadata.classes import MetadataClass
|
||||||
|
|
||||||
from .models import (Index, IndexTemplateNode, IndexInstanceNode,
|
from .models import Index, IndexInstanceNode, DocumentRenameCount
|
||||||
DocumentRenameCount)
|
|
||||||
from .conf.settings import (AVAILABLE_INDEXING_FUNCTIONS,
|
from .conf.settings import (AVAILABLE_INDEXING_FUNCTIONS,
|
||||||
MAX_SUFFIX_COUNT, SLUGIFY_PATHS)
|
MAX_SUFFIX_COUNT, SLUGIFY_PATHS)
|
||||||
from .filesystem import (fs_create_index_directory,
|
from .filesystem import (fs_create_index_directory,
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import absolute_import
|
from __future__ import absolute_import
|
||||||
|
|
||||||
#from django.utils.safestring import mark_safe
|
from django.utils.html import mark_safe
|
||||||
from django.utils.html import conditional_escape, mark_safe
|
|
||||||
|
|
||||||
from .models import IndexInstanceNode
|
from .models import IndexInstanceNode
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,10 @@
|
|||||||
from __future__ import absolute_import
|
from __future__ import absolute_import
|
||||||
|
|
||||||
from django import forms
|
from django import forms
|
||||||
from django.utils.translation import ugettext_lazy as _
|
|
||||||
from django.utils.translation import ugettext
|
from django.utils.translation import ugettext
|
||||||
from django.core.urlresolvers import reverse
|
from django.core.urlresolvers import reverse
|
||||||
from django.utils.safestring import mark_safe
|
from django.utils.safestring import mark_safe
|
||||||
from django.template.defaultfilters import capfirst
|
from django.template.defaultfilters import capfirst
|
||||||
from django.conf import settings
|
|
||||||
|
|
||||||
from documents.widgets import document_html_widget
|
from documents.widgets import document_html_widget
|
||||||
from tags.widgets import get_tags_inline_widget
|
from tags.widgets import get_tags_inline_widget
|
||||||
|
|||||||
@@ -127,7 +127,6 @@ def smart_link_list(request):
|
|||||||
except PermissionDenied:
|
except PermissionDenied:
|
||||||
qs = AccessEntry.objects.filter_objects_by_access(PERMISSION_SMART_LINK_VIEW, request.user, qs)
|
qs = AccessEntry.objects.filter_objects_by_access(PERMISSION_SMART_LINK_VIEW, request.user, qs)
|
||||||
|
|
||||||
|
|
||||||
return render_to_response('generic_list.html', {
|
return render_to_response('generic_list.html', {
|
||||||
'title': _(u'smart links'),
|
'title': _(u'smart links'),
|
||||||
'object_list': qs,
|
'object_list': qs,
|
||||||
|
|||||||
@@ -83,6 +83,7 @@ def get_error_icon_file_path():
|
|||||||
else:
|
else:
|
||||||
return os.path.join(settings.STATIC_ROOT, MIMETYPE_ICONS_DIRECTORY_NAME, ERROR_FILE_NAME)
|
return os.path.join(settings.STATIC_ROOT, MIMETYPE_ICONS_DIRECTORY_NAME, ERROR_FILE_NAME)
|
||||||
|
|
||||||
|
|
||||||
def get_error_icon_url():
|
def get_error_icon_url():
|
||||||
return os.path.join(MIMETYPE_ICONS_DIRECTORY_NAME, ERROR_FILE_NAME)
|
return os.path.join(MIMETYPE_ICONS_DIRECTORY_NAME, ERROR_FILE_NAME)
|
||||||
|
|
||||||
|
|||||||
@@ -95,6 +95,7 @@ def document_post_save(sender, instance, **kwargs):
|
|||||||
# logger.debug('got call_queue signal: %s' % kwargs)
|
# logger.debug('got call_queue signal: %s' % kwargs)
|
||||||
# task_process_document_queues()
|
# task_process_document_queues()
|
||||||
|
|
||||||
|
|
||||||
@receiver(post_syncdb, dispatch_uid='create_default_queue', sender=ocr_models)
|
@receiver(post_syncdb, dispatch_uid='create_default_queue', sender=ocr_models)
|
||||||
def create_default_queue_signal_handler(sender, **kwargs):
|
def create_default_queue_signal_handler(sender, **kwargs):
|
||||||
create_default_queue()
|
create_default_queue()
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
from __future__ import absolute_import
|
from __future__ import absolute_import
|
||||||
|
|
||||||
import socket
|
|
||||||
|
|
||||||
from django.http import HttpResponseRedirect
|
from django.http import HttpResponseRedirect
|
||||||
from django.shortcuts import render_to_response, get_object_or_404
|
from django.shortcuts import render_to_response, get_object_or_404
|
||||||
from django.template import RequestContext
|
from django.template import RequestContext
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
from __future__ import absolute_import
|
from __future__ import absolute_import
|
||||||
|
|
||||||
import os, sys
|
import os
|
||||||
|
import sys
|
||||||
from optparse import make_option
|
from optparse import make_option
|
||||||
|
|
||||||
from django.core.management.base import BaseCommand, CommandError, LabelCommand
|
from django.core.management.base import BaseCommand, CommandError, LabelCommand
|
||||||
from django.utils.simplejson import loads, dumps
|
from django.utils.simplejson import loads
|
||||||
|
|
||||||
from metadata.api import convert_dict_to_dict_list
|
from metadata.api import convert_dict_to_dict_list
|
||||||
from documents.models import DocumentType
|
from documents.models import DocumentType
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ from django.contrib.contenttypes.models import ContentType
|
|||||||
from django.contrib.contenttypes import generic
|
from django.contrib.contenttypes import generic
|
||||||
from django.core.exceptions import ValidationError
|
from django.core.exceptions import ValidationError
|
||||||
from django.db import transaction
|
from django.db import transaction
|
||||||
from django.db.utils import DatabaseError
|
|
||||||
|
|
||||||
from converter.api import get_available_transformations_choices
|
from converter.api import get_available_transformations_choices
|
||||||
from converter.literals import DIMENSION_SEPARATOR
|
from converter.literals import DIMENSION_SEPARATOR
|
||||||
@@ -288,6 +287,7 @@ class SourceTransformation(models.Model):
|
|||||||
|
|
||||||
class OutOfProcess(BaseModel):
|
class OutOfProcess(BaseModel):
|
||||||
is_interactive = False
|
is_interactive = False
|
||||||
|
|
||||||
class Meta(BaseModel.Meta):
|
class Meta(BaseModel.Meta):
|
||||||
verbose_name = _(u'out of process')
|
verbose_name = _(u'out of process')
|
||||||
verbose_name_plural = _(u'out of process')
|
verbose_name_plural = _(u'out of process')
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
from __future__ import absolute_import
|
from __future__ import absolute_import
|
||||||
|
|
||||||
import csv, os, sys
|
import csv
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
from optparse import make_option
|
from optparse import make_option
|
||||||
|
|
||||||
from django.core.management.base import BaseCommand, CommandError, LabelCommand
|
from django.core.management.base import BaseCommand, CommandError, LabelCommand
|
||||||
from django.utils.simplejson import loads, dumps
|
|
||||||
from django.contrib.auth.models import User
|
from django.contrib.auth.models import User
|
||||||
from django.db.utils import IntegrityError
|
from django.db.utils import IntegrityError
|
||||||
|
|
||||||
@@ -17,6 +18,7 @@ def unicode_csv_reader(unicode_csv_data, dialect=csv.excel, **kwargs):
|
|||||||
# decode UTF-8 back to Unicode, cell by cell:
|
# decode UTF-8 back to Unicode, cell by cell:
|
||||||
yield [unicode(cell, 'utf-8') for cell in row]
|
yield [unicode(cell, 'utf-8') for cell in row]
|
||||||
|
|
||||||
|
|
||||||
def utf_8_encoder(unicode_csv_data):
|
def utf_8_encoder(unicode_csv_data):
|
||||||
for line in unicode_csv_data:
|
for line in unicode_csv_data:
|
||||||
yield line.encode('utf-8')
|
yield line.encode('utf-8')
|
||||||
|
|||||||
Reference in New Issue
Block a user