changeset 835:d4dd4fca1477

moved action/tm to action/thread_monitor, minor cleanup, added CHANGES entry about thread_monitor action
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Thu, 15 Jun 2006 11:01:41 +0200
parents f17ec1d923b3
children 538bf7495665
files MoinMoin/action/thread_monitor.py MoinMoin/action/tm.py MoinMoin/util/thread_monitor.py docs/CHANGES
diffstat 4 files changed, 36 insertions(+), 32 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MoinMoin/action/thread_monitor.py	Thu Jun 15 11:01:41 2006 +0200
@@ -0,0 +1,34 @@
+# -*- coding: iso-8859-1 -*-
+"""
+    MoinMoin - Thread monitor action
+
+    Shows the current traceback of all threads.
+
+    @copyright: 2006 by MoinMoin:AlexanderSchremmer
+    @license: GNU GPL, see COPYING for details.
+"""
+
+from time import sleep
+from StringIO import StringIO
+
+from MoinMoin.wikiutil import escape
+from MoinMoin.util import thread_monitor
+
+def execute(pagename, request):
+    request.http_headers()
+
+    request.theme.send_title("Thread monitor")
+    request.write('<pre>')
+
+    if not thread_monitor.hook_enabled:
+        request.write("Hook is not enabled.")
+    else:
+        s = StringIO()
+        thread_monitor.trigger_dump(s)
+        sleep(5) # allow for all threads to dump to request
+        request.write(escape(s.getvalue()))
+        
+    request.write('</pre>')
+    request.theme.send_footer(pagename)
+    request.theme.send_closing_html()
+
--- a/MoinMoin/action/tm.py	Wed Jun 14 21:52:37 2006 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-# -*- coding: iso-8859-1 -*-
-"""
-    MoinMoin - Thread monitor action
-
-    Shows the current traceback of all threads.
-
-    @copyright: 2006 by MoinMoin:AlexanderSchremmer
-    @license: GNU GPL, see COPYING for details.
-"""
-
-from MoinMoin.wikiutil import escape
-from MoinMoin.util import thread_monitor
-from StringIO import StringIO
-from time import sleep
-
-def execute(pagename, request):
-    request.http_headers()
-
-    request.theme.send_title("Thread monitor")
-    request.write('<pre>')
-
-    if not thread_monitor.hook_enabled:
-        request.write("Hook is not enabled.")
-    else:
-        s = StringIO()
-        thread_monitor.trigger_dump(s)
-        sleep(5) # allow for all threads to dump to request
-        request.write(escape(s.getvalue()))
-        
-    request.write('</pre>')
-    request.theme.send_footer(pagename)
-    request.theme.send_closing_html()
--- a/MoinMoin/util/thread_monitor.py	Wed Jun 14 21:52:37 2006 +0200
+++ b/MoinMoin/util/thread_monitor.py	Thu Jun 15 11:01:41 2006 +0200
@@ -80,3 +80,4 @@
             trigger_dump()
     
     threading.Thread(target=background_dumper, args=(seconds, )).start()
+
--- a/docs/CHANGES	Wed Jun 14 21:52:37 2006 +0200
+++ b/docs/CHANGES	Thu Jun 15 11:01:41 2006 +0200
@@ -101,6 +101,7 @@
       parser.wiki -> parser.text_moin_wiki
     * Added thread_monitor. It can be activated using:
       from MoinMoin.util import thread_monitor; thread_monitor.activate_hook()
+      or by requesting URL ...?action=thread_monitor
     * Introduced scope parameter to CacheEntry() - if you specify 'farm', it
       will cache into a common directory for all wikis in the same farm, if you
       specify 'wiki', it will use a cache directory per wiki and if you specify