Пример #1
0
 def setUp(self):
     dictionary = {'a': 'the_a', 'b': 'the_b', 'c': 'the_c'}
     self.mapper = bottle_utils.AttrMapper(dictionary.__getitem__)
Пример #2
0
                                oss)
    return oss.getvalue()


#--------------------------------------------------------------------------------
# Global application pages.

NOT_IMPLEMENTED = '''
<p style="color:red; font-weight: bold; font-style: italic;">
  (Feature not implemented yet.)
</p>
'''

# pylint: disable=invalid-name
app = bottle.Bottle()
A = bottle_utils.AttrMapper(app.router.build)


def render_overlay(contents):
    """Render an overlay of the navigation with the current errors.

    This is used to bring up new errors on any page when they occur.

    Returns:
      A string of HTML for the contents of the errors overlay.
    """
    return '''
      <div class="navigation" id="nav-right">
        <ul>
          {}
        </ul>
Пример #3
0
    report_.render_real_htmldiv(real_root, app.options, oss)
    return oss.getvalue()


#--------------------------------------------------------------------------------
# Global application pages.

NOT_IMPLEMENTED = '''
<p style="color:red; font-weight: bold; font-style: italic;">
  (Feature not implemented yet.)
</p>
'''

# pylint: disable=invalid-name
app = bottle.Bottle()
A = bottle_utils.AttrMapper(app.router.build)


def render_overlay():
    """Render an overlay with the current errors.

    This is used to bring up new errors on any page when they occur.

    Returns:
      A string of HTML for the contents of the errors overlay.
    """
    return '''
      <div class="navigation" id="nav-right">
        <ul>
          <li><a href="{}">Errors</a></li>
        </ul>