Commit MetaInfo

Revisão96df2bd049ee1e266d7726a95c63f9797cdb712c (tree)
Hora2012-08-06 14:10:14
Autorbijoux
Commiterbijoux

Mensagem de Log

Fixed missing [] in parsing plot arguments

Mudança Sumário

Diff

diff -r 7ee060b18d79 -r 96df2bd049ee src/pylafii/mplext.py
--- a/src/pylafii/mplext.py Sun Jul 29 08:17:52 2012 +0900
+++ b/src/pylafii/mplext.py Mon Aug 06 14:10:14 2012 +0900
@@ -488,7 +488,25 @@
488488 def eval_format(self,format):
489489 variable = re.compile('\$[a-zA-Z0-9_\-]+')
490490 rst = []
491+ # extract expressions
492+ exprs = []
493+ square_bracket = False
494+ buffer = ''
491495 for expr in format.split(','):
496+ # for array index[i,j,k]
497+ if square_bracket:
498+ buffer = buffer + ',' + expr
499+ if not expr.find(']') == -1:
500+ exprs.append(buffer)
501+ buffer = ''
502+ square_bracket = False
503+ continue
504+ if not expr.find('[') == -1:
505+ buffer = buffer + expr
506+ square_bracket = True
507+ continue
508+ exprs.append(expr)
509+ for expr in exprs:
492510 if expr.find('"') == -1 and expr.find('\'') == -1:
493511 args = ''
494512 for arg in variable.findall(expr):
Show on old repository browser