changeset 132:d27737be7871

fix crash in link converter when link scheme is None. implement IriPath.__repr__.
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sat, 19 Mar 2011 19:12:53 +0100
parents 6a60c384e578
children d1da81a823ac
files MoinMoin/converter/link.py MoinMoin/util/iri.py
diffstat 2 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/converter/link.py	Sat Mar 19 18:42:29 2011 +0100
+++ b/MoinMoin/converter/link.py	Sat Mar 19 19:12:53 2011 +0100
@@ -64,7 +64,7 @@
                 self.handle_wikilocal_links(elem, xlink_href, page)
             elif xlink_href.scheme == 'wiki':
                 self.handle_wiki_links(elem, xlink_href)
-            else:
+            elif xlink_href.scheme:
                 elem.set(html.class_, 'moin-' + xlink_href.scheme)
 
         elif xinclude_href:
--- a/MoinMoin/util/iri.py	Sat Mar 19 18:42:29 2011 +0100
+++ b/MoinMoin/util/iri.py	Sat Mar 19 19:12:53 2011 +0100
@@ -621,6 +621,12 @@
     def __unicode__(self):
         return u'/'.join(self._list)
 
+    def __repr__(self):
+        return '%s(%r)' % (
+                self.__class__.__name__,
+                unicode(self),
+                )
+
     def _remove_dots(self, segments):
         if not segments or segments[0] != '':
             return segments