Changeset 3106

Show
Ignore:
Timestamp:
01/19/08 20:35:07 (8 months ago)
Author:
osimons
Message:

FullBlogPlugin: Added support for spamfilter checking of blog posts
and comments if this plugin is installed. Thanks to athomas for code.

Also fixed some issues with the APIs, the calling of implementors, and
the sample plugin. Bugs by me, patch by athomas.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • fullblogplugin/0.11/sample-plugins/SampleBlogPlugin.py

    r3053 r3106  
    4545    # IBlogManipulator methods 
    4646 
    47     def validate_blog_post(self, req, postname, fields): 
     47    def validate_blog_post(self, req, postname, version, fields): 
    4848        """Validate blog post fields before they are to be inserted as new version. 
    4949        Fields is a dict of the fields needed for insert by model.BlogPost. 
  • fullblogplugin/0.11/setup.py

    r2956 r3106  
    2121      zip_safe = False, 
    2222      extras_require={ 
    23             'tags': 'TracTags>=0.6'}, 
     23            'tags': 'TracTags>=0.6', 
     24            'spamfilter': 'TracSpamFilter>=0.2'}, 
    2425      entry_points={'trac.plugins': [ 
    2526            'tracfullblog.admin = tracfullblog.admin', 
     
    2728            'tracfullblog.db = tracfullblog.db', 
    2829            'tracfullblog.macros = tracfullblog.macros', 
     30            'tracfullblog.spamfilter = tracfullblog.spamfilter[spamfilter]', 
    2931            'tracfullblog.tags = tracfullblog.tags[tags]', 
    3032            'tracfullblog.web_ui = tracfullblog.web_ui']}, 
  • fullblogplugin/0.11/tracfullblog/core.py

    r3102 r3106  
    184184            warnings.append((req, "'%s' is a reserved name. Please change." % bp.name)) 
    185185        if bp.name == self.default_pagename: 
    186             warning.append(('post_name', "The default page shortname must be changed.")) 
     186            warnings.append(('post_name', "The default page shortname must be changed.")) 
    187187        # Check if any plugins has objections with the contents 
    188188        fields = { 
     
    196196        for manipulator in self.manipulators: 
    197197            warnings.extend(manipulator.validate_blog_post( 
    198                                                 req, bp.name, fields)) 
     198                            req, bp.name, bp.version, fields)) 
    199199        if warnings or verify_only: 
    200200            return warnings