示例#1
0
 def to_disk(self):
     if not path.exists(path.dirname(self.filepath)):
         makedirs(path.dirname(self.filepath))
     with fopen(self.filepath, 'w') as fd:
         fd.write(self.to_json())
示例#2
0
def ensure_directory_exists(dirpath):
    if not path.exists(dirpath):
        makedirs(dirpath)
示例#3
0
def ensure_directory_exists(dirpath):
    if not path.exists(dirpath):
        makedirs(dirpath)
示例#4
0
 def to_disk(self):
     if not path.exists(path.dirname(self.filepath)):
         makedirs(path.dirname(self.filepath))
     with fopen(self.filepath, 'w') as fd:
         fd.write(self.to_json())