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__ = "Two command client 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 import LATTE.client.gOptions as gOptions 00022 import LATTE.client.gCmdCli as gCmdCli 00023 import LATTE.database.gAEM as gAEM 00024 00025 def test_twoclients(): 00026 options = gOptions.Options(['server']) 00027 try: 00028 options.parse() 00029 except Exception, msg: 00030 options.usage(str(msg)) 00031 return 00032 00033 clienta = gCmdCli.CmdCli() 00034 aema = gAEM.GAEM(clienta, None) 00035 clienta.connect(options.server) 00036 00037 clientb = gCmdCli.CmdCli() 00038 aemb = gAEM.GAEM(clientb, None) 00039 clientb.connect(options.server) 00040 00041 value = 0xbadbeef 00042 aema.trgseq = value 00043 aemb.trgseq = value 00044 print "aem.trgseq wrote 0x%x" %(value) 00045 00046 rdvaluea = aema.trgseq 00047 print "aem.trgseq returned 0x%x" %(rdvaluea) 00048 00049 clienta.disconnect() 00050 00051 rdvalueb = aemb.trgseq 00052 print "aem.trgseq returned 0x%x" %(rdvalueb) 00053 00054 clientb.disconnect() 00055 00056 if __name__ == '__main__': 00057 test_twoclients()