else: with open('/tmp/bigstore/upgradeable.txt') as f: if '\n' + details.get_name() + '\n' in f.read(): print('<div id=appstream_upgradable>' + _('Atualizar') + '</div></a></div></div>') else: print('<div id=appstream_installed>' + _('Remover') + '</div></a></div></div>') if __name__ == "__main__": config = Pamac.Config(conf_path="/etc/pamac.conf") config.set_enable_aur(False) config.set_enable_flatpak(False) config.set_enable_snap(False) db = Pamac.Database(config=config) pkgname = sys.argv[1] #print ("Without appstream support:") #pkgs = db.search_pkgs (pkgname) #for pkg in pkgs: #print_pkg_details (pkg) db.enable_appstream() pkgs = db.search_pkgs(pkgname) num = 0 pkg_filter = " " + sys.argv[1].split()[0].lower() + " " without_duplicates = [] # Filtered Search for pkg in pkgs:
import gi gi.require_version('Pamac', '9.0') from gi.repository import Pamac from flask import Flask from flask_caching import Cache from discover.templateUtils import truncate_description app = Flask(__name__) cache = Cache(app, config={ "CACHE_TYPE": "filesystem", 'CACHE_DIR': './data/cache', "CACHE_DEFAULT_TIMEOUT": 3600 }) app.jinja_env.filters['truncate_description'] = truncate_description app.jinja_env.trim_blocks = True app.jinja_env.lstrip_blocks = True database = Pamac.Database( config=Pamac.Config( conf_path="/etc/pamac.conf" )) database.enable_appstream() import discover.views
def setPacman(self): self.config = Pamac.Config(conf_path="/etc/pamac.conf") self.db = Pamac.Database(config=self.config)
def __init__(self): self.config = Pamac.Config(conf_path="/etc/pamac.conf") #self.config.set_enable_aur(True) # is true self.db = Pamac.Database(config=self.config) self.db.enable_appstream()
def setUp(self): """init tests""" locale.setlocale(locale.LC_ALL, '') config = Pamac.Config(conf_path="/etc/pamac.conf") config.set_enable_aur(True) # is true self.db = Pamac.Database(config=config) # view src/database.vala