mirror of
https://github.com/SinTan1729/recipe-box-for-wikijs.git
synced 2024-12-25 09:48:36 -06:00
fix: Removed some unused variables
This commit is contained in:
parent
1b2807ddd2
commit
f4f23cb527
1 changed files with 2 additions and 7 deletions
|
@ -36,14 +36,14 @@ def ensure_directory_exists(path, expand_user=True, file=False):
|
|||
if not os.path.exists(directory) and directory:
|
||||
try:
|
||||
os.makedirs(directory)
|
||||
except OSError as e:
|
||||
except OSError:
|
||||
# A parallel process created the directory after the existence check.
|
||||
pass
|
||||
|
||||
return path
|
||||
|
||||
|
||||
def valid_filename(directory, filename=None, ascii=False):
|
||||
def valid_filename(directory, filename=None):
|
||||
""" Return a valid "new" filename in a directory, given a filename/directory=path to test.
|
||||
|
||||
Deal with duplicate filenames.
|
||||
|
@ -61,11 +61,6 @@ def valid_filename(directory, filename=None, ascii=False):
|
|||
filename = os.path.basename(directory)
|
||||
directory = os.path.dirname(directory)
|
||||
|
||||
# if ascii:
|
||||
# filename = unidecode(unicode(filename))
|
||||
# filename = ' '.join(filename.splitlines()).strip()
|
||||
# filename = filename.decode('ascii', 'ignore')
|
||||
|
||||
# Allow for directories.
|
||||
items = set(os.listdir(directory))
|
||||
if filename in items:
|
||||
|
|
Loading…
Reference in a new issue