You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
660 B
Python
23 lines
660 B
Python
from io import BytesIO
|
|
import fatamorgana
|
|
failed = []
|
|
for i in range(1, 16):
|
|
for j in range(1, 20):
|
|
print(i, j)
|
|
try:
|
|
with open(f'/home/jan/software/layout/klayout-source/testdata/oasis/t{i}.{j}.oas', 'rb') as f:
|
|
a = f.read()
|
|
b = fatamorgana.OasisLayout.read(BytesIO(a[:-253]))
|
|
except FileNotFoundError:
|
|
print('failed to open', i,'.',j)
|
|
break
|
|
except Exception as e:
|
|
failed.append((i, j, e))
|
|
|
|
if (i, j) == (9, 2):
|
|
continue
|
|
|
|
with open(f'/tmp/t{i}.{j}.oas', 'wb') as f:
|
|
b.write(f)
|
|
[print(f) for f in failed]
|