summaryrefslogtreecommitdiff
path: root/doc
  • #!/usr/bin/python
  • # -*- coding: utf-8 -*-
  • #
  • # pythondemo — demo Python ikiwiki plugin
  • #
  • # Copyright © martin f. krafft <madduck@madduck.net>
  • # Released under the terms of the GNU GPL version 2
  • #
  • __name__ = 'pythondemo'
  • __description__ = 'demo Python ikiwiki plugin'
  • __version__ = '0.1'
  • __author__ = 'martin f. krafft <madduck@madduck.net>'
  • __copyright__ = 'Copyright © ' + __author__
  • __licence__ = 'GPLv2'
  • from proxy import IkiWikiProcedureProxy
  • import sys
  • def debug(s):
  • sys.stderr.write(__name__ + ':DEBUG:%s\n' % s)
  • sys.stderr.flush()
  • proxy = IkiWikiProcedureProxy(__name__, debug_fn=None)
  • def _arglist_to_dict(args):
  • if len(args) % 2 != 0:
  • raise ValueError, 'odd number of arguments, cannot convert to dict'
  • return dict([args[i:i+2] for i in xrange(0, len(args), 2)])
  • def getopt_demo(proxy, *args):
  • # This allows for plugins to perform their own processing of command-line
  • # options and so add options to the ikiwiki command line. It's called
  • # during command line processing, with @ARGV full of any options that
  • # ikiwiki was not able to process on its own. The function should process
  • # any options it can, removing them from @ARGV, and probably recording the
  • # configuration settings i