PEP8 cleanup, unused import removal

This commit is contained in:
Roberto Rosario
2014-11-02 21:20:29 -04:00
parent ba1729106f
commit 9f2692d36a
24 changed files with 20 additions and 44 deletions
+1 -2
View File
@@ -11,8 +11,7 @@ from common.forms import DetailForm
from common.widgets import TextAreaDiv
from .models import (Document, DocumentType, DocumentPage,
DocumentPageTransformation, DocumentTypeFilename,
DocumentVersion)
DocumentPageTransformation, DocumentTypeFilename)
from .literals import DEFAULT_ZIP_FILENAME
from .widgets import DocumentPagesCarouselWidget, DocumentPageImageWidget
-1
View File
@@ -12,4 +12,3 @@ VERSION_UPDATE_MICRO = u'micro'
DEFAULT_ZIP_FILENAME = u'document_bundle.zip'
LANGUAGE_CHOICES = [(i.bibliographic, i.name) for i in list(pycountry.languages)]
+1 -1
View File
@@ -41,7 +41,7 @@ def task_new_document(document_type_id, shared_uploaded_file_id, label, descript
user = None
with File(file=shared_uploaded_file.file) as file_object:
new_version = Document.objects.new_document(document_type=document_type, expand=expand, file_object=file_object, label=label, description=description, language=language, user=user)
Document.objects.new_document(document_type=document_type, expand=expand, file_object=file_object, label=label, description=description, language=language, user=user)
shared_uploaded_file.delete()
+3 -3
View File
@@ -167,7 +167,7 @@ class DocumentUploadFunctionalTestCase(TestCase):
self.failUnlessEqual(self.document.page_count, 47)
# Delete the document
response = self.client.post(reverse('documents:document_delete', args=[self.document.pk]))
self.client.post(reverse('documents:document_delete', args=[self.document.pk]))
self.assertEqual(Document.objects.count(), 0)
def test_issue_25(self):
@@ -198,7 +198,7 @@ class DocumentUploadFunctionalTestCase(TestCase):
self.failUnlessEqual(document.description, '')
# Test for issue 25 during editing
response = self.client.post(reverse('documents:document_edit', args=[document.pk]), {'description': TEST_DOCUMENT_DESCRIPTION})
self.client.post(reverse('documents:document_edit', args=[document.pk]), {'description': TEST_DOCUMENT_DESCRIPTION})
# Fetch document again and test description
document = Document.objects.all().first()
self.failUnlessEqual(document.description, TEST_DOCUMENT_DESCRIPTION)
@@ -300,7 +300,7 @@ class DocumentsViewsFunctionalTestCase(TestCase):
# Upload the test document
with open(TEST_SMALL_DOCUMENT_PATH) as file_descriptor:
response = self.client.post(reverse('sources:upload_interactive'), {'file': file_descriptor, 'document_type_id': self.document_type.pk})
self.client.post(reverse('sources:upload_interactive'), {'file': file_descriptor, 'document_type_id': self.document_type.pk})
self.assertEqual(Document.objects.count(), 1)
self.document = Document.objects.first()
+1 -4
View File
@@ -1,6 +1,5 @@
from __future__ import absolute_import
import copy
import logging
import urlparse
@@ -18,13 +17,11 @@ import sendfile
from acls.models import AccessEntry
from common.compressed_files import CompressedFile
from common.utils import (encapsulate, pretty_size, parse_range, return_diff,
urlquote)
from common.utils import encapsulate, pretty_size, parse_range, urlquote
from common.views import SingleObjectListView
from common.widgets import two_state_template
from converter.literals import (DEFAULT_FILE_FORMAT_MIMETYPE, DEFAULT_PAGE_NUMBER,
DEFAULT_ROTATION, DEFAULT_ZOOM_LEVEL)
from converter.office_converter import OfficeConverter
from filetransfers.api import serve_file
from history.api import create_history
from navigation.utils import resolve_to_name