summaryrefslogtreecommitdiff
path: root/grc/python
diff options
context:
space:
mode:
authorJohnathan Corgan <johnathan@corganlabs.com>2015-01-13 13:35:55 -0800
committerJohnathan Corgan <johnathan@corganlabs.com>2015-01-13 13:35:55 -0800
commitff622ae57194d3fd889f5b772e7285eeb8606443 (patch)
treee654713799e7cc38996d215f468b9b6781396d9b /grc/python
parentf1e7ee479be0de6afb6877840e70a0dc7f38334f (diff)
parentb5299f0117671ea145203a49a5afcbdd3926897c (diff)
Merge remote-tracking branch 'smunaut/grc-xinitthreads-fix'
Diffstat (limited to 'grc/python')
-rw-r--r--grc/python/flow_graph.tmpl23
1 files changed, 13 insertions, 10 deletions
diff --git a/grc/python/flow_graph.tmpl b/grc/python/flow_graph.tmpl
index 2526f087eb..2a6ce7233a 100644
--- a/grc/python/flow_graph.tmpl
+++ b/grc/python/flow_graph.tmpl
@@ -30,6 +30,19 @@ $DIVIDER
# Generated: $time.ctime()
$DIVIDER
+# Call XInitThreads as the _very_ first thing.
+# After some Qt import, it's too late
+#if $generate_options in ('wx_gui', 'qt_gui')
+import ctypes
+import sys
+if sys.platform.startswith('linux'):
+ try:
+ x11 = ctypes.cdll.LoadLibrary('libX11.so')
+ x11.XInitThreads()
+ except:
+ print "Warning: failed to XInitThreads()"
+#end if
+
########################################################
##Create Imports
########################################################
@@ -267,16 +280,6 @@ $short_id#slurp
#end def
#if $generate_options != 'hb'
if __name__ == '__main__':
- #if $generate_options in ('wx_gui', 'qt_gui')
- import ctypes
- import sys
- if sys.platform.startswith('linux'):
- try:
- x11 = ctypes.cdll.LoadLibrary('libX11.so')
- x11.XInitThreads()
- except:
- print "Warning: failed to XInitThreads()"
- #end if
parser = OptionParser(option_class=eng_option, usage="%prog: [options]")
#set $params_eq_list = list()
#for $param in $parameters