This commit is contained in:
guinux 2013-11-29 09:49:28 +01:00
parent 10c2dfebd5
commit dd702da40a
6 changed files with 11 additions and 21 deletions

View File

@ -51,7 +51,6 @@ class PamacDBusService(dbus.service.Object):
self.previous_percent = 0
self.total_size = 0
self.already_transferred = 0
self.handle = config.handle()
self.local_packages = set()
self.localdb = None
self.syncdbs = None

View File

@ -154,7 +154,6 @@ if common.pid_file_exists():
else:
transaction_done = False
transaction.get_handle()
transaction.update_dbs()
transaction.get_dbus_methods()
config_dbus_signals()
transaction.get_updates()

View File

@ -422,7 +422,6 @@ def handle_error(error):
transaction.progress_buffer.delete(transaction.progress_buffer.get_start_iter(),transaction.progress_buffer.get_end_iter())
transaction.Release()
transaction.get_handle()
transaction.update_dbs()
transaction.mark_needed_pkgs_as_dep()
transaction.to_add.clear()
transaction.to_remove.clear()
@ -447,7 +446,6 @@ def handle_reply(reply):
transaction.get_updates()
transaction.Release()
transaction.get_handle()
transaction.update_dbs()
transaction.mark_needed_pkgs_as_dep()
transaction.to_add.clear()
transaction.to_remove.clear()
@ -909,7 +907,6 @@ else:
repo_column.set_cell_data_func(repo_renderertext, repo_column_display_func)
size_column.set_cell_data_func(size_renderertext, size_column_display_func)
transaction.get_handle()
transaction.update_dbs()
update_lists()
ManagerWindow.show_all()
ManagerWindow.get_window().set_cursor(Gdk.Cursor(Gdk.CursorType.WATCH))

View File

@ -91,7 +91,6 @@ def handle_error(error):
if response:
transaction.ErrorDialog.hide()
transaction.get_handle()
transaction.update_dbs()
def handle_reply(reply):
while Gtk.events_pending():
@ -107,14 +106,12 @@ def handle_reply(reply):
end_iter = transaction.progress_buffer.get_end_iter()
transaction.progress_buffer.insert(end_iter, str(reply))
transaction.get_handle()
transaction.update_dbs()
else:
#~ transaction.ProgressWindow.hide()
#~ while Gtk.events_pending():
#~ Gtk.main_iteration()
UpdaterWindow.get_window().set_cursor(None)
transaction.get_handle()
transaction.update_dbs()
transaction.get_updates()
def handle_updates(updates):

View File

@ -211,5 +211,3 @@ if 'HoldPkg' in pacman_conf.options:
holdpkg = pacman_conf.options['HoldPkg']
if 'SyncFirst' in pacman_conf.options:
syncfirst = pacman_conf.options['SyncFirst']
#if not 'pamac' in syncfirst:
# syncfirst.append('pamac')

View File

@ -214,17 +214,13 @@ def on_progress_textview_size_allocate(*arg):
adj.set_value(adj.get_upper() - adj.get_page_size())
def get_handle():
global handle
handle = config.handle()
print('get handle')
def update_dbs():
global handle
global syncdbs
global localdb
handle = config.handle()
syncdbs = handle.get_syncdbs()
localdb = handle.get_localdb()
print('get handle')
def get_localpkg(name):
return localdb.get_pkg(name)
@ -459,7 +455,11 @@ def prepare(**trans_flags):
def check_finished_build(data):
def handle_timeout(*args):
raise Exception('timeout')
def no_handle_timeout(*args):
try:
pass
except:
pass
global to_build
global build_proc
path = data[0]
@ -474,14 +474,14 @@ def check_finished_build(data):
line = build_proc.stdout.readline().decode(encoding='UTF-8')
#print(line.rstrip('\n'))
progress_buffer.insert_at_cursor(line)
except Exception:
pass
else:
signal.signal(signal.SIGALRM, no_handle_timeout)
finally:
progress_bar.pulse()
while Gtk.events_pending():
Gtk.main_iteration()
except Exception:
while Gtk.events_pending():
Gtk.main_iteration()
finally:
signal.alarm(0)
return True
elif build_proc.poll() == 0:
# Build successfully finished