PEP8 Cleanups.
This commit is contained in:
@@ -83,7 +83,9 @@ class Python(ConverterBase):
|
|||||||
try:
|
try:
|
||||||
page_count = len(list(PDFPage.get_pages(file_object)))
|
page_count = len(list(PDFPage.get_pages(file_object)))
|
||||||
except Exception as exception:
|
except Exception as exception:
|
||||||
error_message = _('Exception determining PDF page count; %s') % exception
|
error_message = _(
|
||||||
|
'Exception determining PDF page count; %s'
|
||||||
|
) % exception
|
||||||
logger.error(error_message)
|
logger.error(error_message)
|
||||||
raise PageCountError(error_message)
|
raise PageCountError(error_message)
|
||||||
else:
|
else:
|
||||||
@@ -95,7 +97,9 @@ class Python(ConverterBase):
|
|||||||
try:
|
try:
|
||||||
image = Image.open(self.file_object)
|
image = Image.open(self.file_object)
|
||||||
except IOError as exception:
|
except IOError as exception:
|
||||||
error_message = _('Exception determining PDF page count; %s') % exception
|
error_message = _(
|
||||||
|
'Exception determining PDF page count; %s'
|
||||||
|
) % exception
|
||||||
logger.error(error_message)
|
logger.error(error_message)
|
||||||
raise PageCountError(error_message)
|
raise PageCountError(error_message)
|
||||||
finally:
|
finally:
|
||||||
|
|||||||
@@ -26,7 +26,9 @@ CHUNK_SIZE = 1024
|
|||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
LIBREOFFICE = sh.Command(setting_libreoffice_path.value).bake('--headless', '--convert-to', 'pdf')
|
LIBREOFFICE = sh.Command(
|
||||||
|
setting_libreoffice_path.value
|
||||||
|
).bake('--headless', '--convert-to', 'pdf')
|
||||||
except sh.CommandNotFound:
|
except sh.CommandNotFound:
|
||||||
LIBREOFFICE = None
|
LIBREOFFICE = None
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,10 @@ class POP3EmailAdmin(admin.ModelAdmin):
|
|||||||
|
|
||||||
@admin.register(StagingFolderSource)
|
@admin.register(StagingFolderSource)
|
||||||
class StagingFolderSourceAdmin(admin.ModelAdmin):
|
class StagingFolderSourceAdmin(admin.ModelAdmin):
|
||||||
list_display = ('label', 'enabled', 'folder_path', 'preview_width', 'preview_height', 'uncompress', 'delete_after_upload')
|
list_display = (
|
||||||
|
'label', 'enabled', 'folder_path', 'preview_width', 'preview_height',
|
||||||
|
'uncompress', 'delete_after_upload'
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
@admin.register(WatchFolderSource)
|
@admin.register(WatchFolderSource)
|
||||||
|
|||||||
@@ -42,7 +42,10 @@ class UploadBaseForm(forms.Form):
|
|||||||
if show_expand:
|
if show_expand:
|
||||||
self.fields['expand'] = forms.BooleanField(
|
self.fields['expand'] = forms.BooleanField(
|
||||||
label=_('Expand compressed files'), required=False,
|
label=_('Expand compressed files'), required=False,
|
||||||
help_text=ugettext('Upload a compressed file\'s contained files as individual documents')
|
help_text=ugettext(
|
||||||
|
'Upload a compressed file\'s contained files as '
|
||||||
|
'individual documents'
|
||||||
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -37,7 +37,9 @@ def task_upload_document(self, source_id, document_type_id, shared_uploaded_file
|
|||||||
try:
|
try:
|
||||||
document_type = DocumentType.objects.get(pk=document_type_id)
|
document_type = DocumentType.objects.get(pk=document_type_id)
|
||||||
source = Source.objects.get_subclass(pk=source_id)
|
source = Source.objects.get_subclass(pk=source_id)
|
||||||
shared_upload = SharedUploadedFile.objects.get(pk=shared_uploaded_file_id)
|
shared_upload = SharedUploadedFile.objects.get(
|
||||||
|
pk=shared_uploaded_file_id
|
||||||
|
)
|
||||||
|
|
||||||
if user_id:
|
if user_id:
|
||||||
user = User.objects.get(pk=user_id)
|
user = User.objects.get(pk=user_id)
|
||||||
|
|||||||
@@ -15,7 +15,8 @@ from documents.settings import setting_preview_size, setting_thumbnail_size
|
|||||||
|
|
||||||
def staging_file_thumbnail(staging_file, **kwargs):
|
def staging_file_thumbnail(staging_file, **kwargs):
|
||||||
return staging_file_html_widget(
|
return staging_file_html_widget(
|
||||||
staging_file, click_view='rest_api:stagingfolderfile-image-view', **kwargs
|
staging_file, click_view='rest_api:stagingfolderfile-image-view',
|
||||||
|
**kwargs
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user