Back to index

moin  1.9.0~rc2
retrieve.py
Go to the documentation of this file.
00001 # -*- coding: iso-8859-1 -*-
00002 """
00003 MoinMoin - page contents retriever
00004 
00005 @copyright: 2006 MoinMoin:ThomasWaldmann
00006 @license: GNU GPL, see COPYING for details.
00007 """
00008 
00009 import xmlrpclib
00010 
00011 from MoinMoin.script import MoinScript
00012 
00013 class PluginScript(MoinScript):
00014     """\
00015 Purpose:
00016 ========
00017 This tool allows you to print out the contents of a page via xmlrpc.
00018 
00019 Detailed Instructions:
00020 ======================
00021 General syntax: moin [options] xmlrpc retrieve [retrieve-options]
00022 
00023 [options] usually should be:
00024     --config-dir=/path/to/my/cfg/ --wiki-url=wiki.example.org/
00025 
00026 [retrieve-options] see below:
00027     0. To retrieve the page 'FrontPage' from the wiki '192.168.0.1' which is
00028        running xmlrpc
00029        moin ... xmlrpc retrieve 192.168.0.1 FrontPage
00030 """
00031 
00032     def __init__(self, argv, def_values):
00033         MoinScript.__init__(self, argv, def_values)
00034         self.argv = argv
00035 
00036     def mainloop(self):
00037         s = xmlrpclib.ServerProxy(self.argv[0])
00038         print s.getPage(self.argv[1])