mirror of
https://gitea.osmocom.org/sim-card/pysim.git
synced 2026-03-16 18:38:32 +03:00
14 lines
413 B
Python
14 lines
413 B
Python
|
|
class ScriptFormat():
|
|
|
|
def parse_process(self, text, stmt_cb, stmt_cb_kwargs={}):
|
|
p = self.parse_xform(text)
|
|
#print(p.pretty())
|
|
for stmt in p.children:
|
|
stmt_cb(stmt, **stmt_cb_kwargs)
|
|
|
|
def parse_process_file(self, fname, stmt_cb, stmt_cb_kwargs={}):
|
|
f = open(fname, "r")
|
|
text = f.read()
|
|
return self.parse_process(text, stmt_cb, stmt_cb_kwargs)
|