/usr/lib/python2.7/dist-packages/pymol2/__init__.py is in pymol 1.8.4.0+dfsg-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 | #A* -------------------------------------------------------------------
#B* This file contains source code for the PyMOL computer program
#C* copyright 1998-2007 by Warren Lyford Delano of DeLano Scientific.
#D* -------------------------------------------------------------------
#E* It is unlawful to modify or remove this copyright notice.
#F* -------------------------------------------------------------------
#G* Please see the accompanying LICENSE file for further information.
#H* -------------------------------------------------------------------
#I* Additional authors of this source file include:
#-*
#-*
#-*
#Z* -------------------------------------------------------------------
import __main__
__main__.pymol_launch = 5
import pymol
from pymol import _cmd
__main__.pymol = pymol
from pymol import selector
import pymol.menu
import pymol.povray
from copy import deepcopy
import threading
import traceback
import sys
pymol2_lock = threading.RLock()
from cmd2 import Cmd
class PyMOL:
def __init__(self,scheme=None): # initialize a PyMOL instance
pymol2_lock.acquire(1)
try:
pymol._init_internals(self)
self.invocation = self._invocation
options = self.invocation.options
if scheme!=None: #
if scheme == 'presentation':
options.quiet = 0
options.show_splash = 0
options.external_gui = 0
options.internal_feedback = 0
options.no_quit = 1
options.internal_gui = 0
options.presentation = 1
elif scheme == 'widget': # An embedded widget of some type
options.quiet = 0
options.show_splash = 0
options.external_gui = 0
options.internal_feedback = 1
options.no_quit = 1
else:
options.show_splash = 0 # suppress this annoyance by default
self._COb = _cmd._new(self,self.invocation.options)
# initialize the cmd API
self.cmd = Cmd(self,self._COb)
# begin assembling the instance member by member
# key instance methods
self.exec_str = pymol.exec_str
self.adapt_to_hardware = pymol.adapt_to_hardware
self.exec_deferred = pymol.exec_deferred
# Python components
self.util = pymol.util
self.menu = pymol.menu
self.setting = pymol.setting
self.povray = pymol.povray
self.preset = pymol.preset
except:
traceback.print_exc()
pymol2_lock.release()
def __del__(self):
_cmd._del(self._COb)
def start(self):
pymol2_lock.acquire()
try:
# fire off the C code
_cmd._start(self._COb, self.cmd)
# add in some additional Python modules
self.chempy = pymol.chempy
self.bonds = pymol.bonds
self.models = pymol.models
except:
traceback.print_exc()
pymol2_lock.release()
def startWithTclTk(self, gui = None, skin=None):
self.start()
if gui == None:
gui = self.invocation.options.gui
if skin == None:
skin = self.invocation.options.skin
poll = 0
__import__(gui)
sys.modules[gui].__init__(self,poll,skin)
def stop(self):
_cmd._stop(self._COb)
def idle(self):
return _cmd._idle(self._COb)
def reshape(self, width, height, force=0):
_cmd._reshape(self._COb,width,height,force)
def getRedisplay(self,reset):
return _cmd._getRedisplay(self._COb,reset)
def draw(self):
_cmd._draw(self._COb)
def button(self,button,state,x,y,modifiers):
_cmd._button(self._COb,button,state,x,y,modifiers)
def drag(self,x,y,modifiers):
_cmd._drag(self._COb,x,y,modifiers)
|