changeset 2700:a0b85757e5d0

MailTo macro: do fix at right place, cosmetic changes
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 19 Aug 2007 17:17:53 +0200
parents 98f7c5c64e91
children 398af77c7ede
files MoinMoin/macro/__init__.py
diffstat 1 files changed, 6 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/macro/__init__.py	Sun Aug 19 17:01:35 2007 +0200
+++ b/MoinMoin/macro/__init__.py	Sun Aug 19 17:17:53 2007 +0200
@@ -364,7 +364,6 @@
         return self.formatter.anchordef(anchor)
 
     def macro_MailTo(self, email=unicode, text=u''):
-        result = ''
         if not email:
             raise ValueError("You need to give an (obfuscated) email address")
 
@@ -381,11 +380,13 @@
             # just return text as given in macro args
 
             if text:
-                result = self.formatter.text(text+" ")
+                result = self.formatter.text(text + " ")
+            else:
+                result = ''
 
-            result += self.formatter.code(1) + \
-                self.formatter.text("<%s>" % email) + \
-                self.formatter.code(0)
+            result += (self.formatter.code(1) +
+                       self.formatter.text("<%s>" % email) +
+                       self.formatter.code(0))
 
         return result