no message
This commit is contained in:
parent
a829efc23a
commit
98fb1aae67
1 changed files with 23 additions and 1 deletions
|
|
@ -259,6 +259,27 @@ def lowercase_and_dash_file_names(root_path=font_location):
|
||||||
else:
|
else:
|
||||||
print(f"File not found: {file_path}")
|
print(f"File not found: {file_path}")
|
||||||
|
|
||||||
|
def dont_use_dots_for_font_files(root_path=font_location):
|
||||||
|
for root, dirs, files in os.walk(root_path):
|
||||||
|
for file in files:
|
||||||
|
file_path = os.path.join(root, file)
|
||||||
|
if file_path.endswith('.otf') or file_path.endswith('.ttf') or file_path.endswith('.ttc'):
|
||||||
|
new_file_path = None
|
||||||
|
|
||||||
|
if file_path.startswith('.'):
|
||||||
|
new_file_path = file_path.lstrip('.')
|
||||||
|
|
||||||
|
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)
|
||||||
|
print(f"Renamed file: {file_path} -> {new_file_path}")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
remove_ds_store_files()
|
remove_ds_store_files()
|
||||||
remove_empty_folders()
|
remove_empty_folders()
|
||||||
|
|
@ -266,7 +287,8 @@ if __name__ == '__main__':
|
||||||
remove_bad_phrases()
|
remove_bad_phrases()
|
||||||
lowercase_all_the_folders()
|
lowercase_all_the_folders()
|
||||||
remove_spaces_in_dir_names()
|
remove_spaces_in_dir_names()
|
||||||
# lowercase_and_dash_file_names()
|
lowercase_and_dash_file_names()
|
||||||
|
dont_use_dots_for_font_files()
|
||||||
prepend_folder_name_to_font_dash()
|
prepend_folder_name_to_font_dash()
|
||||||
remove_ds_store_files()
|
remove_ds_store_files()
|
||||||
remove_empty_folders()
|
remove_empty_folders()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue