Commit b8153ea4 authored by Philip Müller's avatar Philip Müller

Pamac 2.0

- complete rewrite in vala
- it now directly depends on libalpm so it is easier to maintain
- it is faster and uses less memory
- alpm bindings for vala, other people could be interested
- a DBus daemon which can perform every tasks which need root access using polkit to check authorization, it can be used by any other program.
- pamac-manager and pamac-updater as you know before but with some new design, try them !
- the progress dialog now includes a terminal, it permits to launch yaourt which is used now to build packages from AUR.
- reinstall a package
- install optional dependencies of a package
- mark a package as explicitly installed
parent df8ca4fc
__pycache__
refresh-sources.sh
*~
pkgbuild
resources/*.c
src/pamac-daemon
src/pamac-tray
src/pamac-manager
src/pamac-install
src/pamac-updater
data/polkit/org.manjaro.pamac.policy
po/*.mo
po/*~
po/locale
[main]
host = https://www.transifex.com
lang_map = af_ZA: af-ZA, am_ET: am-ET, ar_AE: ar-AE, ar_BH: ar-BH, ar_DZ: ar-DZ, ar_EG: ar-EG, ar_IQ: ar-IQ, ar_JO: ar-JO, ar_KW: ar-KW, ar_LB: ar-LB, ar_LY: ar-LY, ar_MA: ar-MA, ar_OM: ar-OM, ar_QA: ar-QA, ar_SA: ar-SA, ar_SY: ar-SY, ar_TN: ar-TN, ar_YE: ar-YE, arn_CL: arn-CL, as_IN: as-IN, az_AZ: az-AZ, ba_RU: ba-RU, be_BY: be-BY, bg_BG: bg-BG, bn_BD: bn-BD, bn_IN: bn-IN, bo_CN: bo-CN, br_FR: br-FR, bs_BA: bs-BA, ca_ES: ca-ES, co_FR: co-FR, cs_CZ: cs-CZ, cy_GB: cy-GB, da_DK: da-DK, de_AT: de-AT, de_CH: de-CH, de_DE: de-DE, de_LI: de-LI, de_LU: de-LU, dsb_DE: dsb-DE, dv_MV: dv-MV, el_GR: el-GR, en_AU: en-AU, en_BZ: en-BZ, en_CA: en-CA, en_GB: en-GB, en_IE: en-IE, en_IN: en-IN, en_JM: en-JM, en_MY: en-MY, en_NZ: en-NZ, en_PH: en-PH, en_SG: en-SG, en_TT: en-TT, en_US: en-US, en_ZA: en-ZA, en_ZW: en-ZW, es_AR: es-AR, es_BO: es-BO, es_CL: es-CL, es_CO: es-CO, es_CR: es-CR, es_DO: es-DO, es_EC: es-EC, es_ES: es-ES, es_GT: es-GT, es_HN: es-HN, es_MX: es-MX, es_NI: es-NI, es_PA: es-PA, es_PE: es-PE, es_PR: es-PR, es_PY: es-PY, es_SV: es-SV, es_US: es-US, es_UY: es-UY, es_VE: es-VE, et_EE: et-EE, eu_ES: eu-ES, fa_IR: fa-IR, fi_FI: fi-FI, fil_PH: fil-PH, fo_FO: fo-FO, fr_BE: fr-BE, fr_CA: fr-CA, fr_CH: fr-CH, fr_FR: fr-FR, fr_LU: fr-LU, fr_MC: fr-MC, fy_NL: fy-NL, ga_IE: ga-IE, gd_GB: gd-GB, gl_ES: gl-ES, gsw_FR: gsw-FR, gu_IN: gu-IN, ha_NG: ha-NG, he_IL: he-IL, hi_IN: hi-IN, hr_BA: hr-BA, hr_HR: hr-HR, hsb_DE: hsb-DE, hu_HU: hu-HU, hy_AM: hy-AM, id_ID: id-ID, ig_NG: ig-NG, ii_CN: ii-CN, is_IS: is-IS, it_CH: it-CH, it_IT: it-IT, iu_CA: iu-CA, ja_JP: ja-JP, ka_GE: ka-GE, kk_KZ: kk-KZ, kl_GL: kl-GL, km_KH: km-KH, kn_IN: kn-IN, ko_KR: ko-KR, kok_IN: kok-IN, ky_KG: ky-KG, lb_LU: lb-LU, lo_LA: lo-LA, lt_LT: lt-LT, lv_LV: lv-LV, mi_NZ: mi-NZ, mk_MK: mk-MK, ml_IN: ml-IN, mn_CN: mn-CN, mn_MN: mn-MN, moh_CA: moh-CA, mr_IN: mr-IN, ms_BN: ms-BN, ms_MY: ms-MY, mt_MT: mt-MT, nb_NO: nb-NO, ne_NP: ne-NP, nl_BE: nl-BE, nl_NL: nl-NL, nn_NO: nn-NO, nso_ZA: nso-ZA, oc_FR: oc-FR, or_IN: or-IN, pa_IN: pa-IN, pl_PL: pl-PL, prs_AF: prs-AF, ps_AF: ps-AF, pt_BR: pt-BR, pt_PT: pt-PT, qut_GT: qut-GT, quz_BO: quz-BO, quz_EC: quz-EC, quz_PE: quz-PE, rm_CH: rm-CH, ro_RO: ro-RO, ru_RU: ru-RU, rw_RW: rw-RW, sa_IN: sa-IN, sah_RU: sah-RU, se_FI: se-FI, se_NO: se-NO, se_SE: se-SE, si_LK: si-LK, sk_SK: sk-SK, sl_SI: sl-SI, sma_NO: sma-NO, sma_SE: sma-SE, smj_NO: smj-NO, smj_SE: smj-SE, smn_FI: smn-FI, sms_FI: sms-FI, sq_AL: sq-AL, sr_BA: sr-BA, sr_CS: sr-CS, sr_ME: sr-ME, sr_RS: sr-RS, sv_FI: sv-FI, sv_SE: sv-SE, sw_KE: sw-KE, syr_SY: syr-SY, ta_IN: ta-IN, te_IN: te-IN, tg_TJ: tg-TJ, th_TH: th-TH, tk_TM: tk-TM, tn_ZA: tn-ZA, tr_TR: tr-TR, tt_RU: tt-RU, tzm_DZ: tzm-DZ, ug_CN: ug-CN, uk_UA: uk-UA, ur_PK: ur-PK, uz_UZ: uz-UZ, vi_VN: vi-VN, wo_SN: wo-SN, xh_ZA: xh-ZA, yo_NG: yo-NG, zh_CN: zh-CN, zh_HK: zh-HK, zh_MO: zh-MO, zh_SG: zh-SG, zh_TW: zh-TW, zu_ZA: zu-ZA
[manjaro-pamac.pamacpot]
file_filter = po/<lang>.po
source_file = po/pamac.pot
source_lang = en
type = PO
all:
cd resources; make resources
cd src; make binaries
cd po; make gettext
clean:
rm -f src/*.c src/pamac-daemon src/pamac-tray src/pamac-updater src/pamac-manager src/pamac-install
rm -r resources/*.c
rm -rf po/locale
rm -f po/*.mo
rm -f data/polkit/org.manjaro.pamac.policy
install:
mkdir -p /usr/share/icons/hicolor
cp -r data/icons/* /usr/share/icons/hicolor
cp -r po/locale /usr/share
install -Dm744 src/pamac-daemon /usr/bin/pamac-daemon
install -Dm755 src/pamac-tray /usr/bin/pamac-tray
install -Dm755 src/pamac-manager /usr/bin/pamac-manager
install -Dm755 src/pamac-updater /usr/bin/pamac-updater
install -Dm755 src/pamac-install /usr/bin/pamac-install
#install -Dm755 src/pamac-refresh /usr/bin/pamac-refresh
install -Dm755 src/pamac-install /usr/bin/pamac-install
install -Dm644 data/applications/pamac-tray.desktop /etc/xdg/autostart/pamac-tray.desktop
install -Dm644 data/applications/pamac-manager.desktop /usr/share/applications/pamac-manager.desktop
install -Dm644 data/applications/pamac-updater.desktop /usr/share/applications/pamac-updater.desktop
install -Dm644 data/applications/pamac-install.desktop /usr/share/applications/pamac-install.desktop
install -Dm644 data/config/pamac.conf /etc/pamac.conf
install -Dm644 data/dbus/org.manjaro.pamac.conf /etc/dbus-1/system.d/org.manjaro.pamac.conf
install -Dm644 data/dbus/org.manjaro.pamac.service /usr/share/dbus-1/system-services/org.manjaro.pamac.service
install -Dm644 data/systemd/pamac.service /usr/lib/systemd/system/pamac.service
#install -Dm744 data/networkmanager/99_update_pamac_tray /etc/NetworkManager/dispatcher.d/99_update_pamac_tray
install -Dm644 data/polkit/org.manjaro.pamac.policy /usr/share/polkit-1/actions/org.manjaro.pamac.policy
uninstall:
rm -f /usr/share/icons/16x16/apps/system-software-install.png
rm -f /usr/share/icons/24x24/status/pamac-tray-no-update.png
rm -f /usr/share/icons/24x24/status/pamac-tray-update.png
rm -f /usr/share/icons/32x32/apps/system-software-install.png
rm -f /usr/share/locale/*/LC_MESSAGES/pamac.mo
rm -f /usr/bin/pamac-daemon /usr/bin/pamac-updater /usr/bin/pamac-tray /usr/bin/pamac-manager /usr/bin/pamac-install
rm -f /etc/xdg/autostart/pamac-tray.desktop
rm -f /usr/share/applications/pamac-manager.desktop /usr/share/applications/pamac-updater.desktop /usr/share/applications/pamac-install.desktop
rm -f /etc/pamac.conf
rm -f /etc/dbus-1/system.d/org.manjaro.pamac.conf
rm -f /usr/share/dbus-1/system-services/org.manjaro.pamac.service
rm -f /usr/lib/systemd/system/pamac.service
rm -f /usr/share/polkit-1/actions/org.manjaro.pamac.policy
A DBus daemon and Gtk3 frontend for libalpm written in Vala
Features:
- Alpm bindings for Vala
- a DBus daemon to perform every tasks with root access using polkit to check authorizations
- a Gtk3 Package Manager
- a Gtk3 Updates Manager
- a Tray icon with configurable periodic refresh and updates notifications
- a complete AUR support:
* multiple words search capability
* Enable/Disable check updates from AUR
* Build and update your AUR packages in a integrated terminal using yaourt
......@@ -128,4 +128,4 @@ Type=Application
Icon=system-software-install
StartupNotify=true
NoDisplay=true
MimeType=application/x-xz-compressed-tar;
MimeType=application/x-alpm-package;
<?xml version="1.0"?>
<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>
<mime-type type="application/x-alpm-package">
<generic-icon name="package-x-generic"/>
<comment>Alpm Package</comment>
<glob pattern="*.pkg.tar.xz"/>
</mime-type>
</mime-info>
......@@ -14,12 +14,4 @@
<allow_active>auth_admin_keep</allow_active>
</defaults>
</action>
<action id="org.manjaro.pamac.write_config">
<message>Authentication is required</message>
<defaults>
<allow_any>no</allow_any>
<allow_inactive>no</allow_inactive>
<allow_active>auth_admin_keep</allow_active>
</defaults>
</action>
</policyconfig>
/*
* pactree.vala - a simple dependency tree viewer translated in Vala
*
* Copyright (C) 2014 Guillaume Benoit <guillaume@manjaro.org>
* Copyright (c) 2010-2011 Pacman Development Team <pacman-dev@archlinux.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
// Compile with: valac --pkg=libalpm --vapidir=../vapi --Xcc=-I../util ../util/alpm-util.c pactree.vala -o pactree
using Alpm;
/* output */
string provides;
string unresolvable;
string branch_tip1;
string branch_tip2;
int indent_size;
/* color */
string branch1_color;
string branch2_color;
string leaf1_color;
string leaf2_color;
string color_off;
/* globals */
Handle handle;
unowned DB localdb;
Alpm.List<string?> walked = null;
Alpm.List<string?> provisions = null;
/* options */
bool color;
bool graphviz;
bool linear;
int max_depth;
bool reverse;
bool unique;
string dbpath;
const OptionEntry[] options = {
{ "dbpath", 'b', 0, OptionArg.STRING, ref dbpath, "set an alternate database location", "path" },
{ "color", 'c', 0, OptionArg.NONE, ref color, "colorize output", null },
{ "depth", 'd', 0, OptionArg.INT, ref max_depth, "limit the depth of recursion", "number" },
{ "graph", 'g', 0, OptionArg.NONE, ref graphviz, "generate output for graphviz", null },
{ "linear", 'l', 0, OptionArg.NONE, ref linear, "enable linear output", null },
{ "reverse", 'r', 0, OptionArg.NONE, ref reverse, "show reverse dependencies", null },
{ "unique", 'u', 0, OptionArg.NONE, ref unique, "show dependencies with no duplicates (implies -l)", null },
{ null }
};
static void init_options() {
/* initialize options */
color = false;
graphviz = false;
linear = false;
max_depth = -1;
reverse = false;
unique = false;
dbpath = "/var/lib/pacman";
/* output */
provides = " provides";
unresolvable = " [unresolvable]";
branch_tip1 = "|--";
branch_tip2 = "+--";
indent_size = 3;
/* color */
branch1_color = "\033[0;33m"; /* yellow */
branch2_color = "\033[0;37m"; /* white */
leaf1_color = "\033[1;32m"; /* bold green */
leaf2_color = "\033[0;32m"; /* green */
color_off = "\033[0m";
}
static int parse_options(ref unowned string[] args) {
var opts = new OptionContext("");
opts.set_help_enabled(true);
opts.add_main_entries(options, null);
try {
bool b = opts.parse(ref args);
if (!b) {
stderr.puts(opts.get_help(false, null));
return 1;
}
}
catch (OptionError e)
{
stderr.puts("Unable to parse options : " + e.message + "\n");
return 1;
}
/* there must be (at least) one argument left */
if (args.length == 1) return 1;
/* unique implies linear */
if (unique) linear = true;
/* no color */
if (!color) {
branch1_color = branch2_color = "";
leaf1_color = leaf2_color = "";
color_off = "";
}
/* linear */
if (linear) {
provides = "";
branch_tip1 = branch_tip2 = "";
indent_size = 0;
}
return 0;
}
static void local_init() {
Alpm.Errno error;
handle = new Handle ("/", dbpath, out error);
assert (error == 0);
localdb = handle.localdb;
assert (localdb != null);
}
static int main (string[] args) {
init_options();
int ret = parse_options(ref args);
if (ret != 0) return ret;
local_init();
string? target_name = args[1];
unowned Package? pkg = find_satisfier(localdb.pkgcache, target_name);
if (pkg == null) {
stderr.printf("Error: package '%s' not found\n", target_name);
return 1;
}
/* begin writing */
print_start(pkg.name, target_name);
if(reverse)
walk_reverse_deps(pkg, 1);
else
walk_deps(pkg, 1);
print_end();
return 0;
}
static void print_text(string? pkg, string? provision, int depth)
{
int indent_sz = (depth + 1) * indent_size;
if ((pkg == null) && (provision == null)) return;
if (pkg == null) {
/* we failed to resolve provision */
stdout.printf("%s%*s%s%s%s%s%s\n", branch1_color, indent_sz, branch_tip1,
leaf1_color, provision, branch1_color, unresolvable, color_off);
} else if ((provision != null) && (provision != pkg)) {
/* pkg provides provision */
stdout.printf("%s%*s%s%s%s%s %s%s%s\n", branch2_color, indent_sz, branch_tip2,
leaf1_color, pkg, leaf2_color, provides, leaf1_color, provision,
color_off);
} else {
/* pkg is a normal package */
stdout.printf("%s%*s%s%s%s\n", branch1_color, indent_sz, branch_tip1, leaf1_color,
pkg, color_off);
}
}
/**
* walk dependencies in reverse, showing packages which require the target
*/
static void walk_reverse_deps(Package pkg, int depth) {
if((max_depth >= 0) && (depth > max_depth)) return;
walked.add(pkg.name);
unowned Alpm.List<string?> required_by = pkg.compute_requiredby ();
foreach(string? i in required_by) {
string pkgname = i;
if (walked.find_str(pkgname) != null) {
/* if we've already seen this package, don't print in "unique" output
* and don't recurse */
if (!unique) print(pkg.name, pkgname, null, depth);
} else {
print(pkg.name, pkgname, null, depth);
walk_reverse_deps(localdb.get_pkg(pkgname), depth + 1);
}
}
}
/**
* walk dependencies, showing dependencies of the target
*/
static void walk_deps(Package pkg, int depth)
{
if((max_depth >= 0) && (depth > max_depth)) return;
walked.add(pkg.name);
foreach (unowned Depend depend in pkg.depends) {
string depname = depend.name;
unowned Package? provider = find_satisfier (localdb.pkgcache, depname);
if (provider != null) {
string provname = provider.name;
if (walked.find_str (provname) != null) {
/* if we've already seen this package, don't print in "unique" output
* and don't recurse */
if (!unique) {
print (pkg.name, provname, depname, depth);
}
} else {
print (pkg.name, provname, depname, depth);
walk_deps(provider, depth + 1);
}
} else {
/* unresolvable package */
print(pkg.name, null, depname, depth);
}
}
}
static void print_graph(string parentname, string? pkgname, string? depname)
{
if(depname != null) {
stdout.printf("\"%s\" -> \"%s\" [color=chocolate4];\n", parentname, depname);
if((pkgname != null) && (depname != pkgname) && (provisions.find_str(depname) != null)) {
stdout.printf("\"%s\" -> \"%s\" [arrowhead=none, color=grey];\n", depname, pkgname);
provisions.add(depname);
}
} else if(pkgname != null) {
stdout.printf("\"%s\" -> \"%s\" [color=chocolate4];\n", parentname, pkgname);
}
}
/* parent depends on dep which is satisfied by pkg */
static void print(string? parentname, string? pkgname, string? depname, int depth)
{
if(graphviz) {
print_graph(parentname, pkgname, depname);
} else {
print_text(pkgname, depname, depth);
}
}
static void print_start(string pkgname, string provname)
{
if(graphviz) {
stdout.printf("digraph G { START [color=red, style=filled];\n" +
"node [style=filled, color=green];\n" +
" \"START\" -> \"%s\";\n", pkgname);
} else {
print_text(pkgname, provname, 0);
}
}
static void print_end()
{
if(graphviz) {
/* close graph output */
stdout.printf("}\n");
}
}
./pamac-daemon.py
./pamac-manager.py
./pamac-updater.py
./pamac-tray.py
./pamac-install.py
./pamac/transaction.py
./pamac/common.py
./gui/manager.ui
./gui/updater.ui
./gui/dialogs.ui
This diff is collapsed.
#! /usr/bin/python3
# -*- coding:utf-8 -*-
# pamac - A Python implementation of alpm
# Copyright (C) 2013 Guillaume Benoit <guillaume@manjaro.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
from gi.repository import GObject
from pamac import common, transaction
import dbus
def handle_updates(updates):
transaction.StopDaemon()
loop.quit()
loop = GObject.MainLoop()
if not common.pid_file_exists():
bus = dbus.SystemBus()
bus.add_signal_receiver(handle_updates, dbus_interface = "org.manjaro.pamac", signal_name = "EmitAvailableUpdates")
transaction.get_dbus_methods()
try:
transaction.CheckUpdates()
except:
pass
else:
loop.run()
This diff is collapsed.
#! /usr/bin/python3
# -*- coding:utf-8 -*-
# pamac - A Python implementation of alpm
# Copyright (C) 2013-2014 Guillaume Benoit <guillaume@manjaro.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
from gi.repository import Gtk
from sys import argv
import dbus
from os.path import abspath
from pamac import common, config, transaction, aur
# i18n
import gettext
import locale
locale.bindtextdomain('pamac', '/usr/share/locale')
gettext.bindtextdomain('pamac', '/usr/share/locale')
gettext.textdomain('pamac')
_ = gettext.gettext
def exiting(msg):
transaction.StopDaemon()
print(msg)
print('exiting')
Gtk.main_quit()
def handle_error(error):
transaction.ProgressWindow.hide()
while Gtk.events_pending():
Gtk.main_iteration()
if error:
if not 'DBus.Error.NoReply' in str(error):
transaction.ErrorDialog.format_secondary_text(error)
response = transaction.ErrorDialog.run()
if response:
transaction.ErrorDialog.hide()
exiting(error)
def handle_reply(reply):
transaction.ProgressCloseButton.set_visible(True)
transaction.action_icon.set_from_icon_name('dialog-information', Gtk.IconSize.BUTTON)
transaction.progress_label.set_text(str(reply))
transaction.progress_bar.set_text('')
end_iter = transaction.progress_buffer.get_end_iter()
transaction.progress_buffer.insert(end_iter, str(reply))
def handle_updates(update_data):
syncfirst, updates = update_data
if transaction_done:
exiting('')
elif updates:
transaction.ErrorDialog.format_secondary_text(_('Some updates are available.\nPlease update your system first'))
response = transaction.ErrorDialog.run()
if response:
transaction.ErrorDialog.hide()
exiting('')
else:
transaction.action_handler(_('Preparing')+'...')
transaction.icon_handler('/usr/share/pamac/icons/24x24/status/package-setup.png')
while Gtk.events_pending():
Gtk.main_iteration()
common.write_pid_file()
transaction.interface.connect_signals(signals)
transaction.config_dbus_signals()
pkgs_to_install = argv[1:]
install(pkgs_to_install)
def on_TransValidButton_clicked(*args):
transaction.ConfDialog.hide()
while Gtk.events_pending():
Gtk.main_iteration()
transaction.finalize()
def on_TransCancelButton_clicked(*args):
transaction.ConfDialog.hide()
while Gtk.events_pending():
Gtk.main_iteration()
transaction.Release()
exiting('')
def on_ProgressCloseButton_clicked(*args):
global transaction_done
transaction.ProgressWindow.hide()
while Gtk.events_pending():
Gtk.main_iteration()
transaction_done = True
transaction.CheckUpdates()
def on_ProgressCancelButton_clicked(*args):
transaction.Interrupt()
transaction.ProgressWindow.hide()
while Gtk.events_pending():
Gtk.main_iteration()
exiting('')
def get_pkgs(pkgs):
error = ''
for name in pkgs:
if '.pkg.tar.' in name:
full_path = abspath(name)
transaction.to_load.add(full_path)
elif transaction.get_syncpkg(name):
transaction.to_add.add(name)
else:
aur_pkg = None
if config.enable_aur:
aur_pkg = aur.info(name)
if aur_pkg:
transaction.to_build.append(aur_pkg)
if not aur_pkg:
if error:
error += '\n'
error += _('{pkgname} is not a valid path or package name').format(pkgname = name)
if error:
handle_error(error)
return False
else:
return True
def install(pkgs):
if get_pkgs(pkgs):
error = transaction.run()
while Gtk.events_pending():
Gtk.main_iteration()
if error:
handle_error(error)
signals = {'on_ChooseButton_clicked' : transaction.on_ChooseButton_clicked,
'on_progress_textview_size_allocate' : transaction.on_progress_textview_size_allocate,
'on_choose_renderertoggle_toggled' : transaction.on_choose_renderertoggle_toggled,
'on_PreferencesCloseButton_clicked' : transaction.on_PreferencesCloseButton_clicked,
'on_PreferencesWindow_delete_event' : transaction.on_PreferencesWindow_delete_event,
'on_PreferencesValidButton_clicked' : transaction.on_PreferencesValidButton_clicked,
'on_TransValidButton_clicked' :on_TransValidButton_clicked,
'on_TransCancelButton_clicked' :on_TransCancelButton_clicked,
'on_ProgressCloseButton_clicked' : on_ProgressCloseButton_clicked,
'on_ProgressCancelButton_clicked' : on_ProgressCancelButton_clicked}
def config_dbus_signals():
bus = dbus.SystemBus()
bus.add_signal_receiver(handle_reply, dbus_interface = "org.manjaro.pamac", signal_name = "EmitTransactionDone")
bus.add_signal_receiver(handle_error, dbus_interface = "org.manjaro.pamac", signal_name = "EmitTransactionError")
bus.add_signal_receiver(handle_updates, dbus_interface = "org.manjaro.pamac", signal_name = "EmitAvailableUpdates")
if common.pid_file_exists():
transaction.ErrorDialog.format_secondary_text(_('Pamac is already running'))
response = transaction.ErrorDialog.run()
if response:
transaction.ErrorDialog.hide()
else:
transaction_done = False
transaction.get_handle()
transaction.get_dbus_methods()
config_dbus_signals()
transaction.get_updates()
Gtk.main()
This diff is collapsed.
#! /usr/bin/python3
# -*- coding:utf-8 -*-
# pamac - A Python implementation of alpm
# Copyright (C) 2013 Guillaume Benoit <guillaume@manjaro.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License