Removed dead code from KiBoM_CLI
This commit is contained in:
parent
e067d71571
commit
a0a5cc7e32
22
KiBOM_CLI.py
22
KiBOM_CLI.py
|
|
@ -6,8 +6,6 @@ import sys
|
||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
|
|
||||||
DELIMITER = ","
|
|
||||||
|
|
||||||
here = os.path.abspath(os.path.dirname(sys.argv[0]))
|
here = os.path.abspath(os.path.dirname(sys.argv[0]))
|
||||||
|
|
||||||
sys.path.append(here)
|
sys.path.append(here)
|
||||||
|
|
@ -17,26 +15,10 @@ from KiBOM.netlist_reader import *
|
||||||
from KiBOM.bom_writer import *
|
from KiBOM.bom_writer import *
|
||||||
from KiBOM.preferences import BomPref
|
from KiBOM.preferences import BomPref
|
||||||
|
|
||||||
#import bomfunk_netlist_reader
|
|
||||||
#import bomfunk_csv
|
|
||||||
#from bomfunk_csv import CSV_DEFAULT as COLUMNS
|
|
||||||
|
|
||||||
global DEBUG
|
|
||||||
DEBUG = True
|
|
||||||
|
|
||||||
def debug(msg):
|
|
||||||
global DEBUG
|
|
||||||
if DEBUG == True:
|
|
||||||
print(msg)
|
|
||||||
|
|
||||||
def close(*arg):
|
def close(*arg):
|
||||||
print(*arg)
|
print(*arg)
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
def error(*arg):
|
|
||||||
print(*arg)
|
|
||||||
sys.exit(-1)
|
|
||||||
|
|
||||||
if len(sys.argv) < 2:
|
if len(sys.argv) < 2:
|
||||||
close("No input file supplied")
|
close("No input file supplied")
|
||||||
|
|
||||||
|
|
@ -78,8 +60,9 @@ numberRows = True
|
||||||
|
|
||||||
#Look for a '.bom' preference file
|
#Look for a '.bom' preference file
|
||||||
pref_file = os.path.join(os.path.dirname(input_file) , ".bom")
|
pref_file = os.path.join(os.path.dirname(input_file) , ".bom")
|
||||||
pref = BomPref()
|
|
||||||
|
|
||||||
|
#read preferences from file. If file does not exists, default preferences will be used
|
||||||
|
pref = BomPref()
|
||||||
pref.Read(pref_file, verbose=True)
|
pref.Read(pref_file, verbose=True)
|
||||||
|
|
||||||
#write preference file back out (first run will generate a file with default preferences)
|
#write preference file back out (first run will generate a file with default preferences)
|
||||||
|
|
@ -102,6 +85,7 @@ groups = net.groupComponents(components)
|
||||||
|
|
||||||
columns = ColumnList()
|
columns = ColumnList()
|
||||||
|
|
||||||
|
#read out all available fields
|
||||||
for g in groups:
|
for g in groups:
|
||||||
for f in g.fields:
|
for f in g.fields:
|
||||||
columns.AddColumn(f)
|
columns.AddColumn(f)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue