changeset 763:f06e9d502d6c

merged
author Michael Mayorov <marchael@kb.csu.ru>
date Sun, 21 Aug 2011 23:31:52 +0000
parents 25e07ced506f (current diff) ad338b37458c (diff)
children 3a042c4b99ee
files
diffstat 7 files changed, 29 insertions(+), 30 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/storage/backends/__init__.py	Sun Aug 21 23:27:21 2011 +0000
+++ b/MoinMoin/storage/backends/__init__.py	Sun Aug 21 23:31:52 2011 +0000
@@ -105,7 +105,7 @@
                         (ns_user_profile, userprofile, user_profile_acl),
                         (ns_content, content, content_acl),
         ]
-        return namespace_mapping, 'sqlite://'
+        return namespace_mapping
 
     else:
         raise ConfigurationError("No proper backend uri provided. Given: %r" % backend_uri)
--- a/MoinMoin/storage/backends/fs19.py	Sun Aug 21 23:27:21 2011 +0000
+++ b/MoinMoin/storage/backends/fs19.py	Sun Aug 21 23:31:52 2011 +0000
@@ -729,7 +729,7 @@
         metadata[MTIME] = int(float(metadata.get('last_saved', '0')))
 
         # rename subscribed_pages to subscribed_items
-        metadata['subscribed_items'] = metadata['subscribed_pages']
+        metadata['subscribed_items'] = metadata.get('subscribed_pages', [])
 
         # convert bookmarks from usecs (and str) to secs (int)
         metadata['bookmarks'] = [(interwiki, int(long(bookmark)/1000000))
--- a/MoinMoin/user.py	Sun Aug 21 23:27:21 2011 +0000
+++ b/MoinMoin/user.py	Sun Aug 21 23:31:52 2011 +0000
@@ -30,7 +30,7 @@
 
 from MoinMoin import config, wikiutil
 from MoinMoin.i18n import _, L_, N_
-from MoinMoin.util.interwiki import getInterwikiHome, is_local_wiki
+from MoinMoin.util.interwiki import getInterwikiHome, getInterwikiName, is_local_wiki
 from MoinMoin.util.crypto import crypt_password, upgrade_password, valid_password, \
                                  generate_token, valid_token
 
@@ -520,7 +520,7 @@
         # Create a new list with both names and interwiki names.
         pages = pagelist[:]
         if self._cfg.interwikiname:
-            pages += [self._interWikiName(pagename) for pagename in pagelist]
+            pages += [getInterwikiName(pagename) for pagename in pagelist]
         # Create text for regular expression search
         text = '\n'.join(pages)
 
@@ -550,7 +550,7 @@
         :returns: if page was subscribed
         """
         if self._cfg.interwikiname:
-            pagename = self._interWikiName(pagename)
+            pagename = getInterwikiName(pagename)
 
         if pagename not in self.subscribed_items:
             self.subscribed_items.append(pagename)
@@ -585,7 +585,7 @@
             self.subscribed_items.remove(pagename)
             changed = True
 
-        interWikiName = self._interWikiName(pagename)
+        interWikiName = getInterwikiName(pagename)
         if interWikiName and interWikiName in self.subscribed_items:
             self.subscribed_items.remove(interWikiName)
             changed = True
@@ -618,7 +618,7 @@
         for pagename in pagelist:
             if pagename in self.quicklinks:
                 return True
-            interWikiName = self._interWikiName(pagename)
+            interWikiName = getInterwikiName(pagename)
             if interWikiName and interWikiName in self.quicklinks:
                 return True
 
@@ -636,7 +636,7 @@
         :returns: if pagename was added
         """
         changed = False
-        interWikiName = self._interWikiName(pagename)
+        interWikiName = getInterwikiName(pagename)
         if interWikiName:
             if pagename in self.quicklinks:
                 self.quicklinks.remove(pagename)
@@ -664,7 +664,7 @@
         :returns: if pagename was removed
         """
         changed = False
-        interWikiName = self._interWikiName(pagename)
+        interWikiName = getInterwikiName(pagename)
         if interWikiName and interWikiName in self.quicklinks:
             self.quicklinks.remove(interWikiName)
             changed = True
@@ -676,17 +676,6 @@
             self.save()
         return changed
 
-    def _interWikiName(self, pagename):
-        """ Return the inter wiki name of a page name
-
-        :param pagename: page name
-        :type pagename: unicode
-        """
-        if not self._cfg.interwikiname:
-            return None
-
-        return "%s:%s" % (self._cfg.interwikiname, pagename)
-
     # -----------------------------------------------------------------
     # Trail
 
@@ -697,7 +686,7 @@
         """
         # Save interwiki links internally
         if self._cfg.interwikiname:
-            item_name = self._interWikiName(item_name)
+            item_name = getInterwikiName(item_name)
         trail_in_session = session.get('trail', [])
         trail = trail_in_session[:]
         trail = [i for i in trail if i != item_name] # avoid dupes
--- a/MoinMoin/util/interwiki.py	Sun Aug 21 23:27:21 2011 +0000
+++ b/MoinMoin/util/interwiki.py	Sun Aug 21 23:31:52 2011 +0000
@@ -122,6 +122,19 @@
         return wikiurl + wikitail
 
 
+def getInterwikiName(self, item_name):
+    """
+    Get the (fully qualified) interwiki name of a local item name.
+
+    :param item_ame: item name (unicode)
+    :rtype: unicode
+    :returns: wiki_name:item_name
+    """
+    wiki_name = app.cfg.interwikiname
+    if wiki_name:
+        return "%s:%s" % (wiki_name, item_name)
+
+
 def getInterwikiHome(username):
     """
     Get a user's homepage.
--- a/docs/admin/configure.rst	Sun Aug 21 23:27:21 2011 +0000
+++ b/docs/admin/configure.rst	Sun Aug 21 23:31:52 2011 +0000
@@ -941,7 +941,7 @@
 
     from MoinMoin.storage.backends import create_simple_mapping
 
-    namespace_mapping, router_index_uri = create_simple_mapping(
+    namespace_mapping = create_simple_mapping(
         backend_uri=...,
         content_acl=dict(before=...,
                          default=...,
@@ -1020,7 +1020,7 @@
     from MoinMoin.storage.backends import create_simple_mapping
 
     data_dir = '/srv/mywiki/data'
-    namespace_mapping, router_index_uri = create_simple_mapping(
+    namespace_mapping = create_simple_mapping(
         backend_uri='fs2:%s/%%(nsname)s' % data_dir,
         content_acl=dict(before=u'WikiAdmin:read,write,create,destroy',
                          default=u'All:read,write,create',
--- a/docs/admin/requirements.rst	Sun Aug 21 23:27:21 2011 +0000
+++ b/docs/admin/requirements.rst	Sun Aug 21 23:31:52 2011 +0000
@@ -3,13 +3,10 @@
 ============
 
 MoinMoin requires Python >= 2.6 and < 3.0.
-
-Python build options (in case you have to build your own Python):
+We usually test using CPython and this is what we recommend.
 
-* zlib support (required)
-* ucs4 (32bit unicode, recommended)
-* ucs2 also works for most users (not recommended)
-
+You can also try PyPy - PyPy >= 1.6 seems to work OK with moin.
+Hint: modify the quickinstall script so it uses PYTHON=pypy.
 
 Servers
 =======
--- a/docs/admin/upgrade.rst	Sun Aug 21 23:27:21 2011 +0000
+++ b/docs/admin/upgrade.rst	Sun Aug 21 23:31:52 2011 +0000
@@ -67,7 +67,7 @@
     # XXX default_markup must be 'wiki' right now
     page_category_regex = ... # XXX check
     data_dir = ... # same as in 1.9, user profiles must be in data_dir/user
-    namespace_mapping, router_index_uri = \
+    namespace_mapping = \
         create_simple_mapping(
             backend_uri='fs19:%s' % data_dir,
             content_acl=dict(before=u'', # acl_rights_before in 1.9