Definition at line 144 of file RemoveMathFromGDML.py.
def RemoveMathFromGDML.GDMLpurifier.__init__ |
( |
|
self, |
|
|
|
args, |
|
|
|
kargs |
|
) |
| |
Definition at line 145 of file RemoveMathFromGDML.py.
146 GDMLexpressionRemover.__init__(self, *args, **kargs)
def __init__(self, args, kargs)
def RemoveMathFromGDML.GDMLpurifier.apply |
( |
|
self, |
|
|
|
token, |
|
|
|
iLine = None |
|
) |
| |
Purifies the token
Definition at line 192 of file RemoveMathFromGDML.py.
192 def apply(self, token, iLine = None):
193 """Purifies the token""" 196 element = prefix
if prefix
is not None else "" 200 if iLine
is not None:
202 "Evaluated '%s' into '%s' on line %d",
203 s, purified, iLine + 1
205 if self.options.WarnZero
and (
float(purified) == 0.):
206 logging.warn(
"On line %d: expression '%s' evaluated to 0",
209 logging.debug(
"Evaluated '%s' into '%s'", s, purified)
210 if self.options.WarnZero
and (
float(purified) == 0.):
211 logging.warn(
"Expression '%s' evaluated to 0", s)
213 element +=
'"' +
str(purified) +
'"' 215 elements.append(element)
217 return "".join(elements)
def apply(self, token, iLine=None)
def RemoveMathFromGDML.GDMLpurifier.findStrings |
( |
|
token | ) |
|
|
static |
Returns a list of pairs: (prefix, double quoted string)
One of them may be None if no such element is present
Definition at line 149 of file RemoveMathFromGDML.py.
150 """Returns a list of pairs: (prefix, double quoted string) 152 One of them may be None if no such element is present 172 tokens.append((prefix, word))
184 if mode ==
'p': prefix += c
185 elif mode ==
'w': word += c
187 if prefix
or (word
is not None):
188 tokens.append((prefix, word))
The documentation for this class was generated from the following file: