[Moin-user] best way for script to update wiki page ?

R.Bauer rb.proj at gmail.com
Wed Jan 7 07:53:08 EST 2009


Thomas Arthur Oehser schrieb:
> From: Thomas Waldmann <tw-public at gmx.de>
> 
>>> I do not know about locking features, you may want to ask them in the
>>> IRC / MoinMoinChat.
> 
>> There is no locking. It is the same as when multiple people edit the
>> same page via the web interface: the one who saves last will get a
>> notice about a edit conflict and will have to solve it.
> 
> Hmmm...
> 
> So, the flow in my utility should be:
> 
> 1) Detect what the latest revision is, say, 23
> 1) Read that latest revsion, (say, 23)
> 2) Process it to generate desired revision, say, 24, in /tmp
> 3) Try to mv the entry from /tmp to the data pages directory
> 4) If that fails, then someone else updated it, try again from (1)
> 
> Good?
> 

not good.

You may want to use a xmlrpc script or the command line interface of
moin or you want to use the builtin EmailSupport as you heard from
others already.

you have that script also in your installation
http://hg.moinmo.in/moin/1.8/file/tip/MoinMoin/script/xmlrpc/mailimport.py

You also may be interested in reading
http://moinmo.in/MoinAPI/Beispiele#PageEditor.saveText.28.29

http:/www.google.com/translate_t is your friend

cheers
Reimar


> -Thx
> 
> On Wed, Jan 07, 2009 at 11:27:50AM +0100, Mail at Heavy.ch wrote:
>> Did you already checked out this page (sectionReceiving Mail)?
>> http://moinmo.in/HelpOnConfiguration/EmailSupport
> 
> I don't want moinmoin to receive mail.
> 
> The mail will go Exim => Procmail => Bash => Java or Python.
> 
> This process will not be under the webserver or moinmoin control.
> 
> The Java or Python would be responsible for reading existing pages
> from the data directory, updating them based on fields parsed from
> the email, determining authentication and authorization, etc.; it
> probably would run under the same user ID that the fastcgi/suexec
> is using for moinmoin, though.
> 
> My concern is that if someone edits FooBar on the wiki, and while
> they are messing with it on the screen, the script opens it and
> updates it, that the changes would be overwritten, or that the
> interactive edit session would fail.
> 
> The desired behaviour is for the Java or Python to detect that
> an edit is in process, spawn a sleeper thread, and retry in a
> minute or two, until the online edit is completed.
> 
> -Thanks, -Tom
> 
> --
> "Let us do our duty in our shop or our kitchen, the market, the street, the
> office, the school, the home, just as faithfully as if we stood in the front
> rank of some great battle, and we knew that victory for mankind depended upon
> our bravery, strength, and skill.  When we do that the humblest of us will be
> serving in that great army which achieves the welfare of the world."
>  --Theodore Parker
> 
> ------------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It is the best place to buy or sell services for
> just about anything Open Source.
> http://p.sf.net/sfu/Xq1LFB





More information about the Moin-user mailing list