Skip to content

Commit

Permalink
debugs
Browse files Browse the repository at this point in the history
  • Loading branch information
KorryKatti committed Apr 1, 2024
1 parent 9a8101e commit 1375c6e
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions index.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,18 +250,23 @@ def uninstall_app():
# Delete the directory corresponding to the app
try:
shutil.rmtree(app_dir)
print("App uninstalled successfully.")
print("App directory deleted successfully:", app_dir)

# Remove app ID from downloads.txt
downloads_file = os.path.join("appfiles", "downloads.txt")
if os.path.exists(downloads_file):
with open(downloads_file, "r+") as f:
print("downloads.txt exists.")
with open(downloads_file, "r") as f:
lines = f.readlines()
f.seek(0)

with open(downloads_file, "w") as f:
for line in lines:
if not line.strip().startswith(app_id):
f.write(line)
f.truncate()
print("App ID kept in downloads.txt:", line.strip())
else:
print("App ID removed from downloads.txt:", line.strip())

else:
print("downloads.txt not found.")

Expand All @@ -270,6 +275,8 @@ def uninstall_app():

# Call cherry() with start and uninstall commands
cherry(start_app, uninstall_app)



# CallBack function for commenu
def commenu_callback(choice):
Expand Down

0 comments on commit 1375c6e

Please sign in to comment.