예제 #1
0
 def save(self):
     """Save the state to the JSON file in the config dir."""
     logger.debug("Save the GUI state to `%s`.", self.path)
     _save_json(
         self.path,
         {k: v
          for k, v in self.items() if k not in ('config_dir', 'name')})
예제 #2
0
파일: context.py 프로젝트: kwikteam/phy
 def save(self, name, data, location='local', kind='json'):
     """Save a dictionary in a JSON file within the cache directory."""
     file_ext = '.json' if kind == 'json' else '.pkl'
     path = self._get_path(name, location, file_ext=file_ext)
     _ensure_dir_exists(op.dirname(path))
     logger.debug("Save data to `%s`.", path)
     if kind == 'json':
         _save_json(path, data)
     else:
         _save_pickle(path, data)
예제 #3
0
 def save(self, name, data, location='local', kind='json'):
     """Save a dictionary in a JSON file within the cache directory."""
     file_ext = '.json' if kind == 'json' else '.pkl'
     path = self._get_path(name, location, file_ext=file_ext)
     _ensure_dir_exists(op.dirname(path))
     logger.debug("Save data to `%s`.", path)
     if kind == 'json':
         _save_json(path, data)
     else:
         _save_pickle(path, data)
예제 #4
0
파일: context.py 프로젝트: stephenlenzi/phy
 def save(self, name, data, location='local'):
     """Save a dictionary in a JSON file within the cache directory."""
     path = self._get_path(name, location)
     _ensure_dir_exists(op.dirname(path))
     logger.debug("Save data to `%s`.", path)
     _save_json(path, data)
예제 #5
0
파일: context.py 프로젝트: ablot/phy
 def save(self, name, data, location='local'):
     """Save a dictionary in a JSON file within the cache directory."""
     path = self._get_path(name, location)
     _ensure_dir_exists(op.dirname(path))
     logger.debug("Save data to `%s`.", path)
     _save_json(path, data)
예제 #6
0
파일: gui.py 프로젝트: kwikteam/phy
 def save(self):
     """Save the state to the JSON file in the config dir."""
     logger.debug("Save the GUI state to `%s`.", self.path)
     _save_json(self.path, {k: v for k, v in self.items()
                            if k not in ('config_dir', 'name')})