[Reportbug-commits] [reportbug] 17/31: gtk2_ui: Simplify run_once_in_main_thread by inlining create_idle_callback

Sandro Tosi morph at moszumanska.debian.org
Mon Jan 16 01:36:57 UTC 2017


This is an automated email from the git hooks/post-receive script.

morph pushed a commit to branch master
in repository reportbug.

commit 8809d6a0600f95417fad23792c168d86f35e2292
Author: Simon McVittie <smcv at debian.org>
Date:   Sat Jan 14 19:22:19 2017 +0000

    gtk2_ui: Simplify run_once_in_main_thread by inlining create_idle_callback
---
 reportbug/ui/gtk2_ui.py | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/reportbug/ui/gtk2_ui.py b/reportbug/ui/gtk2_ui.py
index 87a8d79..d4a84ba 100644
--- a/reportbug/ui/gtk2_ui.py
+++ b/reportbug/ui/gtk2_ui.py
@@ -507,15 +507,12 @@ class ReportbugApplication(threading.Thread):
     def set_next_value(self, value):
         self.next_value = value
 
-    @staticmethod
-    def create_idle_callback(func, *args, **kwargs):
+    def run_once_in_main_thread(self, func, *args, **kwargs):
         def callback():
             func(*args, **kwargs)
             return False
-        return callback
 
-    def run_once_in_main_thread(self, func, *args, **kwargs):
-        GLib.idle_add(self.create_idle_callback(func, *args, **kwargs))
+        GLib.idle_add(callback)
 
 
 # Connection with reportbug

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reportbug/reportbug.git



More information about the Reportbug-commits mailing list