Files
mayan-edms/apps/document_indexing/os_specifics.py
Roberto Rosario a646997ab8 Rename os_agnostic.py to the more appropiate os_specifics
to encapsulate file system unique filename and path handling
2011-11-30 09:31:32 -04:00

21 lines
530 B
Python

import os
from document_indexing.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
def assemble_path_from_list(directory_list):
return os.sep.join(directory_list)