PEP8 cleanups, style cleanups, unused imports
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user