Exemple #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)
Exemple #2
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)
Exemple #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)))
Exemple #4
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)))
Exemple #5
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 {}
Exemple #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 {}