def create_rules(countries):
result = {}
for c in countries.itervalues():
- for rule in c.restrictions:
+ for rule in c.permissions:
result[rule] = 1
return result.keys()
def create_collections(countries):
result = {}
for c in countries.itervalues():
- result[c.restrictions] = 1
+ result[c.permissions] = 1
return result.keys()
power = {}
bands = {}
for c in countries.itervalues():
- for b, p in c.restrictions:
+ for b, p in c.permissions:
bands[b] = b
power[p] = p
rules = create_rules(countries)
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.restrictions]))
+ output.write(struct.pack('>ccxxI', str(alpha2[0]), str(alpha2[1]), reg_rules_collections[coll.permissions]))
# Load RSA only now so people can use this script
# without having those libraries installed to verify
s.max_ir_ptp, s.max_eirp_ptmp, s.max_eirp_ptp))
class Country(object):
- def __init__(self, restrictions=None, comments=None):
+ def __init__(self, permissions=None, comments=None):
# tuple of (freqband, powerrestriction)
- self._restrictions = restrictions or []
+ self._permissions = permissions or []
self.comments = comments or []
def add(self, band, power):
assert isinstance(band, FreqBand)
assert isinstance(power, PowerRestriction)
- self._restrictions.append((band, power))
- self._restrictions.sort()
+ self._permissions.append((band, power))
+ self._permissions.sort()
def __contains__(self, tup):
- return tup in self._restrictions
+ return tup in self._permissions
def __str__(self):
- r = ['(%s, %s)' % (str(b), str(p)) for b, p in self._restrictions]
+ r = ['(%s, %s)' % (str(b), str(p)) for b, p in self._permissions]
return '<Country (%s)>' % (', '.join(r))
- def _get_restrictions_tuple(self):
- return tuple(self._restrictions)
- restrictions = property(_get_restrictions_tuple)
+ def _get_permissions_tuple(self):
+ return tuple(self._permissions)
+ permissions = property(_get_permissions_tuple)
class SyntaxError(Exception):
pass