X-Git-Url: https://projects.mako.cc/source/mw/blobdiff_plain/0b6046450eddcd6c63c7edb7d20c8f7b6b48f64b..e5ac78fd19391a33ca958071fe2011edc5ff9074:/src/mw/metadir.py diff --git a/src/mw/metadir.py b/src/mw/metadir.py index 18811db..b637b67 100644 --- a/src/mw/metadir.py +++ b/src/mw/metadir.py @@ -49,6 +49,10 @@ class Metadir(object): else: self.config = None + def save_config(self): + with open(self.config_loc, 'wb') as config_file: + self.config.write(config_file) + def create(self, api_url): # create the directory if os.path.isdir(self.location): @@ -64,8 +68,7 @@ class Metadir(object): self.config = ConfigParser.RawConfigParser() self.config.add_section('remote') self.config.set('remote', 'api_url', api_url) - with open(self.config_loc, 'wb') as config_file: - self.config.write(config_file) + self.save_config() # create cache/ os.mkdir(os.path.join(self.location, 'cache')) # create cache/pagedict