Attachment 'WikiList-1.0.py'

Download

   1 # -*- coding: iso-8859-1 -*-
   2 """
   3     MoinMoin - WikiList macro
   4 
   5     This macro produces a definition list of the wikis hosted in the farm.
   6 
   7     @copyright: 2006 by The Anarcat <anarcat@anarcat.ath.cx>
   8     @license: GNU GPL, see COPYING for details.
   9 """
  10 
  11 Dependencies = []
  12 
  13 def execute(macro, args):
  14     from farmconfig import wikis
  15     output = ""
  16     output += macro.formatter.definition_list(1)
  17     for wiki in wikis:
  18         name = wiki[0]
  19         url = wiki[1]
  20         mod = getattr(__import__(name), 'Config')
  21         output += macro.formatter.definition_term(1)
  22         output += macro.formatter.text(name)
  23         output += macro.formatter.definition_term(0)
  24         output += macro.formatter.definition_desc(1)
  25         output += macro.formatter.text(getattr(mod, 'sitename') + " " + url)
  26         output += macro.formatter.definition_desc(0)
  27 
  28     output += macro.formatter.definition_list(0)
  29     return output

Attached Files

To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.
  • [get | view] (2006-09-22 21:56:53, 0.9 KB) [[attachment:WikiList-1.0.py]]
  • [get | view] (2006-09-22 23:00:05, 1.6 KB) [[attachment:WikiList-1.1.py]]
  • [get | view] (2007-11-09 18:42:22, 1.6 KB) [[attachment:WikiList-1.2.py]]
 All files | Selected Files: delete move to page copy to page

You are not allowed to attach a file to this page.