Logo Search packages:      
Sourcecode: pymol version File versions

def pymol::rpc::launch_XMLRPC (   hostname = 'localhost',
  port = _xmlPort,
  nToTry = _nPortsToTry 
)

launches the xmlrpc server into a separate thread

  Arguments:
    hostname: name of the host for the server
    port: (OPTIONAL) the first port to try for the server
    nToTry: (OPTIONAL) the number of possible ports to try
      (in case the first can't be opened)

Definition at line 377 of file rpc.py.

00377                                                                          :
  """ launches the xmlrpc server into a separate thread

    Arguments:
      hostname: name of the host for the server
      port: (OPTIONAL) the first port to try for the server
      nToTry: (OPTIONAL) the number of possible ports to try
        (in case the first can't be opened)

  """
  global cgoDict,serv
  cgoDict = {}
  for i in range(nToTry):
    try:
      serv = SimpleXMLRPCServer.SimpleXMLRPCServer((hostname,port+i),logRequests=0)
    except:
      serv = None
    else:
      break
  if serv:
    print 'xml-rpc server running on port %d'%(port+i)
    serv.register_function(rpcCmd,'do')
    serv.register_function(rpcQuit,'quit')
    serv.register_function(rpcSet,'set')
    serv.register_function(rpcGet,'get')
    serv.register_function(rpcPing,'ping')
    serv.register_function(rpcResetCGO,'resetCGO')
    serv.register_function(rpcSphere,'sphere')
    serv.register_function(rpcCylinder,'cylinder')
    serv.register_function(rpcHide,'hide')
    serv.register_function(rpcShow,'show')
    serv.register_function(rpcZoom,'zoom')
    serv.register_function(rpcDeleteObject,'deleteObject')
    serv.register_function(rpcDeleteAll,'deleteAll')
    serv.register_function(rpcLoadMolBlock,'loadMolBlock')
    serv.register_function(rpcLoadSurface,'loadSurface')
    serv.register_function(rpcLoadFile,'loadFile')
    serv.register_function(rpcSave,'save')
    serv.register_function(rpcLabel,'label')
    serv.register_function(rpcRotate,'rotate')
    serv.register_function(rpcTranslate,'translate')
    serv.register_function(rpcGetNames,'getNames')
    serv.register_function(rpcIdentify,'identify')
    serv.register_function(rpcIndex,'index')
    serv.register_function(rpcCountAtoms,'countAtoms')
    serv.register_function(rpcIdAtom,'idAtom')
    serv.register_function(rpcHelp,'help')
    t = threading.Thread(target=serv.serve_forever)
    t.setDaemon(1)
    t.start()
  else:
    print 'xml-rpc server could not be started'
    print 'xml-rpc server could not be started'


Generated by  Doxygen 1.6.0   Back to index