mirror of
https://github.com/SinTan1729/recipe-box-for-wikijs.git
synced 2024-12-26 10:08:37 -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:
|
if not os.path.exists(directory) and directory:
|
||||||
try:
|
try:
|
||||||
os.makedirs(directory)
|
os.makedirs(directory)
|
||||||
except OSError as e:
|
except OSError:
|
||||||
# A parallel process created the directory after the existence check.
|
# A parallel process created the directory after the existence check.
|
||||||
pass
|
pass
|
||||||
|
|
||||||
return path
|
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.
|
""" Return a valid "new" filename in a directory, given a filename/directory=path to test.
|
||||||
|
|
||||||
Deal with duplicate filenames.
|
Deal with duplicate filenames.
|
||||||
|
@ -61,11 +61,6 @@ def valid_filename(directory, filename=None, ascii=False):
|
||||||
filename = os.path.basename(directory)
|
filename = os.path.basename(directory)
|
||||||
directory = os.path.dirname(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.
|
# Allow for directories.
|
||||||
items = set(os.listdir(directory))
|
items = set(os.listdir(directory))
|
||||||
if filename in items:
|
if filename in items:
|
||||||
|
|
Loading…
Reference in a new issue