per iteration tempfiles
This commit is contained in:
parent
0bb4f7967b
commit
15d34122b3
11
uxnrepl
11
uxnrepl
|
@ -39,17 +39,16 @@ template = '''
|
||||||
@wst "wst 20 00
|
@wst "wst 20 00
|
||||||
'''
|
'''
|
||||||
|
|
||||||
_, tmp_tal = mkstemp(suffix='.tal', prefix='uxnrepl')
|
def write_rom(path, s):
|
||||||
_, tmp_rom = mkstemp(suffix='.rom', prefix='uxnrepl')
|
f = open(path, 'w')
|
||||||
|
|
||||||
def write_rom(s):
|
|
||||||
f = open(tmp_tal, 'w')
|
|
||||||
prog = template % s
|
prog = template % s
|
||||||
f.write(prog)
|
f.write(prog)
|
||||||
f.close()
|
f.close()
|
||||||
|
|
||||||
def run(s):
|
def run(s):
|
||||||
write_rom(s)
|
_, tmp_tal = mkstemp(suffix='.tal', prefix='uxnrepl')
|
||||||
|
_, tmp_rom = mkstemp(suffix='.rom', prefix='uxnrepl')
|
||||||
|
write_rom(tmp_tal, s)
|
||||||
res = system('uxnasm %s %s 2>/dev/null' % (tmp_tal, tmp_rom))
|
res = system('uxnasm %s %s 2>/dev/null' % (tmp_tal, tmp_rom))
|
||||||
if res != 0:
|
if res != 0:
|
||||||
system('uxnasm %s %s' % (tmp_tal, tmp_rom))
|
system('uxnasm %s %s' % (tmp_tal, tmp_rom))
|
||||||
|
|
Loading…
Reference in New Issue