comparison MoinMoin/wikisync.py @ 1329:4a8c4849d162

Got syncing working with pages that are just in one wiki.
author Alexander Schremmer <alex AT alexanderweb DOT de>
date Sat, 19 Aug 2006 16:06:52 +0200
parents 0c3927a3b8a2
children df88b475c1f0
comparison
equal deleted inserted replaced
1328:f6801f7e4d59 1329:4a8c4849d162
277 pages.extend(Group(self.request, group_pagename).members()) 277 pages.extend(Group(self.request, group_pagename).members())
278 return [self.createSyncPage(x) for x in pages] 278 return [self.createSyncPage(x) for x in pages]
279 279
280 def createSyncPage(self, page_name): 280 def createSyncPage(self, page_name):
281 normalised_name = normalise_pagename(page_name, self.prefix) 281 normalised_name = normalise_pagename(page_name, self.prefix)
282 if normalised_name is None:
283 return None
282 if not self.request.user.may.write(normalised_name): 284 if not self.request.user.may.write(normalised_name):
283 return None
284 if normalised_name is None:
285 return None 285 return None
286 page = Page(self.request, page_name) 286 page = Page(self.request, page_name)
287 revno = page.get_real_rev() 287 revno = page.get_real_rev()
288 if revno == 99999999: # I love sane in-band signalling 288 if revno == 99999999: # I love sane in-band signalling
289 revno = None 289 return None
290 return SyncPage(normalised_name, local_rev=revno, local_name=page_name, local_deleted=not page.exists()) 290 return SyncPage(normalised_name, local_rev=revno, local_name=page_name, local_deleted=not page.exists())
291 291
292 # Public methods: 292 # Public methods:
293 293
294 # Methods implementing the RemoteWiki interface 294 # Methods implementing the RemoteWiki interface
343 self.current_rev = current_rev 343 self.current_rev = current_rev
344 self.direction = direction 344 self.direction = direction
345 self.normalised_name = normalised_name 345 self.normalised_name = normalised_name
346 346
347 def __repr__(self): 347 def __repr__(self):
348 return u"<Tag normalised_pagename=%r remote_wiki=%r remote_rev=%r current_rev=%r>" % (self.normalised_name, self.remote_wiki, self.remote_rev, self.current_rev) 348 return u"<Tag normalised_pagename=%r remote_wiki=%r remote_rev=%r current_rev=%r>" % (getattr(self, "normalised_name", "UNDEF"), self.remote_wiki, self.remote_rev, self.current_rev)
349 349
350 def __cmp__(self, other): 350 def __cmp__(self, other):
351 if not isinstance(other, Tag): 351 if not isinstance(other, Tag):
352 return NotImplemented 352 return NotImplemented
353 return cmp(self.current_rev, other.current_rev) 353 return cmp(self.current_rev, other.current_rev)