to the generic farmconfig module, so that it is properly shared across
instances.
-# This is a template to instantiate a wiki for a given project
-# The only parameter is the project name which should correspond
-# to the unix_group_name associated with the project in the forge
+# This is the MoinMoin configuration for @PROJECT_NAME@
from farmconfig import FarmConfig
from farmconfig import FarmConfig
class Config(FarmConfig):
class Config(FarmConfig):
- project_name = "@PROJECT_NAME@"
- # Substituted by create-wikis.php
-
- sitename = u'%s' % project_name
- interwikiname = u'%s' % project_name
- page_front_page = u'FrontPage'
-
- data_dir = '/var/lib/gforge/plugins/moinmoin/wikidata/%s/data' % project_name
- data_underlay_dir = '/var/lib/gforge/plugins/moinmoin/wikidata/%s/underlay' % project_name
-
- ffsa = fusionforge.FusionForgeSessionAuth()
- acl_rights_default = ffsa.get_moinmoin_acl_string(project_name)
-
class FarmConfig(multiconfig.DefaultConfig):
class FarmConfig(multiconfig.DefaultConfig):
- # basic options (you normally need to change these)
- sitename = u'ForgeWiki' # [Unicode]
- interwikiname = u'ForgeWiki' # [Unicode]
page_front_page = u"FrontPage"
page_front_page = u"FrontPage"
+ theme_default = 'mentalwealth'
ffsa = fusionforge.FusionForgeSessionAuth()
ff_host = fusionforge.FusionForgeLink().get_config('web_host')
auth = [ffsa]
ffsa = fusionforge.FusionForgeSessionAuth()
ff_host = fusionforge.FusionForgeLink().get_config('web_host')
auth = [ffsa]
- theme_default = 'mentalwealth'
+
+ # Defaults (overridden per project)
+
+ sitename = u'ForgeWiki' # [Unicode]
+ interwikiname = u'ForgeWiki' # [Unicode]
acl_rights_default = \
string.join (map (lambda u: u+":read,write,delete,revert,admin",
ffsa.admins)
+ ["All:"])
acl_rights_default = \
string.join (map (lambda u: u+":read,write,delete,revert,admin",
ffsa.admins)
+ ["All:"])
+ def __init__(self, project_name):
+ self.project_name = project_name
+ self.sitename = u'%s' % project_name
+ self.interwikiname = u'%s' % project_name
+ self.data_dir = '/var/lib/gforge/plugins/moinmoin/wikidata/%s/data' % project_name
+ self.data_underlay_dir = '/var/lib/gforge/plugins/moinmoin/wikidata/%s/underlay' % project_name
+
+ self.acl_rights_default = self.ffsa.get_moinmoin_acl_string(project_name)
+
+ # Call inherited constructor once instance specific variables
+ # have been set.
+
+ multiconfig.DefaultConfig.__init__(self, project_name)
+
def groups (self, request):
from MoinMoin.datastruct import WikiGroups, CompositeGroups
from ff_groups import FFLazyGroups
def groups (self, request):
from MoinMoin.datastruct import WikiGroups, CompositeGroups
from ff_groups import FFLazyGroups