diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2019-04-30 08:53:00 +0200 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2019-04-30 08:53:00 +0200 |
commit | f8703ee3820431ec0dbff4c9e10f0cb75a4da03c (patch) | |
tree | 4fd80153c2cd7811b9ab995d0767e96e48bcc170 /src | |
parent | 054019f7afb7aeeac680493c0b176eb35a832c96 (diff) | |
download | ee-python-f8703ee3820431ec0dbff4c9e10f0cb75a4da03c.tar.gz ee-python-f8703ee3820431ec0dbff4c9e10f0cb75a4da03c.tar.bz2 ee-python-f8703ee3820431ec0dbff4c9e10f0cb75a4da03c.tar.xz ee-python-f8703ee3820431ec0dbff4c9e10f0cb75a4da03c.zip |
part:
o Removing debugging info.
Diffstat (limited to 'src')
-rw-r--r-- | src/ee/part/excel.py | 5 | ||||
-rw-r--r-- | src/ee/tools/part_from_excel.py | 1 |
2 files changed, 0 insertions, 6 deletions
diff --git a/src/ee/part/excel.py b/src/ee/part/excel.py index cbbffde..12b583d 100644 --- a/src/ee/part/excel.py +++ b/src/ee/part/excel.py @@ -22,23 +22,18 @@ def from_excel(path: Path, sheet_name: Optional[str]) -> PartDb: sheet = list(sheet) header: Mapping[str, int] = {name.lower(): idx for idx, name in enumerate(sheet[0]) if len(name.strip())} - print(header) mpn_idx = header.get("mpn", None) desc_idx = header.get("description", None) price_idx = header.get("price", None) url_idx = header.get("url", None) - print("mpn: {}, desc: {}, price: {}, url: {}".format(mpn_idx, desc_idx, price_idx, url_idx)) - for idx, row in enumerate(sheet[1:], 1): mpn = row[mpn_idx] if mpn_idx is not None else "" desc = row[desc_idx].strip() if desc_idx is not None else "" price = row[price_idx] if price_idx is not None else None url = row[url_idx] if url_idx is not None else None - print(row[desc_idx]) - if len(mpn) == 0 and len(desc) == 0: print("Bad part, line #{}. MPN or description is required".format(idx)) continue diff --git a/src/ee/tools/part_from_excel.py b/src/ee/tools/part_from_excel.py index 63c7b65..f14bc45 100644 --- a/src/ee/tools/part_from_excel.py +++ b/src/ee/tools/part_from_excel.py @@ -23,5 +23,4 @@ args = parser.parse_args() out_path = Path(args.out_path) part_db = from_excel(Path(args.in_path), args.sheet) -print("len={}".format(part_db.size())) save_db(out_path, part_db) |