mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
IGN:Pretty print scheduler.xml
This commit is contained in:
parent
d74445922e
commit
ab4401a4fe
@ -193,11 +193,15 @@ class SchedulerConfig(object):
|
|||||||
|
|
||||||
def write_scheduler_file(self):
|
def write_scheduler_file(self):
|
||||||
from calibre.utils.lock import ExclusiveFile
|
from calibre.utils.lock import ExclusiveFile
|
||||||
|
self.root.text = '\n\n\t'
|
||||||
|
for x in self.root:
|
||||||
|
x.tail = '\n\n\t'
|
||||||
|
self.root[-1].tail = '\n\n'
|
||||||
with ExclusiveFile(self.conf_path) as f:
|
with ExclusiveFile(self.conf_path) as f:
|
||||||
f.seek(0)
|
f.seek(0)
|
||||||
f.truncate()
|
f.truncate()
|
||||||
f.write(etree.tostring(self.root, encoding='utf-8',
|
f.write(etree.tostring(self.root, encoding='utf-8',
|
||||||
xml_declaration=True, pretty_print=True))
|
xml_declaration=True, pretty_print=False))
|
||||||
|
|
||||||
def serialize_schedule(self, typ, schedule):
|
def serialize_schedule(self, typ, schedule):
|
||||||
s = E.schedule({'type':typ})
|
s = E.schedule({'type':typ})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user