예제 #1
0
파일: context.py 프로젝트: stephenlenzi/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)
예제 #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 {}