This commit is contained in:
guinux 2013-05-19 15:17:08 +02:00
parent c50d0e8c7f
commit bf79643b44
3 changed files with 15 additions and 14 deletions

View File

@ -160,10 +160,9 @@ class PamacDBusService(dbus.service.Object):
if not (level & _logmask): if not (level & _logmask):
return return
if level & pyalpm.LOG_ERROR: if level & pyalpm.LOG_ERROR:
self.error += "ERROR: "+line #self.error += "ERROR: "+line
#self.EmitLogError(line) #self.EmitLogError(line)
print(self.error) print(line)
#self.t.release()
elif level & pyalpm.LOG_WARNING: elif level & pyalpm.LOG_WARNING:
self.warning += "WARNING: "+line self.warning += "WARNING: "+line
#self.EmitLogWarning(line) #self.EmitLogWarning(line)
@ -379,7 +378,6 @@ class PamacDBusService(dbus.service.Object):
try: try:
self.t.prepare() self.t.prepare()
except pyalpm.error as e: except pyalpm.error as e:
print(e)
self.error += ' --> '+str(e)+'\n' self.error += ' --> '+str(e)+'\n'
finally: finally:
return self.error return self.error
@ -426,7 +424,6 @@ class PamacDBusService(dbus.service.Object):
try: try:
self.t.commit() self.t.commit()
except pyalpm.error as e: except pyalpm.error as e:
#error = traceback.format_exc()
self.error += ' --> '+str(e)+'\n' self.error += ' --> '+str(e)+'\n'
#except dbus.exceptions.DBusException: #except dbus.exceptions.DBusException:
#pass #pass

View File

@ -5,7 +5,7 @@ from gi.repository import GObject
from sys import argv from sys import argv
import dbus import dbus
from os.path import abspath from os.path import abspath
from pamac import common, main from pamac import common
# i18n # i18n
import gettext import gettext
@ -35,7 +35,6 @@ def get_pkgs(pkgs):
for pkg in pkgs: for pkg in pkgs:
if '.pkg.tar.' in pkg: if '.pkg.tar.' in pkg:
full_path = abspath(pkg) full_path = abspath(pkg)
print('path',full_path)
transaction.to_load.add(full_path) transaction.to_load.add(full_path)
elif pkg in transaction.syncpkgs.keys(): elif pkg in transaction.syncpkgs.keys():
transaction.to_add.add(pkg) transaction.to_add.add(pkg)
@ -84,12 +83,13 @@ def install(pkgs):
exiting('') exiting('')
if common.pid_file_exists(): if common.pid_file_exists():
main.ErrorDialog.format_secondary_text(_('Pamac is already running')) from pamac.main import ErrorDialog
response = main.ErrorDialog.run() ErrorDialog.format_secondary_text(_('Pamac is already running'))
response = ErrorDialog.run()
if response: if response:
main.ErrorDialog.hide() ErrorDialog.hide()
else: else:
from pamac import transaction from pamac import transaction, main
transaction.get_handle() transaction.get_handle()
transaction.update_db() transaction.update_db()
do_syncfirst, updates = transaction.get_updates() do_syncfirst, updates = transaction.get_updates()

View File

@ -43,6 +43,8 @@ progress_label = interface.get_object('progresslabel2')
action_icon = interface.get_object('action_icon') action_icon = interface.get_object('action_icon')
ProgressCancelButton = interface.get_object('ProgressCancelButton') ProgressCancelButton = interface.get_object('ProgressCancelButton')
mode = None
def action_signal_handler(action): def action_signal_handler(action):
if action: if action:
progress_label.set_text(action) progress_label.set_text(action)
@ -361,7 +363,7 @@ def handle_error(error):
# Gtk.main_iteration() # Gtk.main_iteration()
if error: if error:
if not 'DBus.Error.NoReply' in str(error): if not 'DBus.Error.NoReply' in str(error):
print('error:', error) print(error)
ErrorDialog.format_secondary_text(error) ErrorDialog.format_secondary_text(error)
response = ErrorDialog.run() response = ErrorDialog.run()
if response: if response:
@ -510,6 +512,7 @@ def check_conflicts():
warning = '' warning = ''
error = '' error = ''
print('checking...') print('checking...')
if mode:
Window.get_window().set_cursor(Gdk.Cursor(Gdk.CursorType.WATCH)) Window.get_window().set_cursor(Gdk.Cursor(Gdk.CursorType.WATCH))
while Gtk.events_pending(): while Gtk.events_pending():
Gtk.main_iteration() Gtk.main_iteration()
@ -821,6 +824,7 @@ def check_conflicts():
for pkg in pkg_list: for pkg in pkg_list:
wont_be_removed.add(pkg.name) wont_be_removed.add(pkg.name)
if mode:
Window.get_window().set_cursor(None) Window.get_window().set_cursor(None)
print('check done') print('check done')
if warning: if warning: