Open AiAiWilly opened 3 months ago
This is what solved the problem for me in the end...
Problem 1: My system: linux/ubuntu on wsl
Problem 2: Easydev get package location is used/designed for installations, going to the __init__
file, in my case anyway
Problem 3: Double "html_reports" directory, coming from easydev and repeated in the original relative_uri
` if template_path is None: relative_uri = f"templates/{template_name}.html"
uribase_1 = os.sep.join([easydev.get_package_location("html_reports")])
uribase_2 = os.path.dirname (uribase_1)
template_uri = os.path.join(uribase_2, relative_uri)
`
uribase_1 unpack file path of desired installation package
uribase_2 strip __init__
file from path
os.path.join is a smarter way to join paths, according to documentation
In the html_ reports module the reports.py has the following code:
`
If no custom path, use one of the predefined templates
` Which results in following error on execution of the script:
NotADirectoryError: [Errno 20] Not a directory:
'/home/%user%/.local/lib/python3.10/site-packages/html_reports/ __init__.py /html_reports/templates/simple.html'
In my case anyway :-)