mirror of
https://expo.survex.com/repositories/expoweb/.git/
synced 2025-12-08 23:04:35 +00:00
Move old scripts and delete stuff now in troggle itself
This commit is contained in:
29
scripts/svxtrace.py
Normal file
29
scripts/svxtrace.py
Normal file
@@ -0,0 +1,29 @@
|
||||
#!/usr/bin/python
|
||||
import sys, os.path, re
|
||||
|
||||
reg = re.compile(r'^\*include ([^;\s]*?)\s*$', re.MULTILINE)
|
||||
|
||||
|
||||
|
||||
def printdeps(filename):
|
||||
"""Expects a filename relative to script's working directory."""
|
||||
if(filename[-4:]!='.svx'): filename += ".svx"
|
||||
print filename
|
||||
t = file(filename).read()
|
||||
for m in re.findall(reg, t):
|
||||
newfname = m
|
||||
if(newfname[-4:]!='.svx'): newfname += '.svx'
|
||||
newfname = os.path.normpath(os.path.dirname(filename) + '/' + newfname)
|
||||
if(os.path.exists(newfname)):
|
||||
printdeps(newfname)
|
||||
else: # imitate cavern case-sensitivity workaround
|
||||
newfname = m.lower()
|
||||
newfname = os.path.normpath(os.path.dirname(filename) + '/' + newfname)
|
||||
printdeps(newfname)
|
||||
|
||||
|
||||
if(len(sys.argv) != 2):
|
||||
print >>sys.stderr, "Usage: %s SVXFILE" % sys.argv[0]
|
||||
sys.exit(1)
|
||||
|
||||
printdeps(sys.argv[1])
|
||||
Reference in New Issue
Block a user