Package schrodinger :: Package utils :: Module pymol :: Class PymolInstance
[hide private]
[frames] | no frames]

Class PymolInstance

object --+
         |
        PymolInstance
Known Subclasses:

Represents a remote PyMOL instance (controlled via a one-way pipe)

Acts like a proxy to the cmd module, without return values on function calls (which would actually be very usefull).

See also: PyMOL XMLRPC server (pymol -R)

Instance Methods [hide private]
 
__init__(self, pymol_command='pymol')
x.__init__(...) initializes x; see help(type(x)) for signature
 
_initPipe(self)
Set up self._pipe
 
_hangingStdinWorkaround(self)
workaround for PYMOL-234 PYMOL-246 PYMOL-508 PYMOL-510
dict
_getEnviron(self)
The SCHRODINGER environment may be incompatible with PyMOL.
 
__getattr__(self, name)
str
get_legal_name(self, name)
Replacement for cmd.get_legal_name
str
get_unused_name(self, name, alwaysnumber=1)
Replacement for cmd.get_unused_name, does not talk back to PyMOL but maintains it's own set of already used names.
 
sendVersionCheck(self)
Print a warning on the PyMOL log window if PyMOL version is too old.
bool
do(self, cmmd)
Send command to PyMOL
 
close(self)
Quit PyMOL

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  _re_illegal = re.compile(r'[^-\.\w]')
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, pymol_command='pymol')
(Constructor)

 

x.__init__(...) initializes x; see help(type(x)) for signature

Parameters:
  • pymol_command (str) - path to pymol executable
Overrides: object.__init__

_getEnviron(self)

 

The SCHRODINGER environment may be incompatible with PyMOL. This method provides a cleaned environment dictionary for the pymol subprocess.

Returns: dict

get_legal_name(self, name)

 

Replacement for cmd.get_legal_name

Parameters:
  • name (str) - name candidate
Returns: str
legal PyMOL object name

get_unused_name(self, name, alwaysnumber=1)

 

Replacement for cmd.get_unused_name, does not talk back to PyMOL but maintains it's own set of already used names.

This is only necessary because the the pipe cannot return values.

Parameters:
  • name (str) - name candidate
  • alwaysnumber (bool) - if False, only append a number if name already exists
Returns: str
unused legal PyMOL object name

do(self, cmmd)

 

Send command to PyMOL

Parameters:
  • cmmd (str) - PyMOL command
Returns: bool
True on success and False on error