no message
This commit is contained in:
parent
98fb1aae67
commit
5bebd760a9
1 changed files with 7 additions and 15 deletions
|
|
@ -263,22 +263,14 @@ def dont_use_dots_for_font_files(root_path=font_location):
|
||||||
for root, dirs, files in os.walk(root_path):
|
for root, dirs, files in os.walk(root_path):
|
||||||
for file in files:
|
for file in files:
|
||||||
file_path = os.path.join(root, file)
|
file_path = os.path.join(root, file)
|
||||||
if file_path.endswith('.otf') or file_path.endswith('.ttf') or file_path.endswith('.ttc'):
|
if file_path.endswith('.otf') or file_path.endswith('.ttf') or file_path.endswith('.ttc') or file_path.endswith('.pdf'):
|
||||||
new_file_path = None
|
new_file_path = None
|
||||||
|
for x in ['.', ' ', '-', '.-','--']:
|
||||||
if file_path.startswith('.'):
|
if file_path.startswith(x):
|
||||||
new_file_path = file_path.lstrip('.')
|
new_file_path = file_path.lstrip(x)
|
||||||
|
|
||||||
if file_path.startswith('_'):
|
|
||||||
new_file_path = file_path.lstrip('_')
|
|
||||||
|
|
||||||
if file_path.startswith('.-'):
|
|
||||||
new_file_path = file_path.lstrip('.-')
|
|
||||||
if new_file_path != None:
|
|
||||||
os.rename(file_path, new_file_path)
|
os.rename(file_path, new_file_path)
|
||||||
print(f"Renamed file: {file_path} -> {new_file_path}")
|
print(f"Renamed file: {file_path} -> {new_file_path}")
|
||||||
|
new_file_path = None
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
remove_ds_store_files()
|
remove_ds_store_files()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue