Mercurial > hg > lib > markup
diff python/util.py @ 11:e411408d64ec
from python repo
author | Henry S. Thompson <ht@inf.ed.ac.uk> |
---|---|
date | Sat, 11 Dec 2021 16:13:04 -0500 |
parents | 56508a6033a9 |
children |
line wrap: on
line diff
--- a/python/util.py Thu May 27 06:09:01 2021 -0400 +++ b/python/util.py Sat Dec 11 16:13:04 2021 -0500 @@ -4,6 +4,10 @@ IPAT=re.compile('-?[0-9][0-9]*$') PPAT=re.compile('[ ,;\[\]]') +Red='[31m' +eRed='[39m' +RedFmt=Red+'%s'+eRed + def intsMaybe(ii): return (int(i) for i in ii if IPAT.match(i)) @@ -13,7 +17,12 @@ (host.nr,host.ox,host.oy,host.oz)=intsMaybe(ff) host.et=ff[9] l=infile.readline().rstrip() - (host.orad,host.ymin,host.ymax)=intsMaybe(PPAT.split(l)) + l2=PPAT.split(l) + if l2[-1]=='bounded': + host.orad=int(l2[1]) + host.ymin=host.ymax=-1 + else: + (host.orad,host.ymin,host.ymax)=intsMaybe(PPAT.split(l)) if skipColHdrs: _=infile.readline()