Changeset 1083


Ignore:
Timestamp:
02/06/06 12:47:10 (13 years ago)
Author:
domlowe
Message:

Added optional -p printscreen arg

Location:
TI02-CSML/trunk/Scanner
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • TI02-CSML/trunk/Scanner/csmllibs/csmlbuilder.py

    r855 r1083  
    77 
    88 
    9  
     9import sys 
    1010 
    1111 
     
    1616    #this class contains all the method calls to create and populate a csmldoc 
    1717    #it needs to be provided with several bits of information to be able to do this. 
    18     def __init__(self,directory,csmlft, mapping, timedimension ,outputfile): 
     18    def __init__(self,directory,csmlft, mapping, timedimension ,outputfile,printscreen): 
    1919        self.directory = directory # top level directory containing data files  
    2020        self.csmlfeaturetype  = csmlft  
     
    2222        self.timedimension=timedimension 
    2323        self.outputfile=outputfile 
     24        self.printscreen=printscreen 
    2425        self.csml = None  # csml object holds the csml document in memory. 
    2526        self.ds_element = None #<Dataset> tag, root node. 
     
    139140 
    140141    def printToScreen(self): 
    141         print "Print to Screen" 
    142         print self.strCSML 
     142        if self.printscreen==1: 
     143            print "Print to Screen" 
     144            print self.strCSML 
    143145 
  • TI02-CSML/trunk/Scanner/csmllibs/csmlfeaturetypes.py

    r1082 r1083  
    7676                 
    7777                GridSeriesFeature_element=csmllibs.Parser.GridSeriesFeature() 
    78                 GridSeriesFeature_element.id=str(fileid)+'__'+str(allVarNames[i]) 
     78                #GridSeriesFeature_element.id=str(fileid)+'__'+str(allVarNames[i]) 
    7979                GridSeriesFeature_element.id=str(allVarNames[i]) 
    8080                #description: need to get the attribute called long_name (?? TODO - is this CF compliant??) 
  • TI02-CSML/trunk/Scanner/csmlscan.py

    r919 r1083  
    102102        sys.argv =optargs 
    103103    try: 
    104             opts, args = getopt.getopt(sys.argv[1:], "d:c:t:fro:h", ["directory=", "csmlfeaturetype=", "timedimension=", "filemapping=", "recursive", "outputfile=", "help"]) 
     104            opts, args = getopt.getopt(sys.argv[1:], "d:c:t:frpo:h", ["directory=", "csmlfeaturetype=", "timedimension=", "filemapping=", "recursive", "printscreen", "outputfile=", "help"]) 
    105105    except getopt.error, msg: 
    106106            print "Invalid options, use --help for help" 
     
    113113    mapping = None 
    114114    recursive = 0 
     115    printscreen=0 
     116    print printscreen 
    115117    individual = False 
    116118    outputfile = 'csmloutput.xml' 
     
    127129                    elif v == '1n': 
    128130                        mapping = 'onetomany' 
     131            elif o in ("-p", "--printscreen"): 
     132                    printscreen = 1 
    129133            elif o in ("-o", "--outputfile"): 
    130134                    outputfile = v 
     
    132136                    print usage 
    133137                    sys.exit()                           
    134                      
    135138     
    136139             
     
    162165        if mapping is None: 
    163166            mapping = 'onetomany' #default filemapping for GridSeriesFeature 
    164      
    165     csmldataset=csmllibs.csmlbuilder.csmlBuilder(directory,csmlfeaturetype,mapping,timedimension, outputfile) 
     167 
     168    csmldataset=csmllibs.csmlbuilder.csmlBuilder(directory,csmlfeaturetype,mapping,timedimension, outputfile, printscreen) 
    166169    print "building csml..." 
    167170    csmldataset.build() 
Note: See TracChangeset for help on using the changeset viewer.