| |
---|
| | |
---|
| | # Program Information |
---|
| | |
---|
| | PROGNAME = "tren.py" |
---|
| | RCSID = "$Id: tren.py,v 1.105 2010/01/23 00:38:55 tundra Exp $" |
---|
| | RCSID = "$Id: tren.py,v 1.106 2010/01/23 01:00:00 tundra Exp $" |
---|
| | VERSION = RCSID.split()[2] |
---|
| | |
---|
| | # Copyright Information |
---|
| | |
---|
| |
---|
| | # Literals |
---|
| | ##### |
---|
| | |
---|
| | ALL = "All" # Rename target is whole filename |
---|
| | COMMENT = "#" # Comment character in include files |
---|
| | EXT = "Ext" # Rename target is extension |
---|
| | EXTDELIM = "." # Extension delimeter |
---|
| | INCL = "-I" # Include file command line option |
---|
| | NAM = "Nam" # Rename target is name |
---|
| |
---|
| | if NUMINCLUDES >= MAXINCLUDES: |
---|
| | ErrorMsg(eTOOMANYINC) |
---|
| | sys.exit(1) |
---|
| | |
---|
| | # Replace insert option on the command line with that file's contents |
---|
| | # Replace insert option on the command line with that file's contents. |
---|
| | # Handle comments within lines. |
---|
| | |
---|
| | try: |
---|
| | n = [] |
---|
| | f = open(file) |
---|
| | for l in f.readlines(): |
---|
| | l = l.split(COMMENT)[0] |
---|
| | n += l.split() |
---|
| | f.close() |
---|
| | |
---|
| | OPTIONS = lhs + n + rhs |
---|
| |
---|
| | |