From 6be9013d6cdf09aedabfdfa9f826880d0ff60443 Mon Sep 17 00:00:00 2001 From: ConnectedSystems Date: Thu, 28 Jan 2021 15:11:14 +1100 Subject: [PATCH] Re-insert fix from #200 --- pysd/py_backend/xmile/xmile2py.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pysd/py_backend/xmile/xmile2py.py b/pysd/py_backend/xmile/xmile2py.py index 454f7fd3..a698ebc6 100644 --- a/pysd/py_backend/xmile/xmile2py.py +++ b/pysd/py_backend/xmile/xmile2py.py @@ -6,6 +6,9 @@ Alexey Prey Mulyukin from sdCloud.io development team. """ +import re +import os.path + from .SMILE2Py import SMILEParser from lxml import etree from .. import builder, utils @@ -338,7 +341,8 @@ def parse_lookup_xml_node(node): 'arguments': '', }) - outfile_name = xmile_file.replace('.xmile', '.py') + file_name, file_extension = os.path.splitext(xmile_file) + outfile_name = file_name + '.py' builder.build(elements=model_elements, subscript_dict={},