Esempio n. 1
0
    def write_xml(self, data={}, lang=None, kind='strings'):
        if isinstance(data, str):
            content = data
        else:
            content = etree.tostring(write_xml(data)).decode('utf-8')

        folder = 'values'
        if lang:
            folder = "%s-%s" % (folder, lang)
        filename = self.p(self.resource_dir, folder, '%s.xml' % kind)
        if not exists(dirname(filename)):
            os.makedirs(dirname(filename))
        mkfile(filename, content)
Esempio n. 2
0
    def write_xml(self, data={}, lang=None, kind="strings"):
        if isinstance(data, str):
            content = data
        else:
            content = etree.tostring(write_xml(data)).decode("utf-8")

        folder = "values"
        if lang:
            folder = "%s-%s" % (folder, lang)
        filename = self.p(self.resource_dir, folder, "%s.xml" % kind)
        if not exists(dirname(filename)):
            os.makedirs(dirname(filename))
        mkfile(filename, content)
Esempio n. 3
0
    def write_xml(self, data={}, lang=None, kind='strings'):
        if isinstance(data, basestring):
            content = data
        else:
            content = etree.tostring(write_xml(data))

        folder = 'values'
        if lang:
            folder = "%s-%s" % (folder, lang)
        filename = self.p(self.resource_dir, folder, '%s.xml' % kind)
        if not exists(dirname(filename)):
            os.makedirs(dirname(filename))
        mkfile(filename, content)
Esempio n. 4
0
def c(dom):
    print(etree.tostring(write_xml(dom)))
    return etree.tostring(write_xml(dom))