sort countries by alpha2 in binary database
authorJohannes Berg <johannes@sipsolutions.net>
Fri, 23 May 2008 10:50:45 +0000 (12:50 +0200)
committerJohannes Berg <johannes@sipsolutions.net>
Fri, 23 May 2008 10:50:45 +0000 (12:50 +0200)
db2bin.py

index 2755123..70ebfda 100755 (executable)
--- a/db2bin.py
+++ b/db2bin.py
@@ -81,7 +81,10 @@ for coll in collections:
 # update country pointer now!
 reg_country_ptr.set()
 
-for alpha2, coll in countries.iteritems():
+countrynames = countries.keys()
+countrynames.sort()
+for alpha2 in countrynames:
+    coll = countries[alpha2]
     # struct regdb_file_reg_country
     output.write(struct.pack('>ccxxI', str(alpha2[0]), str(alpha2[1]), reg_rules_collections[coll]))