DeepSource Fixing Antipatterns

This commit is contained in:
Michał Gdula 2023-04-02 16:50:52 +00:00
parent 1152856f2a
commit 7b97b8e0ef
11 changed files with 177 additions and 185 deletions

View file

@ -45,19 +45,11 @@ def compile_theme(theme_name, app_path):
# If the destination folder exists, remove it
if os.path.exists(os.path.join(theme_destination, 'fonts')):
try:
shutil.rmtree(os.path.join(theme_destination, 'fonts'))
except Exception as err:
print("Failed to remove old fonts!\n", err)
sys.exit(1)
shutil.rmtree(os.path.join(theme_destination, 'fonts'))
# Copy the fonts
try:
shutil.copytree(os.path.join(theme_source, 'fonts'),
os.path.join(theme_destination, 'fonts'))
print("Fonts copied successfully!")
except Exception as err:
print("Failed to copy fonts!\n", err)
sys.exit(1)
shutil.copytree(os.path.join(theme_source, 'fonts'),
os.path.join(theme_destination, 'fonts'))
print("Fonts copied successfully!")
print(f"{datetime.now().hour}:{datetime.now().minute}:{datetime.now().second} - Done!\n")