mirror of
https://gitea.osmocom.org/sim-card/pysim.git
synced 2026-03-18 19:38:34 +03:00
HACK: support for SIM factory file formats
Change-Id: I23cd37fc06b6e2d21964fd4f2694d9ee3c6012d4
This commit is contained in:
13
script_format.py
Normal file
13
script_format.py
Normal file
@@ -0,0 +1,13 @@
|
||||
|
||||
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)
|
||||
Reference in New Issue
Block a user