6 Commits

Author SHA1 Message Date
Andreas Nordin
07e9f7887c refactor: rename 'input' -> 'yaml_data'
'input' overloads a python built-in name. Refactor to avoid this.
2020-06-25 13:41:00 +02:00
Andreas Nordin
1f34651388 feature: add --prepend-file option
- Allow prepending a separate YAML file for e.g. including common
  template definitions. This is accomodated by a new commandline option,
  --prepend-file, which takes a path to a YAML file. This is prepended
  to the regular input as-is.

- Refactor file loading to accomodate the above. This includes moving
  relevant parts to main() and instead supplying parse () with a string
  representation of the YAML data. Also add early file existance checks
  and bail out if any of the inputs are inaccessible or nonexistant.
2020-06-25 13:40:34 +02:00
Andreas Nordin
6c055374a7 fix awg<->mm2 conversions
Add an inverted dictionary and a lookup function from awg -> mm2. Also
do some minor refactoring. Both sides of the conversion table were
converted to strings, since '0000' and '2/0' are perfectly valid AWG
values.
2020-06-24 20:20:01 +02:00
Andreas Nordin
653597a0e9 Add 'specified_cable' field for BOM generation
There is no obvious way of specifying exactly which cable type
(manufacturer, part number) to use for a given cable, which is useful
for BOM purposes. Add a 'specified_cable' field to the Cable class to
remedy this, and render it both in the graph and the BOM.
2020-06-24 20:20:01 +02:00
Andreas Nordin
7af7567088 clean up imports, cmdline handling
Order imports properly. Fix path when running script directly from repo
rather than as an installed package. Refactor command line handling.
2020-06-24 20:20:01 +02:00
Andreas Nordin
2d428e8613 refactor dependencies and installation
There are hard copies of the graphviz and pyyaml dependencies included
in the repo. Remove these.

Sort out installation and dependency handling by writing a functional
setup.py script. Rename top level documentation. Refactor wireviz.py
slightly to allow it to run as an installed script.
2020-06-24 20:20:01 +02:00