• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

generic text markup tools


Commit MetaInfo

Revisão12787b7a4fbdeb056e8f815b1edc8bda2cee65ed (tree)
Hora2014-02-06 19:55:41
Autorhylom <hylom@hylo...>
Commiterhylom

Mensagem de Log

fix _expand_variable()

Mudança Sumário

Diff

--- a/textparser.py
+++ b/textparser.py
@@ -266,15 +266,12 @@ class Parser(object):
266266 text = rex.sub(match_func, text)
267267
268268 # expand vars
269- rex = re.compile('\${?([A-Za-z0-9_]+)}?')
269+ rex = re.compile('(\${?[A-Za-z0-9_]+}?)')
270270 m = rex.search(text)
271271 if m:
272272 def sub_func(x):
273- val = self.store.load(x.group(1))
274- if val != None:
275- return val
276- else:
277- return "$" + x.group(1)
273+ key = re.sub(u"[${}]", "", x.group(1))
274+ return self.store.load(key, x.group(1))
278275 text = rex.sub(sub_func, text)
279276 return text
280277