changeset 4675:2b7e69ce6a05

merged moin/1.8
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Wed, 01 Apr 2009 18:42:59 +0200
parents 06a744121699 (current diff) 0946442e94ab (diff)
children e17387246649
files MoinMoin/macro/TableOfContents.py MoinMoin/wikiutil.py
diffstat 4 files changed, 19 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/config/__init__.py	Mon Mar 30 00:07:59 2009 +0200
+++ b/MoinMoin/config/__init__.py	Wed Apr 01 18:42:59 2009 +0200
@@ -74,7 +74,7 @@
 # Other stuff
 url_schemas = ['http', 'https', 'ftp', 'file',
                'mailto', 'nntp', 'news',
-               'ssh', 'telnet', 'irc', 'ircs', 'xmpp',
+               'ssh', 'telnet', 'irc', 'ircs', 'xmpp', 'mumble',
                'webcal', 'ed2k', 'rootz',
                'notes',
               ]
--- a/MoinMoin/macro/TableOfContents.py	Mon Mar 30 00:07:59 2009 +0200
+++ b/MoinMoin/macro/TableOfContents.py	Wed Apr 01 18:42:59 2009 +0200
@@ -137,6 +137,11 @@
 
  maxdepth:: maximum depth the table of contents is generated for (defaults to unlimited)
     """
+    try:
+        mindepth = int(macro.request.getPragma('section-numbers', 1))
+    except (ValueError, TypeError):
+        mindepth = 1
+
     if maxdepth is None:
         maxdepth = 99
 
@@ -176,7 +181,7 @@
         if txt is None:
             incl_id = id
             continue
-        if lvl > maxdepth or id is None:
+        if lvl < mindepth or lvl > maxdepth or id is None:
             continue
         if lvl < lastlvl:
             lastlvl = lvl
@@ -188,7 +193,7 @@
         if txt is None:
             incl_id = id
             continue
-        if lvl > maxdepth or id is None:
+        if lvl < mindepth or lvl > maxdepth or id is None:
             continue
 
         # will be reset by pop_unique_ids below
--- a/MoinMoin/support/xapwrap/index.py	Mon Mar 30 00:07:59 2009 +0200
+++ b/MoinMoin/support/xapwrap/index.py	Wed Apr 01 18:42:59 2009 +0200
@@ -118,7 +118,12 @@
 future version will.
 
 """
-import cPickle, sets, glob, os
+try:
+    set
+except:
+    from sets import Set as set
+
+import cPickle, glob, os
 import xapian
 from document import makePairForWrite, StandardAnalyzer, Document, SortKey, Keyword
 from document import UNICODE_ENCODING, UNICODE_ERROR_POLICY
@@ -973,8 +978,8 @@
             raise InvalidArgumentError(
                 "document UIDs must be greater than one when using SmartIndex")
 
-        docSortKeys = sets.Set([sk.name for sk in doc.sortFields if sk.name is not None])
-        indexSortKeys = sets.Set(self.indexValueMap.keys())
+        docSortKeys = set([sk.name for sk in doc.sortFields if sk.name is not None])
+        indexSortKeys = set(self.indexValueMap.keys())
         if not docSortKeys.issubset(indexSortKeys):
             nextValueIndex = 1 + max(self.indexValueMap.itervalues())
             # we sort the sortKeys in order to improve the odds that two
@@ -992,9 +997,9 @@
                     nextValueIndex += 2
             self.saveState()
 
-        docKeywords = sets.Set([tf.name for tf in doc.textFields if tf.prefix] +
+        docKeywords = set([tf.name for tf in doc.textFields if tf.prefix] +
                                [kw.name for kw in doc.keywords])
-        indexKeyWords = sets.Set(self.prefixMap.keys())
+        indexKeyWords = set(self.prefixMap.keys())
         if not docKeywords.issubset(indexKeyWords):
             for k in docKeywords - indexKeyWords:
                 self.prefixMap[k] = k.upper()
--- a/MoinMoin/wikiutil.py	Mon Mar 30 00:07:59 2009 +0200
+++ b/MoinMoin/wikiutil.py	Wed Apr 01 18:42:59 2009 +0200
@@ -858,6 +858,7 @@
  '.cfg': 'text/plain',
  '.conf': 'text/plain',
  '.irc': 'text/plain',
+ '.md5': 'text/plain',
 }
 [mimetypes.add_type(mimetype, ext, True) for ext, mimetype in MIMETYPES_MORE.items()]