From 76714eedb84d7241769e8a604eee445a6e6e0ec6 Mon Sep 17 00:00:00 2001 From: guinux Date: Tue, 5 Mar 2013 10:52:27 +0100 Subject: [PATCH] small fixes --- gui/manager.glade | 3 +++ pamac-daemon | 6 ++++-- pamac/main.py | 19 ++++++++++++------- 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/gui/manager.glade b/gui/manager.glade index cca81c2..0b6dcf5 100644 --- a/gui/manager.glade +++ b/gui/manager.glade @@ -11,6 +11,7 @@ True True False + ManagerWindow False @@ -122,6 +123,7 @@ True True False + ManagerWindow True @@ -214,6 +216,7 @@ False 7 7 + 9 7 True end diff --git a/pamac-daemon b/pamac-daemon index f19dc75..da19cbe 100755 --- a/pamac-daemon +++ b/pamac-daemon @@ -7,7 +7,8 @@ from dbus.mainloop.glib import DBusGMainLoop from gi.repository import GObject import pyalpm -import traceback +#import traceback +#import threading from pamac import config, common class PamacDBusService(dbus.service.Object): @@ -295,7 +296,7 @@ class PamacDBusService(dbus.service.Object): except pyalpm.error as e: #error = traceback.format_exc() self.error += ' --> '+str(e)+'\n' - #nosuccess(error) + #nosuccess(self.error) #except dbus.exceptions.DBusException: #pass finally: @@ -303,6 +304,7 @@ class PamacDBusService(dbus.service.Object): return self.error else : return 'You are not authorized' + #nosuccess('You are not authorized') @dbus.service.method('org.manjaro.pamac', '', 's', sender_keyword='sender', connection_keyword='connexion') def Release(self, sender=None, connexion=None): diff --git a/pamac/main.py b/pamac/main.py index 068eaaf..91aa579 100644 --- a/pamac/main.py +++ b/pamac/main.py @@ -54,7 +54,7 @@ def action_signal_handler(action): # ProgressCancelButton.set_visible(True) #else: ProgressCancelButton.set_visible(False) - #print('cancel disabled') + #print('cancel disabled') def icon_signal_handler(icon): action_icon.set_from_file(icon) @@ -276,14 +276,17 @@ def handle_error(error): global transaction_type global transaction_dict if error: - if not 'DBus.Error.NoReply' in error: - print('error',error) + if not 'DBus.Error.NoReply' in str(error): + print('error:', error) transaction.ErrorDialog.format_secondary_text(error) response = transaction.ErrorDialog.run() if response: transaction.ErrorDialog.hide() transaction.t_lock = False - transaction.Release() + try: + transaction.Release() + except: + pass ProgressWindow.hide() if mode == 'manager': transaction.to_add = [] @@ -295,7 +298,6 @@ def handle_error(error): set_packages_list() if mode == 'updater': have_updates() - print('error',error) def handle_reply(reply): global transaction_type @@ -306,7 +308,10 @@ def handle_reply(reply): if response: transaction.ErrorDialog.hide() transaction.t_lock = False - transaction.Release() + try: + transaction.Release() + except: + pass ProgressWindow.hide() transaction.to_add = [] transaction.to_remove = [] @@ -796,7 +801,7 @@ class Handler: def on_ProgressCancelButton_clicked(self, *arg): print('cancelled') - #handle_reply('') + handle_reply('') def main(_mode): if common.pid_file_exists():