Skip to content

Commit 65a71a5

Browse files
committed
Add Parallel.append()
1 parent 1a6fa2f commit 65a71a5

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

Test/test_commands.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,11 @@ def testParallel(self):
119119
print cmd
120120
self.assertEqual(ET.tostring(cmd.genXML()), "<parallel><body><comment><text>One</text></comment><comment><text>Two</text></comment></body><error_handler>MyHandler</error_handler></parallel>")
121121

122+
cmd = Parallel()
123+
cmd.append(Comment("One"), Comment("Two"))
124+
print cmd
125+
self.assertEqual(ET.tostring(cmd.genXML()), "<parallel><body><comment><text>One</text></comment><comment><text>Two</text></comment></body></parallel>")
126+
122127
def testLog(self):
123128
# One device
124129
cmd = Log("pv1")

scan/commands/parallel.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ def __init__(self, body=None, *args, **kwargs):
5353

5454
def getBody(self):
5555
return self.__body
56+
57+
def append(self, *commands):
58+
for cmd in commands:
59+
self.__body.append(cmd)
5660

5761
def genXML(self):
5862
xml = ET.Element('parallel')

scan/version.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11

2-
__version__ = '1.3.11'
2+
__version__ = '1.3.12'
33

44
version_history = """
5+
1.3.12 - Add Parallel.append(..) method
56
1.3.11 - Fix list-of-lists check
67
1.3.10 - Table: Check 'rows' for list-of-lists
78
1.3.9 - Seconds parser: Allow float "6.0" or "6.5"

0 commit comments

Comments
 (0)