"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "modules/pymol/wizarding.py" between
pymol-v1.8.6.0.tar.bz2 and pymol-v2.1.0.tar.bz2

About: PyMOL is a Python-enhanced molecular graphics tool. It excels at 3D visualization of proteins, small molecules, density, surfaces, and trajectories. It also includes molecular editing, ray tracing, and movies. Open Source version.

wizarding.py  (pymol-v1.8.6.0.tar.bz2):wizarding.py  (pymol-v2.1.0.tar.bz2)
skipping to change at line 54 skipping to change at line 54
mod_obj = sys.modules[full_name] mod_obj = sys.modules[full_name]
if mod_obj: if mod_obj:
oname = name.capitalize() oname = name.capitalize()
r = DEFAULT_SUCCESS r = DEFAULT_SUCCESS
if hasattr(mod_obj,oname): if hasattr(mod_obj,oname):
kwd['_self']=_self kwd['_self']=_self
try: try:
wiz = getattr(mod_obj,oname)(*arg, **kwd) wiz = getattr(mod_obj,oname)(*arg, **kwd)
except WizardError as e: except WizardError as e:
from pymol.wizard.message import Message from pymol.wizard.message import Message
wiz = Message("Error: %s" % e.message, _self=_self) wiz = Message("Error: %s" % str(e), _self=_self)
if wiz: if wiz:
_self.set_wizard(wiz,replace) _self.set_wizard(wiz,replace)
_self.do("_ refresh_wizard") _self.do("_ refresh_wizard")
else: else:
print("Error: Sorry, couldn't find the '"+oname+"' class.") print("Error: Sorry, couldn't find the '"+oname+"' class.")
else: else:
print("Error: Sorry, couldn't import the '"+name+"' wizard.") print("Error: Sorry, couldn't import the '"+name+"' wizard.")
return r return r
def wizard(name=None,*arg,**kwd): def wizard(name=None,*arg,**kwd):
skipping to change at line 182 skipping to change at line 182
try: try:
_self.lock(_self) _self.lock(_self)
r = _cmd.get_wizard_stack(_self._COb) r = _cmd.get_wizard_stack(_self._COb)
finally: finally:
_self.unlock(r,_self) _self.unlock(r,_self)
if _self._raising(r,_self): raise pymol.CmdException if _self._raising(r,_self): raise pymol.CmdException
return r return r
def session_save_wizard(session,_self=cmd): def session_save_wizard(session,_self=cmd):
# double-pickle so that session file is class-independent # double-pickle so that session file is class-independent
stack = cmd.get_wizard_stack(_self=_self) stack = _self.get_wizard_stack()
session['wizard']=cPickle.dumps(stack,1) session['wizard']=cPickle.dumps(stack,1)
return 1 return 1
def session_restore_wizard(session,_self=cmd): def session_restore_wizard(session,_self=cmd):
if session!=None: if session!=None:
version = session.get('version', 0) version = session.get('version', 0)
if 'wizard' in session: if 'wizard' in session:
from chempy.io import pkl from chempy.io import pkl
try: try:
wizards = pkl.fromString(session['wizard']) wizards = pkl.fromString(session['wizard'])
for wiz in wizards: for wiz in wizards:
wiz.cmd = _self wiz.cmd = _self
wiz.migrate_session(version) wiz.migrate_session(version)
_self.set_wizard_stack(wizards,_self=_self) _self.set_wizard_stack(wizards)
except Exception as e: except Exception as e:
print(e) print(e)
print("Session-Warning: unable to restore wizard.") print("Session-Warning: unable to restore wizard.")
return 1 return 1
 End of changes. 3 change blocks. 
3 lines changed or deleted 3 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)