~ubuntu-branches/ubuntu/hardy/moin/hardy-security

« back to all changes in this revision

Viewing changes to MoinMoin/wikidicts.py

  • Committer: Bazaar Package Importer
  • Author(s): Kees Cook
  • Date: 2007-05-14 15:55:15 UTC
  • mfrom: (0.4.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20070514155515-apl4srcch40h9fcx
Tags: 1.5.7-3ubuntu1
* Merge from debian unstable, remaining changes:
  - 11000_show_traceback_toggle.patch: allow for 'show_traceback=0' in
    Moin configurations.

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
 
28
28
# Version of the internal data structure which is pickled
29
29
# Please increment if you have changed the structure
30
 
DICTS_PICKLE_VERSION = 4
 
30
DICTS_PICKLE_VERSION = 5
31
31
    
32
32
 
33
33
class DictBase:
45
45
        """
46
46
        self.name = name
47
47
 
48
 
        self.regex = re.compile(self.regex, re.MULTILINE | re.UNICODE)
 
48
        self.initRegex()
49
49
 
50
50
        # Get text from page named 'name'
51
51
        p = Page.Page(request, name)
52
52
        text = p.get_raw_body()
53
53
        self.initFromText(text)
54
54
 
 
55
    def initRegex(cls):
 
56
        """ Make it a class attribute to avoid it being pickled. """
 
57
        cls.regex = re.compile(cls.regex, re.MULTILINE | re.UNICODE)
 
58
    initRegex = classmethod(initRegex)
 
59
 
55
60
    def initFromText(self, text):
56
61
        raise NotImplementedError('sub classes should override this')
57
62
 
289
294
        self.groupdict[groupname] = grp
290
295
 
291
296
    def hasgroup(self, groupname):
292
 
        return self.dictdict.has_key(groupname)
 
297
        return self.groupdict.has_key(groupname)
293
298
 
294
299
    def membergroups(self, member):
295
300
        """list all groups where member is a member of"""