Update update.py

pull/30/head
kritiksoman 4 years ago committed by GitHub
parent cb161d1f84
commit 2180f5fcbe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -12,16 +12,17 @@ import syncWeights
def update(flag) :
gimp.progress_init("Updating plugins...")
# for filename in os.listdir(baseLoc):
# file_path = os.path.join(baseLoc, filename)
# try:
# if os.path.isfile(file_path) and not file_path.endswith('update.py'):
# os.unlink(file_path)
# elif os.path.isdir(file_path) and not (file_path.endswith('weights') or file_path.endswith('gimpenv')) :
# shutil.rmtree(file_path)
# except Exception as e:
# print('Failed to delete %s. Reason: %s' % (file_path, e))
for filename in os.listdir(baseLoc):
file_path = os.path.join(baseLoc, filename)
try:
if os.path.isfile(file_path) and not file_path.endswith('update.py'):
os.unlink(file_path)
elif os.path.isdir(file_path) and not (file_path.endswith('weights') or file_path.endswith('gimpenv')) :
shutil.rmtree(file_path)
except Exception as e:
print('Failed to delete %s. Reason: %s' % (file_path, e))
# os.system("cd "+baseLoc+";git fetch;git checkout .")
syncWeights.syncGit(baseLoc)
if flag:
syncWeights.sync(baseLoc+'weights',flag)
# pdb.gimp_message("Update Completed Successfully!")

Loading…
Cancel
Save