From 009574858893811b0e286ed68d9cda3d128a32fd Mon Sep 17 00:00:00 2001 From: Fredrik Unger Date: Mon, 6 Feb 2012 22:17:06 +0100 Subject: [PATCH] Adding initial support for html forms. --- src/tree-cutter.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/tree-cutter.py b/src/tree-cutter.py index 19ddd87..1daed02 100755 --- a/src/tree-cutter.py +++ b/src/tree-cutter.py @@ -49,7 +49,8 @@ def publish(src,target): PREFIXES={u'db': u'http://docbook.org/ns/docbook', u'xi': u'http://www.w3.org/2001/XInclude', - u'xl': u'http://www.w3.org/1999/xlink'} + u'xl': u'http://www.w3.org/1999/xlink', + u'html' : u'http://www.w3.org/1999/xhtml'} class Directory(): """Class containing the state of the directory with articles""" @@ -126,6 +127,11 @@ class Page(): im = os.path.join(dirname,i.fileref) if os.path.isfile(im): self._resources.append(im) + for i in self._doc.xml_select(u"//html:form[@action]"): + pyscript = re.split('\.py',i.action,1)[0]+'.py' + im = os.path.join(dirname,pyscript) + if os.path.isfile(im): + self._resources.append(im) def render(self): # amara can not handle the docbook stylesheets -- 2.30.2