[Moin-user] Import text file

R.Bauer rb.proj at gmail.com
Tue Nov 11 16:17:15 EST 2008


Olivier Lauret schrieb:
> Hello,
> 
> I'm new with Moimoin and I'm trying to import text files into my wiki
> automatically. I've seen on Internet the following code "
> http://moinmo.in/ScriptMarket/AppendTextScript" but on the following import,
> the RequestCLI isn't valid in my environment:
> 
>    from MoinMoin.request import RequestCLI
> 
> I've replace RequestCLI by request_cli (the only similar python script
> available on my server), but here again I have another error:
> 
>    TypeError: 'module' object is not callable
> 
> when it calls:
> 
>    request = resquest_cli(url=url, pagename=pagename)
> 
> If you know another way to import text file, I'll be happy to try as this
> feature is crutial for the wiki deployement.
> 
> I've installed the lastest wiki version available (1.8.0) using
> ApacheWithModWSGI.
> 
> Any help is welcome.
> 
> Thank you reading the message.
> 
> Regards,
> woody
> 

Hi

How many text files do you like to import?
If only a few files try Action Load (see more action menu)


If you like to do it using a request object you do find lot's of example
on http://moinmo.in/MoinAPI/Beispiele

e.g.
saving content of 'example.txt' on page u'ExamplePage'

from MoinMoin.request import request_cli
request = request_cli.Request()
from MoinMoin.PageEditor import PageEditor
pagename = u'ExamplePage'
page = PageEditor(request, pagename)
text = file('example.txt', 'r').readlines()
try:
    page.saveText(''.join(text), 0)
except page.Unchanged:
    print "You did not change the page content, not saved!"


if you like to use xml-rpc
you do find the example at
http://moinmo.in/MoinAPI/Beispiele#xmlrpc.putPage.28.29

The text can be translated into your language, currently it is written
in german:
http://translate.google.com/translate_t
is your friend

cheers
Reimar




> 
> 
> ------------------------------------------------------------------------
> 
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Moin-user mailing list
> Moin-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/moin-user





More information about the Moin-user mailing list