Skip to content

Commit

Permalink
Add suggestions from wireviz#246
Browse files Browse the repository at this point in the history
  • Loading branch information
formatc1702 authored and laurierloi committed Jan 19, 2023
1 parent 3122d06 commit b075e06
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
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",
Expand Down
2 changes: 1 addition & 1 deletion src/wireviz/tools/build_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
4 changes: 4 additions & 0 deletions src/wireviz/wv_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand Down

0 comments on commit b075e06

Please sign in to comment.