~ubuntu-branches/ubuntu/natty/moin/natty-updates

« back to all changes in this revision

Viewing changes to MoinMoin/script/xmlrpc/retrieve.py

  • Committer: Bazaar Package Importer
  • Author(s): Jonas Smedegaard
  • Date: 2008-06-22 21:17:13 UTC
  • mfrom: (0.9.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20080622211713-fpo2zrq3s5dfecxg
Tags: 1.7.0-3
Simplify /etc/moin/wikilist format: "USER URL" (drop unneeded middle
CONFIG_DIR that was wrongly advertised as DATA_DIR).  Make
moin-mass-migrate handle both formats and warn about deprecation of
the old one.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# -*- coding: iso-8859-1 -*-
 
2
"""
 
3
MoinMoin - page contents retriever
 
4
 
 
5
@copyright: 2006 MoinMoin:ThomasWaldmann
 
6
@license: GNU GPL, see COPYING for details.
 
7
"""
 
8
 
 
9
import xmlrpclib
 
10
 
 
11
from MoinMoin.script import MoinScript
 
12
 
 
13
class PluginScript(MoinScript):
 
14
    """\
 
15
Purpose:
 
16
========
 
17
This tool allows you to print out the contents of a page via xmlrpc.
 
18
 
 
19
Detailed Instructions:
 
20
======================
 
21
General syntax: moin [options] xmlrpc retrieve [retrieve-options]
 
22
 
 
23
[options] usually should be:
 
24
    --config-dir=/path/to/my/cfg/ --wiki-url=wiki.example.org/
 
25
 
 
26
[retrieve-options] see below:
 
27
    0. To retrieve the page 'FrontPage' from the wiki '192.168.0.1' which is
 
28
       running xmlrpc
 
29
       moin ... xmlrpc retrieve 192.168.0.1 FrontPage
 
30
"""
 
31
 
 
32
    def __init__(self, argv, def_values):
 
33
        MoinScript.__init__(self, argv, def_values)
 
34
        self.argv = argv
 
35
 
 
36
    def mainloop(self):
 
37
        s = xmlrpclib.ServerProxy(self.argv[0])
 
38
        print s.getPage(self.argv[1])