partsdb

electronic parts inventory
git clone https://git.e1e0.net/partsdb.git
Log | Files | Refs

commit ce839b37cd28c30a98d014aa1dba1f0f149b66f3
parent 2997e93fee451585aa0dc38232bed8cecac74585
Author: Paco Esteban <paco@e1e0.net>
Date:   Sat, 13 Mar 2021 10:39:30 +0100

add stock and export options, not implemented

Diffstat:
MmyChips.py | 19+++++++++++++++++++
1 file changed, 19 insertions(+), 0 deletions(-)

diff --git a/myChips.py b/myChips.py @@ -119,6 +119,13 @@ def delete_part(part_id): pass +def adjust_stock(part_id, stock_mod): + pass + +def export_db(dest_folder): + pass + + if __name__ == '__main__': ap = argparse.ArgumentParser() # Place for global options here @@ -140,6 +147,14 @@ if __name__ == '__main__': # delete ap_delete = asp.add_parser("delete", help="Delete a part") ap_delete.add_argument("part_id", help="Part Id", type=int) + # stock + ap_stock = asp.add_parser("stock", help="Modifies a part stock") + ap_stock.add_argument("part_id", help="Part Id", type=int) + ap_stock.add_argument("stock_mod", + help="Stock modifier (+ or -) int", type=int) + # export + ap_export = asp.add_parser("export", help="Exports DB to HTML") + ap_export.add_argument("dest_folder", help="Destination folder") args = ap.parse_args() if not args.command: @@ -156,6 +171,10 @@ if __name__ == '__main__': get_part(args.part_id) elif args.command == 'delete': delete_part(args.part_id) + elif args.command == 'stock': + adjust_stock(args.part_id, args.stock_mod) + elif args.command == 'export': + export_db(args.dest_folder) else: ap.print_help() sys.exit(0)