move RSA import down in dbgen.py
authorJohannes Berg <johannes@sipsolutions.net>
Thu, 22 May 2008 21:57:32 +0000 (23:57 +0200)
committerJohannes Berg <johannes@sipsolutions.net>
Thu, 22 May 2008 21:57:32 +0000 (23:57 +0200)
dbgen.py

index ccbc8df..5a15dfb 100755 (executable)
--- a/dbgen.py
+++ b/dbgen.py
@@ -3,7 +3,6 @@
 from pysqlite2 import dbapi2 as db
 from cStringIO import StringIO
 import struct
-from M2Crypto import RSA
 import sha
 
 MAGIC = 0x52474442
@@ -112,6 +111,11 @@ for country in cursor:
     # struct regdb_file_reg_country
     output.write(struct.pack('>ccxxI', str(alpha2[0]), str(alpha2[1]), reg_rules_collections[reg_collection_id]))
 
+# Load RSA only now so people can use this script
+# without having those libraries installed to verify
+# their SQL changes
+from M2Crypto import RSA
+
 # determine signature length
 key = RSA.load_key('key.priv.pem')
 hash = sha.new()