diff --git a/setup.py b/setup.py index cd289742..af1b715f 100644 --- a/setup.py +++ b/setup.py @@ -4,9 +4,7 @@ import os from setuptools import setup, find_packages -from src.wireviz import __version__ - -project_name = 'wireviz' +from src.wireviz import __version__, CMD_NAME, APP_URL # Utility function to read the README file. # Used for the long_description. It's nice, because now 1) we have a top level @@ -16,7 +14,7 @@ def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() setup( - name=project_name, + name=CMD_NAME, version=__version__, author='Daniel Rojas', #author_email='', @@ -30,7 +28,7 @@ def read(fname): ], license='GPLv3', keywords='cable connector hardware harness wiring wiring-diagram wiring-harness', - url='https://github.com/formatc1702/WireViz', + url=APP_URL, package_dir={'': 'src'}, packages=find_packages('src'), entry_points={ diff --git a/src/wireviz/Harness.py b/src/wireviz/Harness.py index a29ce35b..8b401c21 100644 --- a/src/wireviz/Harness.py +++ b/src/wireviz/Harness.py @@ -3,7 +3,7 @@ from wireviz.DataClasses import Connector, Cable from graphviz import Graph -from wireviz import wv_colors, wv_helper +from wireviz import wv_colors, wv_helper, __version__, APP_NAME, APP_URL from wireviz.wv_colors import get_color_hex from wireviz.wv_helper import awg_equiv, mm2_equiv, tuplelist2tsv, \ nested_html_table, flatten2d, index_if_list, html_line_breaks, \ @@ -63,8 +63,8 @@ def connect(self, from_name: str, from_pin: (int, str), via_name: str, via_pin: def create_graph(self) -> Graph: dot = Graph() - dot.body.append('// Graph generated by WireViz') - dot.body.append('// https://github.com/formatc1702/WireViz') + dot.body.append(f'// Graph generated by {APP_NAME} {__version__}') + dot.body.append(f'// {APP_URL}') font = 'arial' dot.attr('graph', rankdir='LR', ranksep='2', @@ -296,7 +296,11 @@ def output(self, filename: (str, Path), view: bool = False, cleanup: bool = True # HTML output with open_file_write(f'{filename}.html') as file: file.write('\n') - file.write('
') + file.write('\n') + file.write(' \n') + file.write(f' \n') + file.write(f'{item} | ') + file.write(f'{item} | ') file.write('
---|---|
{item_str} | ') + align = 'text-align:right; ' if listy[0][i] == 'Qty' else '' + file.write(f'{item_str} | ') file.write('