mirror of https://gerrit.osmocom.org/pysim
split parameter writing for CSV and SQL into separate functions
This commit is contained in:
parent
2fc205ceb9
commit
130524b719
|
@ -378,8 +378,8 @@ def print_parameters(params):
|
|||
""" % params
|
||||
|
||||
|
||||
def write_parameters(opts, params):
|
||||
# CSV
|
||||
def write_params_csv(opts, params):
|
||||
# csv
|
||||
if opts.write_csv:
|
||||
import csv
|
||||
row = ['name', 'iccid', 'mcc', 'mnc', 'imsi', 'smsp', 'ki', 'opc']
|
||||
|
@ -388,6 +388,7 @@ def write_parameters(opts, params):
|
|||
cw.writerow([params[x] for x in row])
|
||||
f.close()
|
||||
|
||||
def write_params_hlr(opts, params):
|
||||
# SQLite3 OpenBSC HLR
|
||||
if opts.write_hlr:
|
||||
import sqlite3
|
||||
|
@ -418,6 +419,10 @@ def write_parameters(opts, params):
|
|||
conn.commit()
|
||||
conn.close()
|
||||
|
||||
def write_parameters(opts, params):
|
||||
write_params_csv(opts, params)
|
||||
write_params_hldr(opts, params)
|
||||
|
||||
|
||||
BATCH_STATE = [ 'name', 'country', 'mcc', 'mnc', 'smsp', 'secret', 'num' ]
|
||||
BATCH_INCOMPATIBLE = ['iccid', 'imsi', 'ki']
|
||||
|
|
Loading…
Reference in New Issue