write_source#

pyconverter.xml2py.writer.write_source(commands, cmd_map, xml_doc_path, target_path, path_custom_functions=None, template_path=None, new_package_name='package', clean=True)#

Write out XML commands as Python source files.

Parameters:
commandslist[XMLCommand]

List of XML commands

cmd_mapdict

Dictionary with this format: {"command_name": "python_name"}.

xml_doc_pathstr

Path containing the XML directory to convert.

target_pathstr

Path to generate the new package to.

path_custom_functionsstr, optional

Path containing the customized functions. The default is None.

template_pathstr, optional

Path for the template to use. If no path is provided, the default template is used.

new_package_namestr, optional

Name of the new package. The default is package.

cleanbool, optional

Whether the directories in the new package path must be cleared before adding new files. The default is True.

Returns:
str

Path containing the source files of the created xml-commands package.