Exemplo n.º 1
0
 def _command_render(self, how, command, *args, **kwargs):
     old_ui, config = self.env.session.ui, self.env.session.config
     try:
         ui = self.env.session.ui = HttpUserInteraction(None, config)
         ui.html_variables = copy.deepcopy(old_ui.html_variables)
         ui.render_mode = how
         ui.display_result(
             Action(self.env.session, command, args, data=kwargs))
         return ui.render_response(config)
     finally:
         self.env.session.ui = old_ui
Exemplo n.º 2
0
 def _command_render(self, how, command, *args, **kwargs):
     self._debug('mailpile_render(%s, %s, ...)' % (how, command))
     old_ui, config = self.env.session.ui, self.env.session.config
     try:
         ui = self.env.session.ui = HttpUserInteraction(None, config,
                                                        log_parent=old_ui,
                                                        log_prefix='jinja/')
         ui.html_variables = copy.deepcopy(old_ui.html_variables)
         ui.render_mode = how
         ui.display_result(Action(self.env.session, command, args,
                                  data=kwargs))
         rv = ui.render_response(config)
         return (rv[0], rv[1].strip())
     finally:
         self.env.session.ui = old_ui