From bf79643b449b618d48b345aae09593b583392c8a Mon Sep 17 00:00:00 2001 From: guinux Date: Sun, 19 May 2013 15:17:08 +0200 Subject: [PATCH] fixes --- pamac-daemon.py | 7 ++----- pamac-install.py | 12 ++++++------ pamac/main.py | 10 +++++++--- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/pamac-daemon.py b/pamac-daemon.py index 492e2de..b69bafd 100755 --- a/pamac-daemon.py +++ b/pamac-daemon.py @@ -160,10 +160,9 @@ class PamacDBusService(dbus.service.Object): if not (level & _logmask): return if level & pyalpm.LOG_ERROR: - self.error += "ERROR: "+line + #self.error += "ERROR: "+line #self.EmitLogError(line) - print(self.error) - #self.t.release() + print(line) elif level & pyalpm.LOG_WARNING: self.warning += "WARNING: "+line #self.EmitLogWarning(line) @@ -379,7 +378,6 @@ class PamacDBusService(dbus.service.Object): try: self.t.prepare() except pyalpm.error as e: - print(e) self.error += ' --> '+str(e)+'\n' finally: return self.error @@ -426,7 +424,6 @@ class PamacDBusService(dbus.service.Object): try: self.t.commit() except pyalpm.error as e: - #error = traceback.format_exc() self.error += ' --> '+str(e)+'\n' #except dbus.exceptions.DBusException: #pass diff --git a/pamac-install.py b/pamac-install.py index eb71058..57460f8 100755 --- a/pamac-install.py +++ b/pamac-install.py @@ -5,7 +5,7 @@ from gi.repository import GObject from sys import argv import dbus from os.path import abspath -from pamac import common, main +from pamac import common # i18n import gettext @@ -35,7 +35,6 @@ def get_pkgs(pkgs): for pkg in pkgs: if '.pkg.tar.' in pkg: full_path = abspath(pkg) - print('path',full_path) transaction.to_load.add(full_path) elif pkg in transaction.syncpkgs.keys(): transaction.to_add.add(pkg) @@ -84,12 +83,13 @@ def install(pkgs): exiting('') if common.pid_file_exists(): - main.ErrorDialog.format_secondary_text(_('Pamac is already running')) - response = main.ErrorDialog.run() + from pamac.main import ErrorDialog + ErrorDialog.format_secondary_text(_('Pamac is already running')) + response = ErrorDialog.run() if response: - main.ErrorDialog.hide() + ErrorDialog.hide() else: - from pamac import transaction + from pamac import transaction, main transaction.get_handle() transaction.update_db() do_syncfirst, updates = transaction.get_updates() diff --git a/pamac/main.py b/pamac/main.py index 816f9fa..cc25918 100644 --- a/pamac/main.py +++ b/pamac/main.py @@ -43,6 +43,8 @@ progress_label = interface.get_object('progresslabel2') action_icon = interface.get_object('action_icon') ProgressCancelButton = interface.get_object('ProgressCancelButton') +mode = None + def action_signal_handler(action): if action: progress_label.set_text(action) @@ -361,7 +363,7 @@ def handle_error(error): # Gtk.main_iteration() if error: if not 'DBus.Error.NoReply' in str(error): - print('error:', error) + print(error) ErrorDialog.format_secondary_text(error) response = ErrorDialog.run() if response: @@ -510,7 +512,8 @@ def check_conflicts(): warning = '' error = '' print('checking...') - Window.get_window().set_cursor(Gdk.Cursor(Gdk.CursorType.WATCH)) + if mode: + Window.get_window().set_cursor(Gdk.Cursor(Gdk.CursorType.WATCH)) while Gtk.events_pending(): Gtk.main_iteration() to_check = [transaction.syncpkgs[name] for name in transaction.to_add | transaction.to_update] @@ -821,7 +824,8 @@ def check_conflicts(): for pkg in pkg_list: wont_be_removed.add(pkg.name) - Window.get_window().set_cursor(None) + if mode: + Window.get_window().set_cursor(None) print('check done') if warning: WarningDialog.format_secondary_text(warning)