comparison treepkg/cmdexpand.py @ 567:9d44d4da3411

commands from config files may contain arguments therefore commandparse must split also kw args
author Bjoern Ricks <bricks@intevation.de>
date Fri, 02 Sep 2011 11:04:07 +0000
parents 83e1aa122ad0
children 49e63875e041
comparison
equal deleted inserted replaced
566:1b3b08bbe27a 567:9d44d4da3411
104 raise ValueError("%r contains an unquoted '@'" % word) 104 raise ValueError("%r contains an unquoted '@'" % word)
105 match = rx_list_expansion.match(word) 105 match = rx_list_expansion.match(word)
106 if match: 106 if match:
107 key = match.group("named") 107 key = match.group("named")
108 if key: 108 if key:
109 words[index:index + 1] = (str(item) for item in kw[key]) 109 words[index:index + 1] = (str(item).spit(" ") for item in kw[key])
110 else: 110 else:
111 assert match.group("invalid") != None 111 assert match.group("invalid") != None
112 raise ValueError("In %r the characters after the '@'" 112 raise ValueError("In %r the characters after the '@'"
113 " do not match a python identifier" % word) 113 " do not match a python identifier" % word)
114 else: 114 else:
115 words[index] = expandword(word, kw) 115 words[index:index +1] = expandword(word, kw).split(" ")
116 return words 116 return words
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)