changeset 4781:cee722c2097c

Groups2009: wikiconfig_groups.py is used for the groups-related configuration instead of altering wikiconfig.py in _tests.
author Dmitrijs Milajevs <dimazest@gmail.com>
date Wed, 03 Jun 2009 12:10:14 +0200
parents c13bce051efb
children 4634eaf01ed4
files MoinMoin/_tests/wikiconfig.py MoinMoin/_tests/wikiconfig_groups.py docs/CHANGES.dmilajevs
diffstat 3 files changed, 26 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/_tests/wikiconfig.py	Tue Jun 02 14:32:40 2009 +0200
+++ b/MoinMoin/_tests/wikiconfig.py	Wed Jun 03 12:10:14 2009 +0200
@@ -14,10 +14,9 @@
 import os
 
 from MoinMoin.config.multiconfig import DefaultConfig
-from MoinMoin.groups import GroupManager
 
 
-class Config(DefaultConfig):
+class LocalConfig(DefaultConfig):
     sitename = u'Developer Test Wiki'
     logo_string = sitename
 
@@ -25,11 +24,17 @@
     data_dir = os.path.join(_base_dir, "data")
     data_underlay_dir = os.path.join(_base_dir, "underlay")
 
-    group_manager_init = lambda self, request: GroupManager([])
-
     #show_hosts = 1
 
     #secrets = 'some not secret string just to make tests happy'
 
     # used to check if it is really a wiki we may modify
     is_test_wiki = True
+
+try:
+    from wikiconfig_groups import Config
+except ImportError, err:
+    if not str(err).endswith('wikiconfig_groups'):
+        raise
+    Config = LocalConfig
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MoinMoin/_tests/wikiconfig_groups.py	Wed Jun 03 12:10:14 2009 +0200
@@ -0,0 +1,15 @@
+# -*- coding: iso-8859-1 -*-
+"""
+MoinMoin.groups related configuration is defined here.
+
+@copyright: 2009 by MoinMoin:DmitrijsMilajevs
+@license: GNU GPL, see COPYING for details.
+"""
+
+from wikiconfig import LocalConfig
+from MoinMoin.groups import GroupManager
+
+
+class Config(LocalConfig):
+    group_manager_init = lambda self, request: GroupManager([])
+
--- a/docs/CHANGES.dmilajevs	Tue Jun 02 14:32:40 2009 +0200
+++ b/docs/CHANGES.dmilajevs	Wed Jun 03 12:10:14 2009 +0200
@@ -3,5 +3,6 @@
    New features:
    * Group backends. Group definitions can be stored outside of MoinMoin.
    * MoinMoin.security.AccessControlList works with the new GroupManager.
-   * GroupDict became MoinMoin.groups.backends.wiki_pages.Backend
+   * GroupDict became MoinMoin.groups.backends.wiki_pages.Backend.
+   * wikiconfig_groups.py is used for the groups-related configuration.