This is going to let us be more stateful as we copy lines from the
input to an output sites file, and as we process public keys into
output secnet.conf files.
No functional change yet.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
else:
obj.properties[propname]=kw[0](w)
else:
obj.properties[propname]=kw[0](w)
-
-def pline(il,allow_include=False):
+class FilterState:
+ def __init__(self):
+ self.reset()
+ def reset(self):
+ # called when we enter a new node,
+ # in particular, at the start of each site
+ pass
+
+def pline(il,filterstate,allow_include=False):
"Process a configuration file line"
global allow_defs, obstack, root
w=il.rstrip('\n').split()
"Process a configuration file line"
global allow_defs, obstack, root
w=il.rstrip('\n').split()
sys.exit(1)
current.children[tname]=nl
current=nl
sys.exit(1)
current.children[tname]=nl
current=nl
obstack.append(current)
return copyout()
if keyword.raw() not in current.allow_properties:
obstack.append(current)
return copyout()
if keyword.raw() not in current.allow_properties:
file=name
line=0
outlines=[]
file=name
line=0
outlines=[]
+ filterstate = FilterState()
for i in lines:
line=line+1
if (i[0]=='#'): continue
for i in lines:
line=line+1
if (i[0]=='#'): continue
- outlines += pline(i,allow_include=allow_include)
+ outlines += pline(i,filterstate,allow_include=allow_include)
return outlines
def outputsites(w):
return outlines
def outputsites(w):