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):
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

View File

@ -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()

View File

@ -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)