Attachment 'css-macro.py'

Download

   1 """
   2     CSS macro
   3 
   4     by julian.romero@es.francetelecom.com
   5 """
   6 
   7 import string
   8 from MoinMoin import wikiutil, config, user
   9 
  10 def execute(macro, args):
  11     out = ''
  12     if args==None:
  13         return '<p><strong class="error">La macro CSS necesita una WikiPage como parametro</strong></p>'
  14 
  15     tmp = (args.replace(" ","")+",").split(",")
  16     name = tmp[0]
  17     site = tmp[1]
  18 
  19     if site==None or site=='':
  20         site=''
  21     elif site=='wiki':
  22         site = 'http://wiki.project.ws'
  23     else:
  24         site = 'http://%s.project.ws' % (site)
  25 
  26     out += '<link rel="stylesheet" type="text/css" charset="utf-8" media="all" href="%s/%s?action=css">' % (site, name)
  27     out += "\n"
  28     out += '<link rel="stylesheet" type="text/css" charset="utf-8" media="all" href="%s/%s/%s?action=css">' % (site,name,macro.request.user.theme_name)
  29     out += "\n"
  30     return out

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] (2005-12-10 02:54:33, 2.1 KB) [[attachment:CSV.py]]
  • [get | view] (2006-10-10 10:42:36, 1.1 KB) [[attachment:box.py]]
  • [get | view] (2005-11-21 02:56:09, 0.5 KB) [[attachment:css-action.py]]
  • [get | view] (2005-11-21 02:56:33, 0.8 KB) [[attachment:css-macro.py]]
  • [get | view] (2005-11-13 12:21:38, 0.9 KB) [[attachment:patch-1.5b2-Form.py]]
  • [get | view] (2005-11-13 12:13:19, 0.8 KB) [[attachment:patch-1.5b2-wikiform.py]]
  • [get | view] (2006-05-12 12:59:21, 2.6 KB) [[attachment:todo.py]]
 All files | Selected Files: delete move to page copy to page

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