def session_restore_wizard(session, _self=cmd):
     if session is not None:
         version = session.get('version', 0)
         if 'wizard' in session:
             from chempy.io import pkl
             try:
                 wizards = pkl.fromString(session['wizard'])
                 for wiz in wizards:
                     wiz.cmd = _self
                     wiz.migrate_session(version)
                 _self.set_wizard_stack(wizards)
             except Exception as e:
                 print(e)
                 print("Session-Warning: unable to restore wizard.")
     return 1
 def session_restore_wizard(session,_self=cmd):
     if session!=None:
         version = session.get('version', 0)
         if 'wizard' in session:
             from chempy.io import pkl
             try:
                 wizards = pkl.fromString(session['wizard'])
                 for wiz in wizards:
                     wiz.cmd = _self
                     wiz.migrate_session(version)
                 _self.set_wizard_stack(wizards)
             except Exception as e:
                 print(e)
                 print("Session-Warning: unable to restore wizard.")
     return 1