def __init__(self, db, post_message): self.data = None self.loop = None self.post_message = post_message self.transaction = self.transaction = Pamac.Transaction(database=db) self.transaction.connect("emit-action", self.on_emit_action, self.data) self.transaction.connect("emit-action-progress", self.on_emit_action_progress, self.data) self.transaction.connect("emit-hook-progress", self.on_emit_hook_progress, self.data) self.transaction.connect("emit-error", self.on_emit_error, self.data) self.transaction.connect("emit-warning", self.on_emit_warning, self.data) self.transaction.connect("finished", self.on_trans_finished, self.data)
if details.get_installed_version() == None: print('<div id=appstream_not_installed>' + _('Instalar') + '</div></a></div></div>') 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() + " "
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 __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 setPacman(self): self.config = Pamac.Config(conf_path="/etc/pamac.conf") self.db = Pamac.Database(config=self.config)
print("Error: ", e.message) else: print("Success :", success) finally: loop.quit() transaction.quit_daemon() def run_transaction(): # /!\ the transaction will run without confirmation /!\ # you need to override Transaction.ask_confirmation() method # in order to implement your own confirmation step transaction.add_pkg_to_install("pkgname") transaction.run_async(on_transaction_finished_callback, None) # launch a loop to wait for the callback to be called loop.run() if __name__ == "__main__": loop = GLib.MainLoop() config = Pamac.Config(conf_path="/etc/pamac.conf") db = Pamac.Database(config=config) transaction = Pamac.Transaction(database=db) data = None transaction.connect("emit-action", on_emit_action, data) transaction.connect("emit-action-progress", on_emit_action_progress, data) transaction.connect("emit-hook-progress", on_emit_hook_progress, data) transaction.connect("emit-error", on_emit_error, data) transaction.connect("emit-warning", on_emit_warning, data) run_transaction()
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