comparison MoinMoin/formatter/text_html.py @ 5102:9ae242080889

drawings/attachments: made editing support more generic (details see below) refactored AttachFile.getAttachUrl: * removed drawing param * it detects drawings now from the filename's extension (e.g. .adraw for the anywikidraw container and .tdraw for the twikidraw container) * it returns None now, if the combination of filename (extension) and do=something is not supported AttachFile.get_action looks up the action (module name) for specific combinations of filenames (extension) and do=subaction. info/history and AttachFile filelist action: Less hardcoded drawing support, it now just tries to get a do=modify URL for every file attachment. If that works, there will be an edit link for that attachment. action.anywikidraw and action.twikidraw: * they get the full container filename now and also use them in UI * they call do=modify to invoke the drawing applet multiconfig: removed drawing_action text_moin_wiki parser: use wikiutil.drawing2fname to process the given drawing name. if it looks like fully qualified (e.g. foo.tdraw, foo.adraw, foo.svg, foo.png, ...), then keep it. otherwise (e.g. foo, foo.bar, ...) append .tdraw as default drawing filename extension to be backwards compatible.
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 13 Sep 2009 16:01:09 +0200
parents ff588e9e24d6
children 12d27670e274
comparison
equal deleted inserted replaced
5101:d8ccac2f24c5 5102:9ae242080889
653 return self.url(1, target, css=css, title=title) + img + self.url(0) 653 return self.url(1, target, css=css, title=title) + img + self.url(0)
654 654
655 def attachment_drawing(self, url, text, **kw): 655 def attachment_drawing(self, url, text, **kw):
656 # ToDo try to move this to a better place e.g. __init__ 656 # ToDo try to move this to a better place e.g. __init__
657 try: 657 try:
658 drawing_action = AttachFile.get_action(self.request, url, do='modify')
659 assert drawing_action is not None
658 attachment_drawing = wikiutil.importPlugin(self.request.cfg, 'action', 660 attachment_drawing = wikiutil.importPlugin(self.request.cfg, 'action',
659 self.request.cfg.drawing_action, 'attachment_drawing') 661 drawing_action, 'attachment_drawing')
660 return attachment_drawing(self, url, text, **kw) 662 return attachment_drawing(self, url, text, **kw)
661 except (wikiutil.PluginMissingError, wikiutil.PluginAttributeError): 663 except (wikiutil.PluginMissingError, wikiutil.PluginAttributeError, AssertionError):
662 return url 664 return url
663 665
664 # Text ############################################################## 666 # Text ##############################################################
665 667
666 def _text(self, text): 668 def _text(self, text):