示例#1
0
 def load(self, name, location='local'):
     """Load saved data from the cache directory."""
     path = self._get_path(name, location)
     if not op.exists(path):
         logger.debug("The file `%s` doesn't exist.", path)
         return {}
     return _load_json(path)
示例#2
0
文件: context.py 项目: ablot/phy
 def load(self, name, location='local'):
     """Load saved data from the cache directory."""
     path = self._get_path(name, location)
     if not op.exists(path):
         logger.debug("The file `%s` doesn't exist.", path)
         return {}
     return _load_json(path)
示例#3
0
 def load(self):
     """Load the state from the JSON file in the config dir."""
     if not op.exists(self.path):
         logger.debug("The GUI state file `%s` doesn't exist.", self.path)
         # TODO: create the default state.
         return
     assert op.exists(self.path)
     logger.debug("Load the GUI state from `%s`.", self.path)
     self.update(_bunchify(_load_json(self.path)))
示例#4
0
文件: gui.py 项目: kwikteam/phy
 def load(self):
     """Load the state from the JSON file in the config dir."""
     if not op.exists(self.path):
         logger.debug("The GUI state file `%s` doesn't exist.", self.path)
         # TODO: create the default state.
         return
     assert op.exists(self.path)
     logger.debug("Load the GUI state from `%s`.", self.path)
     self.update(_bunchify(_load_json(self.path)))
示例#5
0
文件: context.py 项目: kwikteam/phy
 def load(self, name, location='local'):
     """Load saved data from the cache directory."""
     path = self._get_path(name, location, file_ext='.json')
     if op.exists(path):
         return _load_json(path)
     path = self._get_path(name, location, file_ext='.pkl')
     if op.exists(path):
         return _load_pickle(path)
     logger.debug("The file `%s` doesn't exist.", path)
     return {}
示例#6
0
 def load(self, name, location='local'):
     """Load saved data from the cache directory."""
     path = self._get_path(name, location, file_ext='.json')
     if op.exists(path):
         return _load_json(path)
     path = self._get_path(name, location, file_ext='.pkl')
     if op.exists(path):
         return _load_pickle(path)
     logger.debug("The file `%s` doesn't exist.", path)
     return {}