def writeContent(self):
    wr = self.writeln
    factories = [factory for factory in ServletFactoryManager._factories if factory._classCache]
    if (not factories):
        wr('<h4>No caching servlet factories found.</h4>')
        wr('<p>Caching can be activated by setting <code>CacheServletClasses = True</code>.</p>')
        return
    if (len(factories) > 1):
        factories.sort()
        wr('<h3>Servlet Factories:</h3>')
        wr('<table>')
        for factory in factories:
            wr(('<tr><td><a href="#%s">%s</a></td></tr>' % ((factory.name(),) * 2)))
        wr('</table>')
    req = self.request()
    wr('<form action="ServletCache" method="post">')
    for factory in factories:
        name = factory.name()
        wr(('<a id="%s"></a><h4>%s</h4>' % ((name,) * 2)))
        if req.hasField(('flush_' + name)):
            factory.flushCache()
            wr('<p style="color:green">The servlet cache has been flushed. &nbsp; <input type="submit" name="reload" value="Reload"></p>')
            continue
        wr(htCache(factory))
    wr('</form>')
def writeContent(self):
    wr = self.writeln
    factories = [factory for factory in ServletFactoryManager._factories if factory._classCache]
    if (not factories):
        wr('<h4>No caching servlet factories found.</h4>')
        wr('<p>Caching can be activated by setting <code>CacheServletClasses = True</code>.</p>')
        return
    if (len(factories) > 1):
        factories.sort()
        wr('<h3>Servlet Factories:</h3>')
        wr('<table>')
        for factory in factories:
            wr(('<tr><td><a href="#%s">%s</a></td></tr>' % ((factory.name(),) * 2)))
        wr('</table>')
    req = self.request()
    wr('<form action="ServletCache" method="post">')
    for factory in factories:
        name = factory.name()
        wr(('<a id="%s"></a><h4>%s</h4>' % ((name,) * 2)))
        if req.hasField(('flush_' + name)):
            factory.flushCache()
            wr('<p style="color:green">The servlet cache has been flushed. &nbsp; <input type="submit" name="reload" value="Reload"></p>')
            continue
        wr(htCache(factory))
    wr('</form>')