PEP8 cleanups, style cleanups, unused imports

This commit is contained in:
Roberto Rosario
2012-01-18 13:52:19 -04:00
parent 1a285d56dc
commit 8a5d0425b6
42 changed files with 311 additions and 335 deletions
+1 -1
View File
@@ -40,7 +40,7 @@ def fs_create_document_link(index_instance, document, suffix=0):
if FILESERVING_ENABLE:
filename = assemble_suffixed_filename(document.file.name, suffix)
filepath = assemble_path_from_list([FILESERVING_PATH, get_instance_path(index_instance), filename])
try:
os.symlink(document.file.path, filepath)
except OSError, exc:
+4 -4
View File
@@ -6,16 +6,16 @@ from .conf.settings import SUFFIX_SEPARATOR
def assemble_suffixed_filename(filename, suffix=0):
'''
"""
Split document filename, to attach suffix to the name part then
re attacht the extension
'''
"""
if suffix:
name, extension = filename.split(os.split(os.extsep))
return SUFFIX_SEPARATOR.join([name, unicode(suffix), os.extsep, extension])
else:
return file_filename
return filename
def assemble_path_from_list(directory_list):
+1 -1
View File
@@ -59,7 +59,7 @@ def index_instance_list(request, index_id=None):
},
{
'name': _(u'items'),
'attribute': encapsulate(lambda x: x.documents.count() if x.index.link_documents else x.get_children().count() )
'attribute': encapsulate(lambda x: x.documents.count() if x.index.link_documents else x.get_children().count())
}
],
'title': title,