Exemplo n.º 1
0
 def form(self):
   if self.outer.name is not None:
     return '<input type="hidden" name="multiform_%s_stage" value="%d" />' % \
       (cgi.html_encode(self.outer.name), self.outer.stage + 1)
   s = ['<input type="hidden" name="multiform_stage" value="%d" />' % \
     (self.outer.stage + 1,)]
   for key in self.outer.container.keys():
     if key not in self.outer.stage_objs[self.outer.stage].keys:
       s.append('<input type="hidden" name="%s" value="%s" />' % \
         (cgi.html_encode(key), cgi.html_encode(self.outer.container[key])))
   return "".join(s)
Exemplo n.º 2
0
 def form(self):
     close = ""
     if self.outer.xhtml:
         close = " /"
     if self.outer.name is not None:
         return '<input type="hidden" name="multiform_%s_stage" value="%d"%s>' % \
           (cgi.html_encode(self.outer.name), self.outer.stage + 1, close)
     s = ['<input type="hidden" name="multiform_stage" value="%d"%s>' % \
       (self.outer.stage + 1, close)]
     for key in self.outer.container.keys():
         if key not in self.outer.stage_objs[self.outer.stage].keys:
             for value in (self.outer.container[key] if key.endswith("*")
                           else (self.outer.container[key], )):
                 s.append('<input type="hidden" name="%s" value="%s"%s>' % \
                   (cgi.html_encode(key), cgi.html_encode(value), close))
     return "".join(s)
Exemplo n.º 3
0
 def form(self):
   close = ""
   if self.outer.xhtml:
     close = " /"
   if self.outer.name is not None:
     return '<input type="hidden" name="multiform_%s_stage" value="%d"%s>' % \
       (cgi.html_encode(self.outer.name), self.outer.stage + 1, close)
   s = ['<input type="hidden" name="multiform_stage" value="%d"%s>' % \
     (self.outer.stage + 1, close)]
   for key in self.outer.container.keys():
     if key not in self.outer.stage_objs[self.outer.stage].keys:
       for value in (self.outer.container[key] if key.endswith("*")
           else (self.outer.container[key],)):
         s.append('<input type="hidden" name="%s" value="%s"%s>' % \
           (cgi.html_encode(key), cgi.html_encode(value), close))
   return "".join(s)
Exemplo n.º 4
0
 def main(self, template):
   for self.paragraph in re.split(r"\r?\n\r?\n", self.text()):
     self.paragraph = cgi.html_encode(self.paragraph)
     self.paragraph = self.paragraph.replace("\n", "<br />")
     def repl(m):
       return '<a target="_blank" href="%s">%s</a>' % \
         (m.group(2), m.group(1))
     self.paragraph = re.sub(r"\|([^|]+)\|([^|]+)\|", repl, self.paragraph)
     self.process(template)
Exemplo n.º 5
0
    def main(self, template):
        for self.paragraph in re.split(r"\r?\n\r?\n", self.text()):
            self.paragraph = cgi.html_encode(self.paragraph)
            self.paragraph = self.paragraph.replace("\n", "<br />")

            def repl(m):
                return '<a target="_blank" href="%s">%s</a>' % \
                  (m.group(2), m.group(1))

            self.paragraph = re.sub(r"\|([^|]+)\|([^|]+)\|", repl,
                                    self.paragraph)
            self.process(template)
Exemplo n.º 6
0
 def main(self, template):
   for self.paragraph in re.split(r"\r?\n\r?\n", self.text()):
     self.paragraph = cgi.html_encode(self.paragraph)
     self.paragraph = self.paragraph.replace("\n", "<br />")
     self.process(template)
Exemplo n.º 7
0
 def main(self, template):
     for self.paragraph in re.split(r"\r?\n\r?\n", self.text()):
         self.paragraph = cgi.html_encode(self.paragraph)
         self.paragraph = self.paragraph.replace("\n", "<br />")
         self.process(template)