Skip to content

Commit

Permalink
release 0.2.4: bug fix on transistor with no part number
Browse files Browse the repository at this point in the history
  • Loading branch information
dragoncoder047 authored May 25, 2023
1 parent 27e2317 commit eaa6ea8
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 4 deletions.
Binary file added dist/schemascii-0.2.4-py3-none-any.whl
Binary file not shown.
Binary file added dist/schemascii-0.2.4.tar.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "schemascii"
version = "0.2.3"
version = "0.2.4"
description = "Render ASCII-art schematics to SVG"
readme = "README.md"
authors = [{ name = "dragoncoder047", email = "[email protected]" }]
Expand Down
2 changes: 1 addition & 1 deletion schemascii/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from .utils import XML
from .errors import *

__version__ = "0.2.3"
__version__ = "0.2.4"


def render(filename: str, text: str = None, **options) -> str:
Expand Down
5 changes: 3 additions & 2 deletions schemascii/components_render.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,10 +386,11 @@ def transistor(box: Cbox, terminals: list[Terminal], bom_data: BOMData, **option
bom:{npn/pnp/nfet/pfet}:part-number
flags:s=source,d=drain,g=gate,e=emitter,c=collector,b=base"""
if not any(
bom_data.data.lower().startswith(x) for x in ("pnp:", "npn:", "nfet:", "pfet:")
bom_data.data.lower().startswith(x) for x in ("pnp", "npn", "nfet", "pfet")
):
raise BOMError(f"Need type of transistor for {box.type}{box.id}")
silicon_type, part_num = bom_data.data.split(":")
silicon_type, *part_num = bom_data.data.split(":")
part_num = ":".join(part_num)
silicon_type = silicon_type.lower()
bom_data = BOMData(bom_data.type, bom_data.id, part_num)
if "fet" in silicon_type:
Expand Down

0 comments on commit eaa6ea8

Please sign in to comment.