projects
/
doneit
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7b40467
)
Making the locking code a little cleaner
author
Ed Page
<epage@Dulcinea.(none)>
Tue, 14 Apr 2009 02:12:37 +0000
(21:12 -0500)
committer
Ed Page
<epage@Dulcinea.(none)>
Tue, 14 Apr 2009 02:12:37 +0000
(21:12 -0500)
src/gtk_toolbox.py
patch
|
blob
|
history
diff --git
a/src/gtk_toolbox.py
b/src/gtk_toolbox.py
index
52d29c9
..
0780ad1
100644
(file)
--- a/
src/gtk_toolbox.py
+++ b/
src/gtk_toolbox.py
@@
-1,11
+1,21
@@
#!/usr/bin/python
import warnings
+import contextlib
import gobject
import gtk
+@contextlib.contextmanager
+def gtk_lock():
+ gtk.gdk.threads_enter()
+ try:
+ yield
+ finally:
+ gtk.gdk.threads_leave()
+
+
class LoginWindow(object):
def __init__(self, widgetTree):