Now we don't have to spam the caller with uninteresting properties.
## Otherwise take as many constituent characters as we can.
else:
left = dol + 1
## Otherwise take as many constituent characters as we can.
else:
left = dol + 1
- while left < n and (string[left].isalnum() or string[left] in '-_'):
+ if left < n and string[left] == '@':
+ left += 1
+ while left < n and (string[left].isalnum() or string[left] in '%-_'):
left += 1
prop = string[dol + 1:left]
left += 1
prop = string[dol + 1:left]
(' -> '.join(["`%s'" % p for p in path[seen[prop]:]]))
## Look up the raw value.
(' -> '.join(["`%s'" % p for p in path[seen[prop]:]]))
## Look up the raw value.
- try:
- value = me.inherited[prop]
- except KeyError:
- raise UserError, "unknown property `%s'" % prop
+ if prop == '@name':
+ value = me.name
+ else:
+ try:
+ value = me.inherited[prop]
+ except KeyError:
+ raise UserError, "unknown property `%s'" % prop
## Recursively expand, and unwind the PATH and SEEN stuff.
seen[prop] = len(path) - 1
## Recursively expand, and unwind the PATH and SEEN stuff.
seen[prop] = len(path) - 1
name = name.replace('-', '_')
if not (name and
(name in SPECIALS or
name = name.replace('-', '_')
if not (name and
(name in SPECIALS or
- all(map(lambda ch: ch == '_' or ch.isalnum(), name)))):
+ all(map(lambda ch: ch in '%_' or ch.isalnum(), name)))):
raise UserError, "%s:%d: bad name `%s'" % (filename, n, name)
## Store the assignment.
raise UserError, "%s:%d: bad name `%s'" % (filename, n, name)
## Store the assignment.
except KeyError:
raise UserError, "unknown section `%s'" % sect
for k, v in s.inherited.iteritems():
except KeyError:
raise UserError, "unknown section `%s'" % sect
for k, v in s.inherited.iteritems():
print '%s=%s' % (k, s.expand(v))
## Report errors for expected problems.
print '%s=%s' % (k, s.expand(v))
## Report errors for expected problems.