changeset 1097:e22024151c2c

Fixed some bugs in SyncPages.
author Alexander Schremmer <alex AT alexanderweb DOT de>
date Sun, 30 Jul 2006 00:22:15 +0200
parents 33927b0256ce
children cdd1ea31f00e
files MoinMoin/action/SyncPages.py
diffstat 1 files changed, 12 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/action/SyncPages.py	Sun Jul 30 00:02:39 2006 +0200
+++ b/MoinMoin/action/SyncPages.py	Sun Jul 30 00:22:15 2006 +0200
@@ -40,7 +40,7 @@
         self.revno = revno
 
     def __repr__(self):
-        return repr(unicode(self))
+        return repr("<Remote Page %r>" % unicode(self))
 
     def __unicode__(self):
         return u"%s<%i>" % (self.name, self.revno)
@@ -48,6 +48,11 @@
     def __lt__(self, other):
         return self.name < other.name
 
+    def __eq__(self, other):
+        if not isinstance(other, RemotePage):
+            return false
+        return self.name == other.name
+
     def filter(cls, rp_list, regex):
         return [x for x in rp_list if regex.match(x.name)]
     filter = classmethod(filter)
@@ -90,7 +95,9 @@
         remote_iwid = self.connection.interwikiName()[1]
         self.is_anonymous = remote_interwikiname is None
         if not self.is_anonymous and interwikiname != remote_interwikiname:
-            raise UnsupportedWikiException(_("The remote wiki uses a different InterWiki name internally than you specified."))
+            raise UnsupportedWikiException(_("The remote wiki uses a different InterWiki name (%(remotename)s)"
+                                             " internally than you specified (%(localname)s).") % {
+                "remotename": remote_interwikiname, "localname": interwikiname})
 
         if self.is_anonymous:
             self.iwid_full = remote_iwid
@@ -200,8 +207,8 @@
             local = MoinLocalWiki(self.request)
             try:
                 remote = MoinRemoteWiki(self.request, params["remoteWiki"])
-            except UnsupportedWikiException, e:
-                raise ActionStatus(e.msg)
+            except UnsupportedWikiException, (msg, ):
+                raise ActionStatus(msg)
 
             if not remote.valid:
                 raise ActionStatus(_("The ''remoteWiki'' is unknown."))
@@ -233,7 +240,7 @@
                 l_pages += pages_from_groupList
 
         # some initial test code
-        r_new_pages = u", ".join(set([unicode(x) for x in r_pages]) - set([unicode(x) for x in l_pages]))
+        r_new_pages = u", ".join([unicode(x) for x in (set(r_pages) - set(l_pages))])
         raise ActionStatus("These pages are in the remote wiki, but not local: " + r_new_pages)