Added 'geo_list.py' a tool for listing models in a .geo .
parent
b0b09d897e
commit
f59690ea32
@ -0,0 +1,28 @@
|
||||
#! /usr/bin/python3
|
||||
|
||||
import sys
|
||||
import re
|
||||
from geo import Geo
|
||||
|
||||
def listGeo(fn, fh):
|
||||
geo = Geo()
|
||||
geo.loadFromFile(fh)
|
||||
for m in geo.models:
|
||||
print("%s : %s" % (geo.header_modelheader_name.decode("utf-8"), m.name.decode("utf-8")))
|
||||
|
||||
|
||||
|
||||
if len(sys.argv) <= 1:
|
||||
print("Usage:")
|
||||
print(" %s <infile.geo>" % (sys.argv[0], ))
|
||||
exit()
|
||||
|
||||
|
||||
for i in range(1, len(sys.argv)):
|
||||
try:
|
||||
fn = sys.argv[i]
|
||||
fh = open(fn, "rb")
|
||||
except:
|
||||
print("Couldn't open '%s'." % (sys.argv[i], ))
|
||||
continue
|
||||
listGeo(fn, fh)
|
Loading…
Reference in New Issue