changeset 845:fcdce5331c6e

merge with main
author Franz Pletz <fpletz AT franz-pletz DOT org>
date Thu, 15 Jun 2006 13:56:27 +0200
parents 399041205773 (current diff) 538bf7495665 (diff)
children 04703997eb66
files MoinMoin/action/tm.py
diffstat 7 files changed, 51 insertions(+), 45 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 13:56:27 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	Thu Jun 15 13:55:02 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/converter/text_html_text_moin_wiki.py	Thu Jun 15 13:55:02 2006 +0200
+++ b/MoinMoin/converter/text_html_text_moin_wiki.py	Thu Jun 15 13:56:27 2006 +0200
@@ -396,13 +396,13 @@
     """ url is a fragment of an URL we extract the pagename from by URL-unqouting
         and possible adding quotes around the pagename if we detect blanks in it.
     """
-    pagename = wikiutil.url_unquote(url_frag)
+    pagename = qpagename = wikiutil.url_unquote(url_frag)
     if " " in pagename:
         if not '"' in pagename:
-            pagename = '"%s"' % pagename
+            qpagename = '"%s"' % pagename
         elif not "'" in pagename:
-            pagename = "'%s'" % pagename
-    return pagename
+            qpagename = "'%s'" % pagename
+    return pagename, qpagename
 
 class ConvertError(error.FatalError):
     """ Raise when html to wiki conversion fails """
@@ -1100,15 +1100,15 @@
                 wikitag, wikiurl, wikitail, err = wikiutil.resolve_wiki(
                     self.request, title + ":")
                 if not err and href.startswith(wikiurl):
-                    pagename = pagename_from_url(href[len(wikiurl):].lstrip('/'))
-                    interwikiname = "%s:%s" % (wikitag, pagename)
+                    pagename, qpagename = pagename_from_url(href[len(wikiurl):].lstrip('/'))
+                    interwikiname = "%s:%s" % (wikitag, qpagename)
                 else: 
                     raise ConvertError("Invalid InterWiki link: '%s'" % href)
             elif class_ == "badinterwiki" and title:
                 if href == "/": # we used this as replacement for empty href
                     href = ""
-                pagename = pagename_from_url(href)
-                interwikiname = "%s:%s" % (title, pagename)
+                pagename, qpagename = pagename_from_url(href)
+                interwikiname = "%s:%s" % (title, qpagename)
             if interwikiname and pagename == text: 
                 self.text.append("%s" % interwikiname)
                 return
@@ -1127,11 +1127,11 @@
 
             # Attachments
             if title and title.startswith("attachment:"):
-                url = wikiutil.url_unquote(title[len("attachment:"):])
-                if url != text:
-                    self.text.append('[attachment:"%s" %s]' % (url, text))
+                attname, qattname = pagename_from_url(title[len("attachment:"):])
+                if attname != text:
+                    self.text.append('[attachment:%s %s]' % (qattname, text))
                 else:
-                    self.text.extend([self.white_space, 'attachment:"%s"' % url, self.white_space])
+                    self.text.extend([self.white_space, 'attachment:%s' % qattname, self.white_space])
             # wiki link
             elif href.startswith(scriptname):
                 pagename = href[len(scriptname):]
--- a/MoinMoin/parser/text_moin_wiki.py	Thu Jun 15 13:55:02 2006 +0200
+++ b/MoinMoin/parser/text_moin_wiki.py	Thu Jun 15 13:56:27 2006 +0200
@@ -188,6 +188,8 @@
         _ = self._
         #self.request.log("attachment: target_and_text %s" % target_and_text)
         scheme, fname, text = wikiutil.split_wiki(target_and_text)
+        if not text:
+            text = fname
 
         if scheme == 'drawing':
             return self.formatter.attachment_drawing(fname, text)
--- a/MoinMoin/request/TWISTED.py	Thu Jun 15 13:55:02 2006 +0200
+++ b/MoinMoin/request/TWISTED.py	Thu Jun 15 13:56:27 2006 +0200
@@ -31,7 +31,6 @@
             self.is_ssl = self.twistd.isSecure()
             self.path_info = '/' + '/'.join([pagename] + self.twistd.postpath)
             self.request_method = self.twistd.method
-            self.remote_host = self.twistd.getClient()
             self.remote_addr = self.twistd.getClientIP()
             self.request_uri = self.twistd.uri
             self.script_name = "/" + '/'.join(self.twistd.prepath[:-1])
--- a/MoinMoin/util/thread_monitor.py	Thu Jun 15 13:55:02 2006 +0200
+++ b/MoinMoin/util/thread_monitor.py	Thu Jun 15 13:56:27 2006 +0200
@@ -80,3 +80,4 @@
             trigger_dump()
     
     threading.Thread(target=background_dumper, args=(seconds, )).start()
+
--- a/docs/CHANGES	Thu Jun 15 13:55:02 2006 +0200
+++ b/docs/CHANGES	Thu Jun 15 13:56:27 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
@@ -146,6 +147,7 @@
     * fixed smiley caching bug (smileys didn't change theme)
     * fixed backtrace when user removed css_url entry from user_form_fields
     * Fixed the output of macro and "attachment:" usages of the rst parser.
+    * Removed Twisted request object reverse DNS lookup
 
   Other changes:
     * we use (again) the same browser compatibility check as FCKeditor uses