Example #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())
Example #2
0
def ensure_directory_exists(dirpath):
    if not path.exists(dirpath):
        makedirs(dirpath)
Example #3
0
def ensure_directory_exists(dirpath):
    if not path.exists(dirpath):
        makedirs(dirpath)
Example #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())