changeset 1738:7ac15b5e2db8

text_gedit formatter, ImageLink: minor optimizations
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sat, 13 Jan 2007 23:32:55 +0100
parents fa04be6b7ea4
children aef7aa0effc3
files MoinMoin/formatter/text_gedit.py
diffstat 1 files changed, 3 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/formatter/text_gedit.py	Sat Jan 13 21:55:21 2007 +0100
+++ b/MoinMoin/formatter/text_gedit.py	Sat Jan 13 23:32:55 2007 +0100
@@ -121,18 +121,17 @@
                 else:
                     if pos == 0 and arg:
                         url = arg
-                        if url.startswith('http'):
+                        if url.startswith('http:'):
                             kw['src'] = url
                         else:
                             kw['title'] = "attachment:%s" % wikiutil.quoteWikinameURL(url)
                     elif pos == 1 and arg:
                         kw['target'] = arg
                     pos += 1
-            if not kw['src']:
+            if kw['src'] is None:
                 if '/' in url:
                     pagename, target = AttachFile.absoluteName(url, pagename)
-                    url = url.split('/')
-                    url = url[len(url)-1]
+                    url = url.split('/')[-1]
                 kw['src'] = AttachFile.getAttachUrl(pagename, url, self.request, addts=1)
             return self.image(**kw)