Commits

Gael Pasgrimaud  committed 29f4d5f

fix wiki for moin > 1.9

  • Participants
  • Parent commits 9f9caf8

Comments (0)

Files changed (3)

File buildout.cfg

     RDFAlchemy==0.2b2
     lxml
     pyblosxom
+    moin
     PasteScript
     CouchDB
     formbuild

File shabti/templates/moinmoin/+package+/controllers/wiki.py_tmpl

 from {{package}}.lib.base import BaseController
 from {{package}}.lib.helpers import dcmeta
 
-from MoinMoin.server.server_wsgi import WsgiConfig, moinmoinApp
 import StringIO, urllib
 
 import logging
 import sys, os
 sys.path.insert(0, appconfig['moindir']+'/config')
 
-class Config(WsgiConfig):
-    pass
-
-config = Config() # you MUST create an instance
+try:
+    from MoinMoin.server.server_wsgi import WsgiConfig, moinmoinApp
+except ImportError:
+    from MoinMoin.wsgiapp import application as moinmoinApp
+else:
+    class Config(WsgiConfig):
+        pass
+    config = Config() # you MUST create an instance
 
 class WikiController(BaseController):
     def __before__(self):

File shabti/templates/moinmoin/data/moin/config/wikiconfig.py_tmpl

         
         user = None
         try_next = True # if True, moin tries the next auth method
-        auth_user_id = req.env.get('beaker.session', {}).get('AUTH_USER_ID', 0)
+        # req is a context object in moin 1.9
+        env = getattr(req, 'env', req.request.environ)
+        auth_user_id = env.get('beaker.session', {}).get('AUTH_USER_ID', 0)
         if auth_user_id:
             user_obj = model.Session.query(model.User).get(auth_user_id)
             auth_username = user_obj.username
     # SMTP server, e.g. "mail.provider.com" (None to disable mail)
     #mail_smarthost = ""
 
-    # The return address, e.g u"Jrgen Wiki <noreply@mywiki.org>" [Unicode]
+    # The return address, e.g u"Jürgen Wiki <noreply@mywiki.org>" [Unicode]
     #mail_from = u""
 
     # "user pwd" if you need to use SMTP AUTH