summaryrefslogtreecommitdiff
path: root/grc/blocks/epy_module.xml
blob: fa3e5f91f4a0b6c62164de52874d45ca2076c183 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?xml version="1.0"?>
<block>
	<name>Python Module</name>
	<key>epy_module</key>
	<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>