Description
Using the standalone web server, I want to add a moin parser
- I can add TEST.py to my wiki-instance/plugin/parser and nothing happens (even after re-starting the server).
- I can add TEST.py to site-packages/MoinMon/parser and nothing happens.
The solution I discovered (after much annoyance) was to make sure that the .py file had already been compiled into a pyc file (I did this by importing MoinMoin.parser.TEST froma command line python shell).
This may only occur with the standalone server (I haven't tested any others, but I seem to remember similar problems in the past; possibly under Apache: in particular, never being able to put my parser into the wiki-instance, possibly for this exact same reason).
Steps to reproduce
- copy CSV.py to TEST.py in the site-packages/MoinMoin/parser directory
- call both the CSV and TEST parsers
TEST won't work.
now, run python -c "import MoinMoin.parser.TEST"
re-load the wiki-page and TEST will now work.
Example
see above description.
Component selection
parser loading code (ie where it determines which parsers are available) (maybe wikiutil.py:wikiPlugins('parser') which ultimately calls __import__() ?)
Details
MoinMoin Version |
1.5.8 |
OS and Version |
Fedora COre 6 |
Python Version |
2.5 |
Server Setup |
standalone server |
Server Details |
|
Language you are using the wiki in (set in the browser/UserPreferences) |
english |
Workaround
import the module to create a pyc.
Discussion
Reporter - try this:
- Copy new parser module to your wiki/data/plugin/parser/ directory
- Restart standalone server
Edit a page and add a new parser invocation e.g.
{ { {#!foo Text parsed by parser named foo. } } }
- The new parser should work
Note: If you added the parser invocation before the parser was installed, the page is cached using plain text parser, and the new parser will not loaded until the page cache is deleted. To force the page to render and look for the parser, delete the page cache (More Actions > Delete Cache). (see moin maint cleancache for removing all cache files from all pages)
If the problem is different, provide the steps to reproduce it like the steps above.
Plan
- Priority:
- Assigned to:
- Status: