cmd2.py (pymol-open-source-2.2.0) | : | cmd2.py (pymol-open-source-2.3.0) | ||
---|---|---|---|---|
from pymol import cmd as global_cmd | from pymol import cmd as global_cmd | |||
import pymol | import pymol | |||
import inspect | import inspect | |||
import itertools | import itertools | |||
import weakref | import weakref | |||
#most recently created Cmd (for now) | ||||
cmd = None | ||||
class Cmd: | class Cmd: | |||
''' | ''' | |||
Proxy for the pymol.cmd module for multiple instances support. | Proxy for the pymol.cmd module for multiple instances support. | |||
''' | ''' | |||
def __init__(self, _pymol, _COb): | def __init__(self, _pymol, _COb): | |||
global cmd | ||||
cmd = weakref.proxy(self) | ||||
self._weakref = weakref.ref(self) | self._weakref = weakref.ref(self) | |||
self._weakrefproxy = weakref.proxy(self) | self._weakrefproxy = weakref.proxy(self) | |||
# store parent | # store parent | |||
self._pymol = weakref.proxy(_pymol) | self._pymol = weakref.proxy(_pymol) | |||
# store C object for easy access | # store C object for easy access | |||
self._COb = _COb | self._COb = _COb | |||
End of changes. 2 change blocks. | ||||
5 lines changed or deleted | 0 lines changed or added |