MoinAPI/exampleについて、ここに記述してください。

$ cd /etc/service/
tmaeno@skr:/etc/service$ ls
axfrdns  dnscache  qmail-start  smtpd  tinydns  wiki
tmaeno@skr:/etc/service$ cd wiki
tmaeno@skr:/etc/service/wiki$ ls
clearcache.sh  gs.py  moin.log  start      wikiconfig.py       wikiconfig.pyc
data           hide   read.py   supervise  wikiconfig.py.0     wikiserver.py
data1          log    run       underlay   wikiconfig.py.moin

tmaeno@skr:/etc/service/wiki$ python2
Python 2.7.17 (default, Feb 27 2021, 15:10:58) 
[GCC 7.5.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from MoinMoin.web.contexts import ScriptContext
2021-04-30 13:59:32,436 INFO MoinMoin.log:151 using logging configuration read from built-in fallback in MoinMoin.log module
2021-04-30 13:59:32,436 INFO MoinMoin.log:157 Running MoinMoin 1.9.11 release code from /usr/local/lib/python2.7/dist-packages/MoinMoin
>>> request = ScriptContext()
2021-04-30 13:59:49,072 INFO MoinMoin.config.multiconfig:127 using wiki config: /home/www-data/mywiki/wikiconfig.py
>>> request.lang = 'de'
>>> _ = request.getText
>>> print _("Mail me my account data")
E-Mail mit den Zugangsdaten senden
>>> pagename = u'StartPage'
>>> print request.user.may.read(pagename)
True
>>> print request.user.may.write(pagename)
False
>>> print Page(request, pagename).exists()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'Page' is not defined
>>> from MoinMoin.Page import Page
>>> print Page(request, pagename).exists()
False
>>> pagename = u'StartPage'
>>> print Page(request, pagename).exists()
False


>>> pagename = u'FrontPage'
>>> print Page(request, pagename).exists()
True
>>> print Page(request, pagename).getRevList()
[1]
>>> print Page(request, pagename).getPagePath()
/home/www-data/mywiki/data/pages/FrontPage
>>> text = Page(request, pagename).get_raw_body()
>>> print text
## Please edit system and help pages ONLY in the master wiki!
## For more information, please see MoinMoin:MoinDev/Translation.
##master-page:FrontPage
#format wiki
#language en
#pragma section-numbers off
= WikiName Wiki =

[[DNS入門]] [[レンタルサーバー]] をどうぞ。-- ToshinoriMaeno <<DateTime(2018-10-22T11:01:36+0900)>>

What is this wiki about?

MoinQ: MoinAPI/example (last edited 2021-04-30 05:22:33 by ToshinoriMaeno)