00001 #!/usr/local/bin/python 00002 # 00003 # Copyright 2004 00004 # by 00005 # The Board of Trustees of the 00006 # Leland Stanford Junior University. 00007 # All rights reserved. 00008 # 00009 00010 00011 __facility__ = "Online" 00012 __abstract__ = "Options class test" 00013 __author__ = "A. Perazzo <perazzo@SLAC.Stanford.edu> SLAC - GLAST I&T/Online" 00014 __date__ = ("$Date: 2004/08/24 23:20:56 $").split(' ')[1] 00015 __version__ = "$Revision: 2.1 $" 00016 __release__ = "$Name: R04-12-00 $" 00017 __credits__ = "SLAC" 00018 00019 import LATTE.copyright_SLAC 00020 00021 from LATTE.client.gOptions import Options 00022 00023 def test_cmdrsp(): 00024 options = Options(['server'],['schema'],['reload']) 00025 try: 00026 options.parse() 00027 print 'server name is %s' %(options.server) 00028 if options.schema is not None: 00029 print 'schema name is %s' %(options.schema) 00030 if options.reload is not None: 00031 print 'reaload switch is on' 00032 except Exception, msg: 00033 print msg 00034 options.usage() 00035 00036 if __name__ == '__main__': 00037 test_cmdrsp()