Attachment 'IconLink-1.5.2-0.py'

Download

   1 #-*- coding: utf-8 -*-
   2 """
   3 	MoinMoin - IconLink
   4 
   5 	Usage:
   6 		[[IconLink(icon, href)]]
   7 		href can
   8 		
   9 	Notes:
  10 		debugging messages through creosote, uses a dummy object
  11 		if creosote isn't in site-packages (or elsewhere in $PYTHONPATH)
  12 
  13 	@copyright:	2006 Ryan Volpe
  14 	@license:	BSD
  15 	
  16 	@version history:
  17 		27 March 2006, v.0, Ryan Volpe
  18 			initial code, concept, etc.
  19 """
  20 from MoinMoin.request import config
  21 
  22 try:
  23 	import creosote
  24 except:
  25 	class mockcreosote(object):
  26 		def spew(self, *args, **kws):
  27 			pass
  28 	creosote = mockcreosote()
  29 
  30 
  31 def execute(macro, args):
  32 	argl = args.split(',')
  33 	
  34 	smileys = config.smileys
  35 
  36 	if argl[0] not in smileys:
  37 		creosote.spew('IconLink: %s not in smileys, ignoring macro.' %argl[0])
  38 		return ""
  39 	
  40 	smiley = smileys[argl[0]]
  41 	link = argl[1].strip()
  42 
  43 
  44 	link = ("<a href='%s' title='%s'><img alt='%s' src='/wiki/Xmodern/img/%s' width='%s' height='%s' border='%s' /></a>" %(link, link, link, smiley[3], smiley[0], smiley[1], smiley[2]))
  45 
  46 	return link

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-03-27 09:20:19, 1.0 KB) [[attachment:IconLink-1.5.2-0.py]]
 All files | Selected Files: delete move to page copy to page

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