add CM APN list, remove non-MMS APN info

Fixes missing Verizon APN. Overall, smaller DB size but more APN info.
// FREEBIE
This commit is contained in:
Jake McGinty 2014-10-12 19:11:07 -07:00
parent 89fb80fcc5
commit 1d7b47c982
4 changed files with 1768 additions and 4 deletions

File diff suppressed because it is too large Load Diff

View File

@ -39,12 +39,17 @@ try:
count = 0
for apn in root.iter("apn"):
if apn.get("mmsc") == None:
continue
sqlvars = ["?" for x in apn.attrib.keys()] + ["?"]
values = [apn.get(attrib) for attrib in apn.attrib.keys()] + ["%s%s" % (apn.get("mcc"), apn.get("mnc"))]
keys = apn.attrib.keys() + ["mccmnc"]
mccmnc = "%s%s" % (apn.get("mcc"), apn.get("mnc"))
values = [apn.get(attrib) for attrib in apn.attrib.keys()] + [mccmnc]
keys = apn.attrib.keys() + ["mccmnc"]
statement = "INSERT INTO apns (%s) VALUES (%s)" % (", ".join(keys), ", ".join(sqlvars))
cursor.execute(statement, values)
cursor.execute("SELECT 1 FROM apns WHERE mccmnc = ? AND apn = ?", [mccmnc, apn.get("apn")])
if cursor.fetchone() == None:
statement = "INSERT INTO apns (%s) VALUES (%s)" % (", ".join(keys), ", ".join(sqlvars))
cursor.execute(statement, values)
count += 1
if not args.quiet:

Binary file not shown.