diff --git a/pamac-daemon.py b/pamac-daemon.py index df5dc80..9b94a61 100755 --- a/pamac-daemon.py +++ b/pamac-daemon.py @@ -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 diff --git a/pamac-install.py b/pamac-install.py index 405b18e..65d0b46 100755 --- a/pamac-install.py +++ b/pamac-install.py @@ -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() diff --git a/pamac-manager.py b/pamac-manager.py index bcccd52..924c040 100755 --- a/pamac-manager.py +++ b/pamac-manager.py @@ -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)) diff --git a/pamac-updater.py b/pamac-updater.py index e4fcbad..82fe05b 100644 --- a/pamac-updater.py +++ b/pamac-updater.py @@ -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): diff --git a/pamac/config.py b/pamac/config.py index 0cd59a8..5393c7a 100644 --- a/pamac/config.py +++ b/pamac/config.py @@ -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') diff --git a/pamac/transaction.py b/pamac/transaction.py index eda652a..41d0f1b 100644 --- a/pamac/transaction.py +++ b/pamac/transaction.py @@ -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