Changeset 312


Ignore:
Timestamp:
02/03/10 12:05:07 (12 years ago)
Author:
bas
Message:

The blog did not work at all! The patch i received can not work for version 0.11. Made some changes and now we can create
blogs. ref #175

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/email2trac.py.in

    r311 r312  
    942942                #
    943943                from tracfullblog.core import FullBlogCore
    944                 from tracfullblog.model import BlogPost, BlogCommen
     944                from tracfullblog.model import BlogPost, BlogComment
     945                from trac.test import Mock, MockPerm
    945946
    946947                # instantiate blog core
    947948                blog = FullBlogCore(self.env)
    948                 req = ''
    949                
     949                req = Mock(authname='anonymous', perm=MockPerm(), args={})
     950
    950951                if id:
    951952
     
    954955                        comment = BlogComment(self.env, id)
    955956                        comment.author = self.author
    956                         comment.comment = self.get_body_text(m)
     957
     958                        message_parts = self.get_message_parts(m)
     959                        comment.comment = self.body_text(message_parts)
     960
    957961                        blog.create_comment(req, comment)
    958962
     
    967971                        post.author = self.author
    968972                        post.title = self.email_to_unicode(m['Subject'])
    969                         post.body = self.get_body_text(m)
     973
     974                        message_parts = self.get_message_parts(m)
     975                        post.body = self.body_text(message_parts)
    970976                       
    971977                        blog.create_post(req, post, self.author, u'Created by email2trac', False)
Note: See TracChangeset for help on using the changeset viewer.