Most references to g.unitTesting merely set a 'trace' var. The following
script finds all other uses. In fact, however, most references to
g.unitTesting suppress messages and dialogs during unit tests. Still it's
an interesting script that can't be done with a regex because negative
look-behind assertions must have fixed length:
def predicate(p):
return any([
s.find('g.unitTesting') > -1 and s.find('trace') == -1
for s in g.splitLines(p.b)
])
p = c.cloneFindByPredicate(
generator = c.all_unique_positions,
predicate = predicate,
flatten = True,
)
p.h = 'clone-find-predicate: real use of g.unitTesting'
p.b = '%s nodes' % p.numberOfChildren()
Edward
--
You received this message because you are subscribed to the Google Groups
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.