mirror of
https://github.com/olivierkes/manuskript.git
synced 2024-06-01 18:49:38 +12:00
9078079241
Signed-off-by: TheJackiMonster <thejackimonster@gmail.com>
23 lines
528 B
Python
23 lines
528 B
Python
#!/usr/bin/env python
|
|
# --!-- coding: utf8 --!--
|
|
|
|
import os
|
|
|
|
from lxml import etree
|
|
from manuskript.io.abstractFile import AbstractFile
|
|
|
|
|
|
class XmlFile(AbstractFile):
|
|
|
|
def load(self):
|
|
with open(self.path, 'rb') as file:
|
|
return etree.parse(file)
|
|
|
|
def save(self, content):
|
|
with open(self.path, 'wb') as file:
|
|
content.write(file, encoding="utf-8", xml_declaration=True, pretty_print=True)
|
|
|
|
def remove(self):
|
|
if os.path.exists(self.path):
|
|
os.remove(self.path)
|