我能够PageEditor
从这个答案中找到文档。
但是我找不到有关如何构造适当的ScriptContext
对象以PageEditor
作为请求参数传递的信息。
当我尝试在示例中创建 aScriptContext
时,我收到以下错误。
[Fri Mar 11 11:04:42] [root]@[dev] /usr/local/share/moin
# python2.6
Python 2.6.5 (r265:79063, Jun 4 2010, 21:43:07)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-48)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from MoinMoin.web.contexts import ScriptContext
2011-03-11 11:05:01,828 WARNING MoinMoin.log:139 using logging configuration read from built-in fallback in MoinMoin.log
module!
2011-03-11 11:05:02,015 WARNING MoinMoin.log:111 /usr/lib/python2.6/site-packages/MoinMoin/support/pygments/plugin.py:39
: UserWarning: Module site was already imported from /usr/lib/python2.6/site.pyc, but /usr/lib/python2.6/site-packages i
s being added to sys.path
>>> request = ScriptContext()
2011-03-11 11:05:07,495 INFO MoinMoin.config.multiconfig:93 using farm config: /usr/local/share/moin/farmconfig.pyc
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.6/site-packages/MoinMoin/web/contexts.py", line 439, in __init__
wsgiapp.init(self)
File "/usr/lib/python2.6/site-packages/MoinMoin/wsgiapp.py", line 51, in init
context.lang = setup_i18n_preauth(context)
File "/usr/lib/python2.6/site-packages/MoinMoin/wsgiapp.py", line 233, in setup_i18n_preauth
i18n.i18n_init(context)
File "/usr/lib/python2.6/site-packages/MoinMoin/i18n/__init__.py", line 72, in i18n_init
meta_cache = caching.CacheEntry(request, 'i18n', 'meta', scope='wiki', use_pickle=True)
File "/usr/lib/python2.6/site-packages/MoinMoin/caching.py", line 71, in __init__
self.arena_dir = get_arena_dir(request, arena, scope)
File "/usr/lib/python2.6/site-packages/MoinMoin/caching.py", line 32, in get_arena_dir
return os.path.join(request.cfg.cache_dir, request.cfg.siteid, arena)
File "/usr/lib/python2.6/site-packages/MoinMoin/web/contexts.py", line 56, in get
res = obj.environ.setdefault(self.name, factory(obj))
File "/usr/lib/python2.6/site-packages/MoinMoin/web/contexts.py", line 132, in cfg
raise NotFound('<p>No wiki configuration matching the URL found!</p>')
werkzeug.exceptions.NotFound: 404 Not Found
ScriptContext()
使用 wikifarm 配置创建一个魔法咒语是什么?