changeset 79:e51cb51522d1

Fixed HTML typo in SystemInfo macro, added thread count. Activate print mode for page includes if the format-action is active. imported from: moin--main--1.5--patch-81
author Alexander Schremmer <alex@alexanderweb.de.tla>
date Thu, 06 Oct 2005 15:56:14 +0000
parents 6e0bb3ae3123
children 99f0d19d0285
files MoinMoin/macro/Include.py MoinMoin/wikimacro.py
diffstat 2 files changed, 18 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/macro/Include.py	Thu Oct 06 15:50:23 2005 +0000
+++ b/MoinMoin/macro/Include.py	Thu Oct 06 15:56:14 2005 +0000
@@ -65,7 +65,7 @@
 
     # prepare including page
     result = []
-    print_mode = macro.form.has_key('action') and macro.form['action'][0] == "print"
+    print_mode = macro.form.has_key('action') and macro.form['action'][0] in ("print", "format")
     this_page = macro.formatter.page
     if not hasattr(this_page, '_macroInclude_pagelist'):
         this_page._macroInclude_pagelist = {}
--- a/MoinMoin/wikimacro.py	Thu Oct 06 15:50:23 2005 +0000
+++ b/MoinMoin/wikimacro.py	Thu Oct 06 15:56:14 2005 +0000
@@ -363,6 +363,13 @@
         except AttributeError:
             ftversion = 'N/A'
 
+        t_count = None
+        try:
+            from threading import activeCount
+            t_count = activeCount()
+        except ImportError:
+            pass
+
         # Get the full pagelist in the wiki
         pagelist = self.request.rootpage.getPageList(user='')
         totalsize = reduce(operator.add, [Page(self.request, name).size()
@@ -370,8 +377,7 @@
 
         buf = StringIO()
         row = lambda label, value, buf=buf: buf.write(
-            u'<dt>%s</dt><dd>%s</dd>' %
-            (label, value))
+            u'<dt>%s</dt><dd>%s</dd>' % (label, value))
 
         buf.write(u'<dl>')
         row(_('Python Version'), sys.version)
@@ -389,33 +395,27 @@
             _("%(logcount)s (%(logsize)s bytes)") %
             {'logcount': edlog.lines(), 'logsize': edlog.size()})
 
-        # !!! This puts a heavy load on the server when the log is large,
-        # and it can appear on normal pages ==> so disable it for now.
+        # This puts a heavy load on the server when the log is large
         eventlogger = eventlog.EventLog(self.request)
         nonestr = _("NONE")
-        row('Event log',
-            "%s bytes" % eventlogger.size())
-        row(_('Global extension macros'), 
-            ', '.join(macro.extension_macros) or nonestr)
+        row('Event log', "%s bytes" % eventlogger.size())
+        row(_('Global extension macros'), ', '.join(macro.extension_macros) or nonestr)
         row(_('Local extension macros'), 
             ', '.join(wikiutil.wikiPlugins('macro', self.cfg)) or nonestr)
-        ext_actions = []
-        for a in action.extension_actions:
-            if not a in self.request.cfg.actions_excluded:
-                ext_actions.append(a)
-        row(_('Global extension actions'), 
-            ', '.join(ext_actions) or nonestr)
+        ext_actions = [x for x in action.extension_actions
+                       if not x in self.request.cfg.actions_excluded]
+        row(_('Global extension actions'), ', '.join(ext_actions) or nonestr)
         row(_('Local extension actions'), 
             ', '.join(wikiaction.getPlugins(self.request)[1]) or nonestr)
-        row(_('Global parsers'), 
-            ', '.join(parser.modules) or nonestr)
+        row(_('Global parsers'), ', '.join(parser.modules) or nonestr)
         row(_('Local extension parsers'), 
             ', '.join(wikiutil.wikiPlugins('parser', self.cfg)) or nonestr)
         row(_('Installed processors (DEPRECATED -- use Parsers instead)'), 
             ', '.join(processor.processors) or nonestr)
         state = (_('Disabled'), _('Enabled'))
         row(_('Lupy search'), state[self.request.cfg.lupy_search])
-        buf.write(u'</dl')
+        row(_('Active threads'), t_count or 'N/A')
+        buf.write(u'</dl>')
 
         return self.formatter.rawHTML(buf.getvalue())