- Timestamp:
- 10/08/06 11:32:09 (15 years ago)
- Location:
- TI02-CSML/trunk/Scanner
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TI02-CSML/trunk/Scanner/csmlscan.py
r1156 r1376 11 11 12 12 import sys, string 13 import xml.dom.ext13 import ConfigParser 14 14 import getopt 15 15 import os … … 91 91 92 92 """ 93 94 95 93 def main(optargs=None): 94 config = ConfigParser.ConfigParser() 95 #Get command line arguments 96 if optargs: 97 #if called as main(args) from another python module use these args, else use 98 #sys.argv if called from command line. 99 sys.argv =optargs 100 try: 101 opts, args = getopt.getopt(sys.argv[1:], "c:d:f:t:m:rpo:h", ["configfile=,directory=", "csmlfeaturetype=", "timedimension=", "filemapping=", "recursive", "printscreen", "outputfile=", "help"]) 102 except getopt.error, msg: 103 print "Invalid options, use --help for help" 104 sys.exit() 105 print 'hello' 106 for o, v in opts: 107 if o in ("-c", "--configfile"): 108 configfile = v 109 hasConfig=True 110 print 'true' 111 112 113 if hasConfig == True: 114 config.read(configfile) 115 # dump entire config file 116 if config.sections()==[]: 117 print 'Either the config file is invalid or could not be found' 118 sys.exit() 119 for section in config.sections(): 120 print section 121 for option in config.options(section): 122 print " ", option, "=", config.get(section, option) 123 124 def mainOLD(optargs=None): 96 125 #Main program: 97 126 #***************
Note: See TracChangeset
for help on using the changeset viewer.