__init__.py (pymol-v2.1.0.tar.bz2) | : | __init__.py (pymol-open-source-2.2.0) | ||
---|---|---|---|---|
skipping to change at line 74 | skipping to change at line 74 | |||
self._COb = cmd._COb | self._COb = cmd._COb | |||
self.cmd = cmd | self.cmd = cmd | |||
def stop(self): | def stop(self): | |||
with pymol2_lock: | with pymol2_lock: | |||
_cmd._stop(self._COb) | _cmd._stop(self._COb) | |||
_cmd._del(self._COb) | _cmd._del(self._COb) | |||
pymol.cmd._COb = None | pymol.cmd._COb = None | |||
def __enter__(self): | ||||
self.start() | ||||
return self | ||||
def __exit__(self, exc_type, exc_value, tb): | ||||
self.stop() | ||||
class PyMOL(SingletonPyMOL): | class PyMOL(SingletonPyMOL): | |||
''' | ''' | |||
Start a non-exclusive PyMOL instance, multiple instances are possible | Start a non-exclusive PyMOL instance, multiple instances are possible | |||
''' | ''' | |||
def __getattr__(self, key): | def __getattr__(self, key): | |||
# Make this a proxy to the "pymol" module. | # Make this a proxy to the "pymol" module. | |||
return getattr(pymol, key) | return getattr(pymol, key) | |||
def __init__(self,scheme=None): # initialize a PyMOL instance | def __init__(self,scheme=None): # initialize a PyMOL instance | |||
End of changes. 1 change blocks. | ||||
0 lines changed or deleted | 7 lines changed or added |