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.previous_percent = 0
self.total_size = 0 self.total_size = 0
self.already_transferred = 0 self.already_transferred = 0
self.handle = config.handle()
self.local_packages = set() self.local_packages = set()
self.localdb = None self.localdb = None
self.syncdbs = None self.syncdbs = None

View File

@ -154,7 +154,6 @@ if common.pid_file_exists():
else: else:
transaction_done = False transaction_done = False
transaction.get_handle() transaction.get_handle()
transaction.update_dbs()
transaction.get_dbus_methods() transaction.get_dbus_methods()
config_dbus_signals() config_dbus_signals()
transaction.get_updates() 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.progress_buffer.delete(transaction.progress_buffer.get_start_iter(),transaction.progress_buffer.get_end_iter())
transaction.Release() transaction.Release()
transaction.get_handle() transaction.get_handle()
transaction.update_dbs()
transaction.mark_needed_pkgs_as_dep() transaction.mark_needed_pkgs_as_dep()
transaction.to_add.clear() transaction.to_add.clear()
transaction.to_remove.clear() transaction.to_remove.clear()
@ -447,7 +446,6 @@ def handle_reply(reply):
transaction.get_updates() transaction.get_updates()
transaction.Release() transaction.Release()
transaction.get_handle() transaction.get_handle()
transaction.update_dbs()
transaction.mark_needed_pkgs_as_dep() transaction.mark_needed_pkgs_as_dep()
transaction.to_add.clear() transaction.to_add.clear()
transaction.to_remove.clear() transaction.to_remove.clear()
@ -909,7 +907,6 @@ else:
repo_column.set_cell_data_func(repo_renderertext, repo_column_display_func) repo_column.set_cell_data_func(repo_renderertext, repo_column_display_func)
size_column.set_cell_data_func(size_renderertext, size_column_display_func) size_column.set_cell_data_func(size_renderertext, size_column_display_func)
transaction.get_handle() transaction.get_handle()
transaction.update_dbs()
update_lists() update_lists()
ManagerWindow.show_all() ManagerWindow.show_all()
ManagerWindow.get_window().set_cursor(Gdk.Cursor(Gdk.CursorType.WATCH)) ManagerWindow.get_window().set_cursor(Gdk.Cursor(Gdk.CursorType.WATCH))

View File

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

View File

@ -211,5 +211,3 @@ if 'HoldPkg' in pacman_conf.options:
holdpkg = pacman_conf.options['HoldPkg'] holdpkg = pacman_conf.options['HoldPkg']
if 'SyncFirst' in pacman_conf.options: if 'SyncFirst' in pacman_conf.options:
syncfirst = pacman_conf.options['SyncFirst'] 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()) adj.set_value(adj.get_upper() - adj.get_page_size())
def get_handle(): def get_handle():
global handle
handle = config.handle()
print('get handle')
def update_dbs():
global handle global handle
global syncdbs global syncdbs
global localdb global localdb
handle = config.handle() handle = config.handle()
syncdbs = handle.get_syncdbs() syncdbs = handle.get_syncdbs()
localdb = handle.get_localdb() localdb = handle.get_localdb()
print('get handle')
def get_localpkg(name): def get_localpkg(name):
return localdb.get_pkg(name) return localdb.get_pkg(name)
@ -459,7 +455,11 @@ def prepare(**trans_flags):
def check_finished_build(data): def check_finished_build(data):
def handle_timeout(*args): def handle_timeout(*args):
raise Exception('timeout') raise Exception('timeout')
def no_handle_timeout(*args):
try:
pass
except:
pass
global to_build global to_build
global build_proc global build_proc
path = data[0] path = data[0]
@ -474,14 +474,14 @@ def check_finished_build(data):
line = build_proc.stdout.readline().decode(encoding='UTF-8') line = build_proc.stdout.readline().decode(encoding='UTF-8')
#print(line.rstrip('\n')) #print(line.rstrip('\n'))
progress_buffer.insert_at_cursor(line) progress_buffer.insert_at_cursor(line)
except Exception:
pass
else:
signal.signal(signal.SIGALRM, no_handle_timeout)
finally:
progress_bar.pulse() progress_bar.pulse()
while Gtk.events_pending(): while Gtk.events_pending():
Gtk.main_iteration() Gtk.main_iteration()
except Exception:
while Gtk.events_pending():
Gtk.main_iteration()
finally:
signal.alarm(0)
return True return True
elif build_proc.poll() == 0: elif build_proc.poll() == 0:
# Build successfully finished # Build successfully finished