changeset 1098:cdd1ea31f00e

Added sample code for set logic in SyncPages.
author Alexander Schremmer <alex AT alexanderweb DOT de>
date Sun, 30 Jul 2006 00:26:18 +0200
parents e22024151c2c
children 92f5835853ae
files MoinMoin/action/SyncPages.py
diffstat 1 files changed, 10 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/action/SyncPages.py	Sun Jul 30 00:22:15 2006 +0200
+++ b/MoinMoin/action/SyncPages.py	Sun Jul 30 00:26:18 2006 +0200
@@ -239,9 +239,17 @@
             else:
                 l_pages += pages_from_groupList
 
+        l_pages = set(l_pages)
+        r_pages = set(r_pages)
+        
+        # XXX this is not correct if matching is active
+        remote_but_not_local = r_pages - l_pages
+        local_but_not_remote = l_pages - r_pages
+        
         # some initial test code
-        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)
+        r_new_pages = u", ".join([unicode(x) for x in remote_but_not_local])
+        l_new_pages = u", ".join([unicode(x) for x in local_but_not_remote])
+        raise ActionStatus("These pages are in the remote wiki, but not local: " + r_new_pages + "<br>These pages are in the local wiki, but not in the remote one: " + l_new_pages)
 
 
 def execute(pagename, request):