Esempio n. 1
0
 def loadglobals(self):
     """Load globals() from filename"""
     glbs = self.mglobals()
     from spyderlib.utils.iofuncs import iofunctions
     filename = read_packet(self.i_request)
     ext = read_packet(self.i_request)
     load_func = iofunctions.load_funcs[ext]
     data, error_message = load_func(filename)
     if error_message:
         return error_message
     for key in data.keys():
         new_key = fix_reference_name(key, blacklist=glbs.keys())
         if new_key != key:
             data[new_key] = data.pop(key)
     try:
         glbs.update(data)
     except Exception, error:
         return str(error)
Esempio n. 2
0
 def loadglobals(self):
     """Load globals() from filename"""
     glbs = self.mglobals()
     from SMlib.utils.iofuncs import iofunctions
     filename = read_packet(self.i_request)
     ext = read_packet(self.i_request)
     load_func = iofunctions.load_funcs[ext]
     data, error_message = load_func(filename)
     if error_message:
         return error_message
     for key in data.keys():
         new_key = fix_reference_name(key, blacklist=glbs.keys())
         if new_key != key:
             data[new_key] = data.pop(key)
     try:
         glbs.update(data)
     except Exception, error:
         return str(error)