Allowing many URL for a wiki instance

In my opinion, the "wikis" variable in farmconfig.py is backwards. I would expect the following to "Just Work":

wikis = [
    # wikiname,     url regular expression (no protocol)
    # Standalone server needs the port e.g. localhost:8000
    # Twisted server can now use the port, too.
    ("koumbitwiki",    r"^wiki.koumbit.net/.*$"),
    ("testwiki",    r"^wikifarm.koumbit.net/testwiki.*$"),
    ("wikifarm",    r"^wikifarm.koumbit.net/.*$"),
    ("wikifarm",    r"^wikifarm.koumbit.net/wikifarm.*$"),
]

... so that I wouldn't have to mess around with complicated regexp to allow many urls per wiki. Right now, the following barks madly at me:

[Thu Dec 22 19:34:40 2005] [error] [client 72.0.72.144] FastCGI: incomplete headers (0 bytes) received from server "/usr/local/www/wiki/wikifarm/bin/moin.fcg"
Unhandled exception in thread started by
Traceback (most recent call last):
  File "/usr/local/lib/python2.4/site-packages/MoinMoin/support/thfcgi.py", line 520, in accept_handler
    req.run()
  File "/usr/local/lib/python2.4/site-packages/MoinMoin/support/thfcgi.py", line 275, in run
    self._handle_record(rec)
  File "/usr/local/lib/python2.4/site-packages/MoinMoin/support/thfcgi.py", line 373, in _handle_record
    self._handle_app_record(rec)
  File "/usr/local/lib/python2.4/site-packages/MoinMoin/support/thfcgi.py", line 444, in _handle_app_record
    self.req_handler(self, self.env, self.getFieldStorage())
  File "/usr/local/www/wiki/wikifarm/bin/moin.fcg", line 44, in handle_request
    request = RequestFastCGI(req, env, form)
  File "/usr/local/lib/python2.4/site-packages/MoinMoin/request.py", line 1869, in __init__
    self._setup_vars_from_std_env(env)
  File "/usr/local/lib/python2.4/site-packages/MoinMoin/request.py", line 282, in _setup_vars_from_std_env
    self._load_multi_cfg()
  File "/usr/local/lib/python2.4/site-packages/MoinMoin/request.py", line 163, in _load_multi_cfg
    self.cfg = multiconfig.getConfig(self.url)
  File "/usr/local/lib/python2.4/site-packages/MoinMoin/multiconfig.py", line 58, in getConfig
    match = url_re().match(url)
  File "/usr/local/lib/python2.4/site-packages/MoinMoin/multiconfig.py", line 36, in url_re
    _url_re = re.compile(pattern)
  File "/usr/local/lib/python2.4/sre.py", line 180, in compile
    return _compile(pattern, flags)
  File "/usr/local/lib/python2.4/sre.py", line 227, in _compile
    raise error, v # invalid expression
sre_constants.error: redefinition of group name 'wikifarm' as group 5; was group 4

I know that I can simply use a complex regexp to workaround this, but it seems to me that it would be much simpler to just reverse the mapping so to make it "url -> wikiname".

Just a tought... -- TheAnarcat 2005-12-23 00:46:00


CategoryFeatureRequest

MoinMoin: FeatureRequests/ReverseWikiFarmMapping (last edited 2007-10-29 19:13:48 by localhost)