Hello,

A few days ago, I open a thread asking how to import the content of a text
file into a MoinMoin page. I had some answers which really helped me a lot.
Here is the quick summary of the script that I used:

******************
import sys
sys.path.insert(0, '/usr/local/lib/python2.5/site-packages')
sys.path.insert(0, '/opt/mywiki/')
sys.path.insert(0, '/usr/local/lib/python2.5/site-packages/MoinMoin')

import urllib, sgmllib, re
from MoinMoin.request.request_cli import Request
from MoinMoin.user import get_by_email_address

from MoinMoin.PageEditor import PageEditor
from xml.dom import minidom as dom

pagen = 'testpage3'
textContent = "This is a automated test page."
emailad = "[EMAIL PROTECTED]"


request = Request(url = 'localhost/mywiki', pagename = pagen)
p = PageEditor(request, pagen)
try:
    p.saveText(textContent, 0)
except PageEditor.SaveError, e:
    print "Got %r" % (e, )
**********************

However, when I run this script, the page was created but instead of seeing
the page, I was getting the following error inteh browser:

   IOError: [Errno 13] Permission denied:
'/opt/mywiki/data/pages/testpage3/revisions/99999999'

I found out why I had this error: I was running the script under root (cmd:
"python myscript.py") and it was creating some files into MoinMoin havingn
root as the owner. Therefore, the browser which was using the apache user
couldn't have access to it.

Solution: run the script under the apache user (cmd: sudo -u apache python
myscript.py). You might need to replace apache by the user used by your
httpd server such as www-data.

Thank you Dylan and Reimar.

Regards,
Olivier
-------------------------------------------------------------------------
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@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/moin-user

Reply via email to