# Finally, country definitions
country 00:
- WORLD, DEFAULT
+ # power definition is the same as DEFAULT, just to
+ # illustrate inlining it...
+ WORLD, (OI, 6, 30, 30, 36, 255)
country 01:
(2412 - 2732 @ 40, OFDM, CCK), DEFAULT
except ValueError:
self._syntax_error("power name must be followed by colon")
+ self._parse_power_def(pname, line)
+
+ def _parse_power_def(self, pname, line, dupwarn=True):
try:
(environ,
max_ant_gain,
max_ir_ptp, max_eirp_ptmp, max_eirp_ptp)
self._powerdup[pname] = pname
if p in self._powerrev:
- self._warn('Duplicate power definition ("%s" and "%s")' % (
- pname, self._powerrev[p]))
+ if dupwarn:
+ self._warn('Duplicate power definition ("%s" and "%s")' % (
+ pname, self._powerrev[p]))
self._powerdup[pname] = self._powerrev[p]
self._power[pname] = p
self._powerrev[p] = pname
self._syntax_error("country definition must have power")
except ValueError:
self._syntax_error("country definition must have band and power")
+
+ if pname[0] == '(':
+ if not pname[-1] == ')':
+ self._syntax_error("Badly parenthesised power definition")
+ power = pname[1:-1]
+ pname = 'UNNAMED %d' % self._lineno
+ self._parse_power_def(pname, power, dupwarn=False)
+
if not bname in self._bands:
self._syntax_error("band does not exist")
if not pname in self._power: