lineparser: Call _prepare_save() properly.
This commit is contained in:
parent
181426b50a
commit
60b6519b04
@ -150,6 +150,7 @@ class AppendLineParser(BaseLineParser):
|
|||||||
return data
|
return data
|
||||||
|
|
||||||
def save(self):
|
def save(self):
|
||||||
|
self._prepare_save()
|
||||||
with self._open('a') as f:
|
with self._open('a') as f:
|
||||||
self._write(f, self.new_data)
|
self._write(f, self.new_data)
|
||||||
self.new_data = []
|
self.new_data = []
|
||||||
@ -194,9 +195,7 @@ class LineParser(BaseLineParser):
|
|||||||
|
|
||||||
def save(self):
|
def save(self):
|
||||||
"""Save the config file."""
|
"""Save the config file."""
|
||||||
if not os.path.exists(self._configdir):
|
self._prepare_save()
|
||||||
os.makedirs(self._configdir, 0o755)
|
|
||||||
log.destroy.debug("Saving to {}".format(self._configfile))
|
|
||||||
with qtutils.savefile_open(self._configfile, self._binary) as f:
|
with qtutils.savefile_open(self._configfile, self._binary) as f:
|
||||||
self._write(f, self.data)
|
self._write(f, self.data)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user