changeset 3263:d0ffd7c45145

UnitArgument: allow None as default (passed straight through)
author Johannes Berg <johannes AT sipsolutions DOT net>
date Sun, 16 Mar 2008 15:50:40 +0100
parents e30816db5cb5
children cd28d66afe11
files MoinMoin/wikiutil.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/wikiutil.py	Sun Mar 16 11:04:39 2008 +0100
+++ b/MoinMoin/wikiutil.py	Sun Mar 16 15:50:40 2008 +0100
@@ -1619,7 +1619,10 @@
         self._units = list(units)
         self._units.sort(cmp=lambda x, y: len(y) - len(x))
         self._type = argtype
-        self._default = self.parse_argument(default)
+        if default is not None:
+            self._default = self.parse_argument(default)
+        else:
+            self._default = None
 
     def parse_argument(self, s):
         for unit in self._units: