Attachment 'LoginHint-1.6.py'

Download

   1 # -*- coding: utf-8 -*-
   2 """
   3     MoinMoin - LoginHint
   4 
   5     Usage:
   6         <<LoginHint(Please login using the link at the top border!)>>
   7 
   8     @copyright: 2006 Thomas Waldmann
   9     @license: GNU GPL, see COPYING for details
  10 
  11     changes:
  12         12.2007 - conversion to new syntax by Bolesław Kulbabiński
  13 """
  14 hint_style = "background-color: orange; text-align: center;"
  15 
  16 from MoinMoin import wikiutil
  17 
  18 def macro_LoginHint(macro, hint_text=u'Please login using the link at the top border!'):
  19     if macro.request.user.valid:
  20         return ''
  21     f = macro.request.formatter
  22     return (f.div(1, id="LoginHint", style=hint_style) +
  23             f.text(hint_text) +
  24             f.div(0))
  25 
  26 
  27 def execute(macro, args):
  28     try:
  29         return wikiutil.invoke_extension_function(
  30                    macro.request, macro_LoginHint,
  31                    args, [macro])
  32     except ValueError, err:
  33         return macro.request.formatter.text(
  34                    "<<LoginHint: %s>>" % err.args[0])

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] (2007-12-22 21:21:35, 1.0 KB) [[attachment:LoginHint-1.6.py]]
  • [get | view] (2006-03-06 18:09:04, 0.5 KB) [[attachment:LoginHint.py]]
 All files | Selected Files: delete move to page copy to page

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