Skip to content

Commit

Permalink
LICENSE
Browse files Browse the repository at this point in the history
  • Loading branch information
abrik1 committed Dec 10, 2023
1 parent 2168b4b commit ab05a23
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 24 deletions.
38 changes: 22 additions & 16 deletions db.json
Original file line number Diff line number Diff line change
@@ -1,35 +1,41 @@
{
"firefox": {
"version": "52.0.9",
"source": "https://ftp.mozilla.org/pub/firefox/releases/52.9.0esr/win32/en-US/Firefox%20Setup%2052.9.0esr.exe",
"remover": "C:\\Program Files\\Mozilla Firefox\\uninstall\\helper.exe",
"isUninstallerByNullsoft": true
"version": "52.0.9",
"source": "https://ftp.mozilla.org/pub/firefox/releases/52.9.0esr/win32/en-US/Firefox%20Setup%2052.9.0esr.exe",
"remover": "C:\\Program Files\\Mozilla Firefox\\uninstall\\helper.exe",
"isUninstallerByNullsoft": true
},
"emacs": {
"version": "27.2",
"source": "http://ftp.gnu.org/gnu/emacs/windows/emacs-27/emacs-27.2-i686-installer.exe",
"remover": "C:\\Program Files\\Emacs\\Uninstall.exe",
"isUninstallerByNullsoft": true
"isUninstallerByNullsoft": true
},
"vim": {
"version": "9.0",
"source": "https://ftp.nluug.nl/pub/vim/pc/gvim90.exe",
"remover": "C:\\Program Files\\Vim\\vim90\\uninstall-gui.exe",
"isUninstallerByNullsoft": true
"isUninstallerByNullsoft": true
},
"sublime-text-3": {
"version": "3.3211",
"source": "https://download.sublimetext.com/Sublime%20Text%20Build%203211%20Setup.exe",
"remover": "C:\\Program Files\\Sublime Text 3\\unins000.exe"
},
"7zip": {
"version": "23.01",
"source": "https://www.7-zip.org/a/7z2301.exe",
"remover": "C:\\Program Files\\7-Zip\\Uninstall.exe"
},
"peazip": {
"version": "9.5",
"source": "https://github.com/peazip/PeaZip/releases/download/9.5.0/peazip-9.5.0.WINDOWS.exe",
"remover": "C:\\Program Files\\Peazip\\unins000.exe"
}
"7zip": {
"version": "23.01",
"source": "https://www.7-zip.org/a/7z2301.exe",
"remover": "C:\\Program Files\\7-Zip\\Uninstall.exe"
},
"peazip": {
"version": "9.5",
"source": "https://github.com/peazip/PeaZip/releases/download/9.5.0/peazip-9.5.0.WINDOWS.exe",
"remover": "C:\\Program Files\\Peazip\\unins000.exe"
},
"notepad++":{
"version": "7.9.2",
"source": "https://github.com/notepad-plus-plus/notepad-plus-plus/releases/download/v7.9.2/npp.7.9.2.Installer.exe",
"remover": "C:\\Program Files\\Notepad++\\uninstall.exe",
"isUninstallerByNullsoft": true
}
}
22 changes: 14 additions & 8 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,12 @@ def is_installed(pkgname: str):
with open("C:\\Program Files\\xpykg\\installed-packages", 'r') as database:
contents = database.read()
for i in contents.splitlines():
if literal_eval(i)[0] == pkgname:
database.close()
return True
try:
if literal_eval(i)[0] == pkgname:
database.close()
return True
except SyntaxError:
continue

database.close()
return False
Expand Down Expand Up @@ -235,11 +238,14 @@ def uninstall_package(pkgname: str):
remover = ""
uninstall_type = ""
for i in contents:
if literal_eval(i)[0] == pkgname:
index = contents.index(i)
remover = literal_eval(i)[2]
uninstall_type = literal_eval(i)[3]
break
try:
if literal_eval(i)[0] == pkgname:
index = contents.index(i)
remover = literal_eval(i)[2]
uninstall_type = literal_eval(i)[3]
break
except SyntaxError:
continue

remove = remover.split("\\")
remove.pop(len(remove)-1)
Expand Down

0 comments on commit ab05a23

Please sign in to comment.