diff options
| author | Gubolin <gubolin@fantasymail.de> | 2015-02-21 15:35:31 +0100 |
|---|---|---|
| committer | Gubolin <gubolin@fantasymail.de> | 2015-02-21 15:35:31 +0100 |
| commit | fd4b0b4b8ad927362f8ac37e2437ac412686fce2 (patch) | |
| tree | 27da329eec16b1878c41d783ff3c382cb1bf7d52 | |
| parent | 37f5d8e57f5ffe7825e9a2f48473fda677b6a13f (diff) | |
| download | blockext-master.tar.gz blockext-master.zip | |
| -rw-r--r-- | blockext/generate.py | 5 | ||||
| -rw-r--r-- | example.py | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/blockext/generate.py b/blockext/generate.py index 207163b..c384fa8 100644 --- a/blockext/generate.py +++ b/blockext/generate.py @@ -113,6 +113,7 @@ def generate_snap(descriptor, language): inputs = SubElement(defn, "inputs") snap_spec = "" + inputCounter = 0 for part in block.parts: if isinstance(part, Input): input_el = SubElement(inputs, "input", { @@ -126,8 +127,8 @@ def generate_snap(descriptor, language): # TODO menus # XXX ^ why is there a todo comment here? - index = block.inputs.index(part) - part = "%'arg-{}'".format(index) + part = "%'arg-{}'".format(inputCounter) + inputCounter += 1 else: assert isinstance(part, str) # Snap! doesn't allow %-signs in block text yet. @@ -32,6 +32,11 @@ class Example: print(text) time.sleep(duration) + @command("multiple %s inputs are %s allowed") + def argstest(self, arg1, arg2): + print(arg1) + print(arg2) + @command("play note %n") def play_note(self, note): print("DING {note}".format(note=note)) |
