[IMP]Yaltik DSL : do not regenerate XML from cached Python
This commit is contained in:
parent
8709bd2195
commit
829c72900a
@ -19,7 +19,7 @@
|
|||||||
'name': 'Yaltik Odoo DSL base module and fns',
|
'name': 'Yaltik Odoo DSL base module and fns',
|
||||||
'summary': 'Yaltik Odoo Domain Specific Language base module and functions',
|
'summary': 'Yaltik Odoo Domain Specific Language base module and functions',
|
||||||
'description': """ Yaltik Odoo Domain Specific Language base module and functions """,
|
'description': """ Yaltik Odoo Domain Specific Language base module and functions """,
|
||||||
'version': '10.0.0.2.2',
|
'version': '10.0.0.2.3',
|
||||||
'category': 'Yaltik',
|
'category': 'Yaltik',
|
||||||
'author': 'Fabien Bourgeois',
|
'author': 'Fabien Bourgeois',
|
||||||
'license': 'AGPL-3',
|
'license': 'AGPL-3',
|
||||||
|
@ -52,8 +52,9 @@ def xmln(tag='', attrs=None, children=None, text=False):
|
|||||||
|
|
||||||
def xml_write(filepath, tree):
|
def xml_write(filepath, tree):
|
||||||
""" Write XML file according to filename and given tree """
|
""" Write XML file according to filename and given tree """
|
||||||
output_xml = minidom.parseString(ET.tostring(tree)).toprettyxml(indent=' ')
|
if filepath.endswith('.py'): # if .pyc, no need to generate XML
|
||||||
output_path = path.dirname(path.abspath(filepath))
|
output_xml = minidom.parseString(ET.tostring(tree)).toprettyxml(indent=' ')
|
||||||
fpath = '%s/%s' % (output_path, path.basename(filepath).replace('.py', '_views.xml'))
|
output_path = path.dirname(path.abspath(filepath))
|
||||||
with open(fpath, 'w') as output_file:
|
fpath = '%s/%s' % (output_path, path.basename(filepath).replace('.py', '_views.xml'))
|
||||||
output_file.write(output_xml)
|
with open(fpath, 'w') as output_file:
|
||||||
|
output_file.write(output_xml)
|
||||||
|
Loading…
Reference in New Issue
Block a user