Better use of relative paths.
This commit is contained in:
parent
d3aedf8033
commit
d15578a90e
|
@ -313,8 +313,8 @@ def extract_attachments_from_invoice_file(
|
|||
"""
|
||||
for at in invoice_file_xml_root.findall(invoice_file_xml_attachment_xpath):
|
||||
attachment = at.find(invoice_file_xml_attachment_tag).text
|
||||
attachment_dest_path = str(pathlib.Path(destination_directory, at.find(
|
||||
invoice_file_xml_attachment_filename_tag).text))
|
||||
attachment_relative = pathlib.Path(attachment).name
|
||||
attachment_dest_path = str(pathlib.Path(destination_directory, attachment_relative))
|
||||
|
||||
if not ignore_attachment_extension_whitelist:
|
||||
if not attachment_dest_path.endswith(
|
||||
|
@ -364,7 +364,8 @@ def get_invoice_as_html(invoice_file_xml_root,
|
|||
"""
|
||||
transform = ET.XSLT(invoice_file_xml_stylesheet_root)
|
||||
newdom = transform(invoice_file_xml_root)
|
||||
html_output_file = str(pathlib.Path(destination_directory, html_output_file))
|
||||
html_output_file_relative = pathlib.Path(html_output_file).name
|
||||
html_output_file = str(pathlib.Path(destination_directory, html_output_file_relative))
|
||||
with atomicwrites.atomic_write(html_output_file, mode='w',
|
||||
overwrite=True) as f:
|
||||
f.write(
|
||||
|
@ -920,7 +921,7 @@ def pipeline(source: str, file_type: str, data: dict):
|
|||
str(
|
||||
pathlib.Path(tmpdirname,
|
||||
file_to_consider_original_relative)),
|
||||
str(pathlib.Path(data['destination directory'], file_to_consider_original)))
|
||||
str(pathlib.Path(data['destination directory'], file_to_consider_original_relative)))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
|
Loading…
Reference in New Issue