2023-01-19 11:05:14 -01:00
|
|
|
"""
|
|
|
|
* Author: "PepDebian(peppermintosteam@proton.me)
|
|
|
|
*
|
|
|
|
* License: SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
*
|
|
|
|
* this script is for performing utility functions
|
|
|
|
*
|
|
|
|
"""
|
2022-07-19 18:52:03 +00:00
|
|
|
|
|
|
|
import apt
|
|
|
|
|
|
|
|
#gets all installed packages
|
|
|
|
cache = apt.Cache()
|
|
|
|
|
|
|
|
#Checks if a package is installed
|
2023-01-19 11:05:14 -01:00
|
|
|
def install_check(appname):
|
|
|
|
"""This one check is a application is installed"""
|
2022-07-19 18:52:03 +00:00
|
|
|
try:
|
|
|
|
print(appname,cache[appname].is_installed)
|
|
|
|
return cache[appname].is_installed
|
|
|
|
except:
|
|
|
|
#probably not installed or otherwise throws errors on check
|
|
|
|
return False
|