Back to index

moin  1.9.0~rc2
Public Member Functions | Public Attributes
MoinMoin.wikisync.MoinLocalWiki Class Reference
Inheritance diagram for MoinMoin.wikisync.MoinLocalWiki:
Inheritance graph
[legend]
Collaboration diagram for MoinMoin.wikisync.MoinLocalWiki:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def getGroupItems
def createSyncPage
def delete_page
def get_interwiki_name
def get_iwid
def get_pages
def __repr__

Public Attributes

 request
 prefix
 pagelist

Detailed Description

Used for the current MoinMoin wiki. 

Definition at line 304 of file wikisync.py.


Constructor & Destructor Documentation

def MoinMoin.wikisync.MoinLocalWiki.__init__ (   self,
  request,
  prefix,
  pagelist 
)

Definition at line 306 of file wikisync.py.

00306 
00307     def __init__(self, request, prefix, pagelist):
00308         self.request = request
00309         self.prefix = prefix
00310         self.pagelist = pagelist


Member Function Documentation

Returns a representation of the instance for debugging purposes. 

Reimplemented from MoinMoin.wikisync.RemoteWiki.

Definition at line 364 of file wikisync.py.

00364 
00365     def __repr__(self):
00366         return "<MoinLocalWiki>"
00367 
00368 
00369 # ------------------ Tags ------------------
00370 

def MoinMoin.wikisync.MoinLocalWiki.createSyncPage (   self,
  page_name 
)

Definition at line 318 of file wikisync.py.

00318 
00319     def createSyncPage(self, page_name):
00320         normalised_name = normalise_pagename(page_name, self.prefix)
00321         if normalised_name is None:
00322             return None
00323         page = Page(self.request, page_name)
00324         revno = page.get_real_rev()
00325         if revno == 99999999: # I love sane in-band signalling
00326             return None
00327         return SyncPage(normalised_name, local_rev=revno, local_name=page_name, local_deleted=not page.exists())

Here is the call graph for this function:

Here is the caller graph for this function:

def MoinMoin.wikisync.MoinLocalWiki.delete_page (   self,
  pagename,
  comment 
)

Definition at line 331 of file wikisync.py.

00331 
00332     def delete_page(self, pagename, comment):
00333         page = PageEditor(self.request, pagename)
00334         try:
00335             page.deletePage(comment)
00336         except PageEditor.AccessDenied, (msg, ):
00337             return msg
00338         return ""

Returns the interwiki name of the other wiki. 

Reimplemented from MoinMoin.wikisync.RemoteWiki.

Definition at line 339 of file wikisync.py.

00339 
00340     def get_interwiki_name(self):
00341         return self.request.cfg.interwikiname

Returns the InterWiki ID. 

Reimplemented from MoinMoin.wikisync.RemoteWiki.

Definition at line 342 of file wikisync.py.

00342 
00343     def get_iwid(self):
00344         return self.request.cfg.iwid

Returns a list of SyncPage instances. 

Reimplemented from MoinMoin.wikisync.RemoteWiki.

Definition at line 345 of file wikisync.py.

00345 
00346     def get_pages(self, **kwargs):
00347         assert not kwargs
00348         if self.prefix or self.pagelist:
00349             def page_filter(name, prefix=(self.prefix or ""), pagelist=self.pagelist):
00350                 n_name = normalise_pagename(name, prefix)
00351                 if not n_name:
00352                     return False
00353                 if not pagelist:
00354                     return True
00355                 return n_name in pagelist
00356         else:
00357             page_filter = lambda x: True
00358         pages = []
00359         for x in self.request.rootpage.getPageList(exists=False, include_underlay=False, filter=page_filter):
00360             sp = self.createSyncPage(x)
00361             if sp:
00362                 pages.append(sp)
00363         return pages

Here is the call graph for this function:

def MoinMoin.wikisync.MoinLocalWiki.getGroupItems (   self,
  group_list 
)
Returns all page names that are listed on the page group_list. 

Definition at line 311 of file wikisync.py.

00311 
00312     def getGroupItems(self, group_list):
00313         """ Returns all page names that are listed on the page group_list. """
00314         pages = []
00315         for group_pagename in group_list:
00316             pages.extend(request.groups.get(group_pagename, []))
00317         return [self.createSyncPage(x) for x in pages]

Here is the call graph for this function:


Member Data Documentation

Definition at line 309 of file wikisync.py.

Definition at line 308 of file wikisync.py.

Definition at line 307 of file wikisync.py.


The documentation for this class was generated from the following file: