Add suggestions from #246

This commit is contained in:
Daniel Rojas 2022-08-05 18:25:05 +02:00 committed by Laurier Loiselle
parent 3122d060d4
commit b075e06d58
No known key found for this signature in database
GPG Key ID: 345920CC72089A3F
3 changed files with 6 additions and 2 deletions

View File

@ -15,7 +15,7 @@ setup(
author="Daniel Rojas",
# author_email='',
description="Easily document cables and wiring harnesses",
long_description=open(README_PATH).read(),
long_description=README_PATH.read_text(),
long_description_content_type="text/markdown",
install_requires=[
"click",

View File

@ -97,7 +97,7 @@ def clean_generated(groupkeys):
for filename in collect_filenames("Cleaning", key, generated_extensions):
if filename.is_file():
print(f' rm "{filename}"')
Path(filename).unlink()
filename.unlink()
def compare_generated(groupkeys, branch="", include_graphviz_output=False):

View File

@ -111,6 +111,8 @@ def wireviz(file, format, prepend, output_dir, output_name, version):
prepend_file = Path(prepend_file)
if not prepend_file.exists():
raise Exception(f"File does not exist:\n{prepend_file}")
if not prepend_file.is_file():
raise Exception(f"Path is not a file:\n{prepend_file}")
print("Prepend file:", prepend_file)
prepend_input += open_file_read(prepend_file).read() + "\n"
@ -122,6 +124,8 @@ def wireviz(file, format, prepend, output_dir, output_name, version):
file = Path(file)
if not file.exists():
raise Exception(f"File does not exist:\n{file}")
if not file.is_file():
raise Exception(f"Path is not a file:\n{file}")
# file_out = file.with_suffix("") if not output_file else output_file
_output_dir = file.parent if not output_dir else output_dir