summaryrefslogtreecommitdiff
path: root/grc/blocks/epy_module.xml
diff options
context:
space:
mode:
authorSebastian Koslowski <koslowski@kit.edu>2015-12-02 17:45:06 +0100
committerSebastian Koslowski <koslowski@kit.edu>2015-12-04 21:08:38 +0100
commit635bb2d62420001e4a0c34b3898aa259775e43b8 (patch)
tree87a3d3322f60bd7ca3a76e8900b19c02b2c2b119 /grc/blocks/epy_module.xml
parentdf4f5820cea5c8786f118bf94adb950afe6b2aab (diff)
grc: add embedded python modules
Diffstat (limited to 'grc/blocks/epy_module.xml')
-rw-r--r--grc/blocks/epy_module.xml33
1 files changed, 33 insertions, 0 deletions
diff --git a/grc/blocks/epy_module.xml b/grc/blocks/epy_module.xml
new file mode 100644
index 0000000000..6d6d71804c
--- /dev/null
+++ b/grc/blocks/epy_module.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0"?>
+<block>
+ <name>Python Module</name>
+ <key>epy_module</key>
+ <category>Misc</category>
+ <import>import $id # embedded python module</import>
+ <make></make>
+ <param>
+ <name>Code</name>
+ <key>source_code</key>
+ <value># this module will be imported in the into your flowgraph</value>
+ <type>_multiline_python_external</type>
+ <hide>part</hide>
+ </param>
+ <doc>This block lets you embed a python module in your flowgraph.
+
+Code you put in this module is accessible in other blocks using the ID of this
+block. Example:
+
+If you put
+
+ a = 2
+
+ def double(arg):
+ return 2 * arg
+
+in a Python Module Block with the ID 'stuff' you can use code like
+
+ stuff.a # evals to 2
+ stuff.double(3) # evals to 6
+
+to set parameters of other blocks in your flowgraph.</doc>
+</block>