Package vmd :: Module control :: Class server
[hide private]
[frames] | no frames]

Class server

source code

The VMD server process.
Instance Methods [hide private]
 
__init__(self, vmdbinary='vmd', server_tcl='/sansom/gfio/oliver/Library/python/GromacsWrapper/vmd/remote_..., force=False, maxdelay=10, dispdev='text')
Start VMD in text mode and launch the remote server:
source code
 
start(self, force=False, maxdelay=10)
Start VMD and launch the remote server:
source code
 
stop(self)
Shutdown VMD.
source code
 
ping(self, pid=13405)
Check if a vmd server can be used.
source code
 
command(self, *args)
Send commands to the VMD server:
source code
Method Details [hide private]

__init__(self, vmdbinary='vmd', server_tcl='/sansom/gfio/oliver/Library/python/GromacsWrapper/vmd/remote_..., force=False, maxdelay=10, dispdev='text')
(Constructor)

source code 

Start VMD in text mode and launch the remote server:

server(**kwargs)

Bugs

  • starting multiple VMD processes does not work as we always use the same port
Parameters:
  • vmdbinary - vmd (either in PATH or absolute path)
  • server_tcl - path to the tcl script that starts the listening server in VMD (the default is correct in 99.9% of cases)
  • force -
    False
    don't launch new server if one is already active
    True
    always start new vmd process
  • maxdelay - maximum time to wait for the server to come up in seconds
  • dispdev - VMD display device; default is 'text' which runs VMD without graphics. 'win' is the graphical window device

start(self, force=False, maxdelay=10)

source code 

Start VMD and launch the remote server:

server.start(**kwargs)
Parameters:
  • force -
    False
    don't launch new server if one is already active
    True
    always start new vmd process
  • maxdelay - maximum number of seconds to wait for VMD to start

ping(self, pid=13405)

source code 

Check if a vmd server can be used.

Returns True or False.

Ignore the message 'error: uncaptured python exception' if the server is down.

command(self, *args)

source code 

Send commands to the VMD server:

c = command('cd','set w [atomselect top {water}]', '$w writepdb water.pdb')
c.results()

This is only a thin convenience wrapper for vmd.control.command() and not strongly tied to the server (as anyone can connect).