diff --git a/tren.py b/tren.py index 076792b..498759d 100755 --- a/tren.py +++ b/tren.py @@ -6,7 +6,7 @@ # 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 @@ -59,6 +59,7 @@ ##### 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 @@ -306,12 +307,14 @@ 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()