make web regdb configurable
authorJohannes Berg <johannes@sipsolutions.net>
Fri, 23 May 2008 11:59:47 +0000 (13:59 +0200)
committerJohannes Berg <johannes@sipsolutions.net>
Fri, 23 May 2008 11:59:47 +0000 (13:59 +0200)
web/Regulatory.py

index 145a998..52cd575 100644 (file)
@@ -129,7 +129,10 @@ def macro_Regulatory(macro):
 
     country = request.form.get('alpha2', [None])[0]
 
-    bpc = DBParser().parse(open('/tmp/db.txt'))
+    dbpath = '/tmp/db.txt'
+    if hasattr('regdb_path', request.cfg):
+        dbpath = request.cfg.regdb_path
+    bpc = DBParser().parse(open(dbpath))
 
     if country:
         return _country(macro, bpc, country)