Fixed up in-hands and flags and shit jesus fucking BYOND christ

This commit is contained in:
ZomgPonies
2014-05-24 10:40:38 -04:00
parent 19d906e6bb
commit 162b936bd3
63 changed files with 7342 additions and 62 deletions
@@ -0,0 +1,28 @@
#!/usr/bin/env python
'''
Created on Apr 29, 2014
@author: Rob
'''
import argparse,os
from byond.objtree import ObjectTree
from byond.basetypes import Proc
def dumpSubTypes(atom):
print('{}:{}: {}'.format(atom.filename,atom.line,atom.path))
for rpath,catom in atom.children.items():
if not isinstance(catom,Proc):
dumpSubTypes(catom)
if __name__ == '__main__':
opt = argparse.ArgumentParser()
opt.add_argument('project', metavar="project.dme")
opt.add_argument('--subtypes',type=str,help="List all subtypes of the given type")
args = opt.parse_args()
if os.path.isfile(args.project):
tree = ObjectTree()
tree.ProcessFilesFromDME(args.project)
if args.subtypes:
atom = tree.GetAtom(args.subtypes)
dumpSubTypes(atom)