1. It's me

Mail me at <tfanslau AT gmx DOT de> or look at my Homepage at http://www.tfanslau.de . The Wiki I talk about here should be found by now at http://www.fanslau.org/wiki/moin.py . But be aware that it is all german by now and still under work.

My Provider finally updated to Python 2.3.4 so i could move up to the current Version of MoinMoin. The previous comments on version 1.0 i moved to here. All the other changes i have to verify is they are still necessary with the current version. I'm at least willing to give themes and ACLs a chance :)

2. Changes

It's one of the Charmes of Python that nearly all chances can be made by importing the Module and then replacing/extending the contents with the changes. That way everything can be tried outside the system first.

2.1. PYC-Files

I don't like to put sources online ... and i don't like to waste hosting space on sources that a never change. So i translated all the PY-Files using "compileall" and then deleted the now not needed PY-Files.

In util\pysupport is a helper function "getPackageModules" that scans a directory for Python modules to register them as additional Macros and/or Actions. The regular expression in that looks for *.py files. Since i don't have them anymore i needed to modify that expression

2.1.1. Implementation

I copied the function to "moin.py" and modified the regular expression a little.

   1 pyre = re.compile(r"^([^_].*)\.py[c]?$")

And then inserted the the modified function back into the the "util"-module by

   1 from MoinMoin import util
   2 util.getPackageModules = getPackageModules

That fixes that. A more correct fix would be to scan for all "*.py*"-Files and remove all duplicates.

2.2. Blog- & Comment-Pages

To support them i needed a way to generate Wikipages with unique Names that can be sorted/filtered with a date.

2.2.1. Implementation

There is a function "quoteFilename" in "wikiutil.py" that i copied and modified by adding two lines in top

   1 def myQuoteFilename(filename):
   2     from MoinMoin import wikiutil
   3 
   4     if "*" == filename[-1]:
   5         import time
   6         filename = filename[:-1] +  time.strftime("%Y%m%d%H%M%S", time.gmtime(time.time()))
   7         
   8     return wikiutil.quoteFilename(filename)

Later we need a

   1 from MoinMoin import wikiutil
   2 wikiutil.quoteWikiname = myQuoteFilename

to assign the new converter. This way on each pagename with a "*" at the End, the "*" is replaced by the current Date/Time. So generating a Blog-Page can be done by clicking on a "Blog/*"-Link. And if you want to give people a way to add comments to a page you can add a "/comment/*"-Link on the Page.

2.3. Page-Generation

I do store the HTML-Template-Pages in the Wiki too. I have to check the "send_title"-/"send_footer"-Functions again, but in the old Version the HTML-Template was directly in the MoinMoin-Source. I consider that bad ...

Instead i had stored in Wiki the Template in a Page. This is only the Head as Sample, cause in the old Implementation i had to split Header and Footer up. I considered that bad too, but it was reasonable cause once the header is send, a Error happening during Page-Generatation can just be send. But storing and the HTML in a wiki-page has advantages :

But what i like to implement would be a system like Slashdot uses it's Boxes or the way Blogger defines it's Page Templates. Like this

<div class="box">
    <BloggerArchives>
        <a href='<$BlogArchiveLink$>'><$BlogArchiveName$></a>
    </BloggerArchives>
</div>

2.4. Local Menus

Look here. I defined special Pages starting with a "@" that are normally not shown. One of them is named "@LocalMenu". If that exists, then it is shown as a Menu on the side. In this case the page name is "Blog/Year/2003" and since there are three "@LocalMenu"-Pages one the different Levels

there are three different local menus on the side :) And if you still see the HTML-Template from above, that is put where the "%(Box)"-Variable is inserted :)

/!\ It seems the third Menu is not visible on Opera 7.5 .

My top local Menu looks like that. You can see it's filled with Macros ..

And surely the local Menus can differ per Language.

2.5. Edit Menu

The so called EditMenu in the page "EditMenu" here (it should be called "@EditMenu", but i made a mistake here) is only shown to people that have the Edit-Rights. The "%(Edit)"-Variable from the Template.

MoinMoin: ThomasFanslau (last edited 2007-10-29 19:11:12 by localhost)