示例#1
0
文件: piu.py 项目: Peiiii/wpkit
 def __init__(self, path):
     self.seta(path=path)
     path = PowerDirPath(self.geta('path'))
     if path.exists():
         assert path.isfile()
         dic = json_load(path)
         assert isinstance(dic, dict)
     else:
         dic = {}
         path.tofile()
         json_dump(dic, path, indent=4)
     super().__init__(dic)
示例#2
0
 def file(self, name):
     path = self._truepath(name)
     p = PowerDirPath(path)
     p.tofile()
     return p