Contents
IssueSearch
Description
This is useful for implementing an Issue Tracking system within Moin.
I actually wrote this as a MoinMoin 1.3.5 macro, and just made the minimal changes for it work with 1.7.2 without throwing a python exception. Patches for any remaining stupidities gratefully received!
Download & Release Notes
Download |
Release Version |
Moin Version |
Release Notes |
1.1 |
1.7.2 |
Includes TicketVariable.patch and issuesearch.py action |
Installation
There are 3 files in the tarball:
A new macro, IssueSeach.py, to install in your instance's plugin/macros directory.
A new action, issuesearch.py, to install in your instance's plugin/actions directory.
A patch, TicketVariable.patch, which you should apply to PageEditor.py in the installed Python MoinMoin tree.
Usage
Instructions are in the source. But briefly:
Create templates for any issue types you want to collect, and include Issue || @TICKET``@ or similar in each template. When used to create a new page proper, the @TICKET``@ is expanded to the next unused issue number.
<<IssueSearch>> will display a search box in the page to retrieve issues by number, or with a regex search string. The search itself requires that you also install issuesearch.py as a backend to run the issuesearch action.
<<IssueSearch(query-string)>> builds an inline numbered list of matching issues, like <<FullSearch(query-string)>>, only using the issue number for each list item, so that you can put one of the numbers into the search box (created by <<IssueSearch>> with no arguments) and jump directly to that issue's page.
Example
http://gary.vaughan.pe/wiki/GnuLibtoolProject/BugReports
Known Problems
Since the monotonically increasing number inserted each time @TICKET@ is expanded is pickled to the cache, it doesn't know if you go behind it's back and create your own tickets. The workaround is easy enough if you do end up with duplicates though:
- First, in the wiki, correct the issue numbers of any duplicates to be unique.
Next change the line in the patched PageEditor.py file that says self.ticket_no = 0 to be the highest numbered used issue number (say self.ticket_no = 53).
And, finally, remove the cache file from $WIKIINSTANCEDIR/data/cache/PageEditor/variables (restarting any running Moin fcgi's or pythons).
Copyright
License
GPL v2+
Bugs
None that I know of!
Discussion
This sounds like a really useful feature, but how do I apply the patch? It's probably a really dumb question but I'm a complete MoinMoin beginner and can't find the answer anywhere? -- AndyFerris 2008-10-26 11:21:34
Thanks. Applying a patch is a matter of being in the correct directory (in this case, the directory that contains PageEditor.py, which depends on how you installed Moin: mine is in $HOME/fsw/moin/lib/python2.4/site-packages/MoinMoin) and running the patch command. Adjust the paths to match your installation:
$ cd /path/to/packages/MoinMoin $ patch -p0 < /path/to/TicketVariable.patch
If you're running on Windows, I have no clue. Sorry! -- GaryVaughan 2008-10-26 11:43:10
Thanks for such a pronpt reply. Unfortunately I am using windows (don't laugh...) I have just found the answer. Use cygwin and follow the instructions above. I'm using Vista and this seems to really mess around with the file permissions, so you will have to modify these from explorer. Make sure you restart MoinMoin to recompile the changes made. -- AndyFerris 2008-10-26 13:01:44