Changeset 578


Ignore:
Timestamp:
11/28/11 13:53:22 (9 years ago)
Author:
bas
Message:

commited patch by thomas moschny for blog support, see #235

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/email2trac.py.in

    r576 r578  
    229229        if message.has_key(self.parameters.spam_header):
    230230            spam_l = string.split(message[self.parameters.spam_header])
     231            #self.logger.info('Spam header: %s' %(message[self.parameters.spam_header]))
    231232
    232233            try:
     
    13481349########## Fullblog functions  #################################################
    13491350
    1350     def blog(self, id):
     1351    def blog(self, msg, subject, id):
    13511352        """
    13521353        The blog create/update function
     
    13691370            comment.author = self.author
    13701371
    1371             message_parts = self.get_message_parts(m)
     1372            message_parts = self.get_message_parts(msg)
    13721373            comment.comment = self.get_body_text(message_parts)
    13731374
     1375            if self.parameters.dry_run:
     1376                self.logger.info('DRY-RUN: not adding comment for blog entry "%s"' % id)
     1377                return
    13741378            blog.create_comment(req, comment)
    13751379
     
    13831387           
    13841388            post.author = self.author
    1385             post.title = self.email_to_unicode(m['Subject'])
    1386 
    1387             message_parts = self.get_message_parts(m)
     1389            post.title = subject.strip()
     1390
     1391            message_parts = self.get_message_parts(msg)
    13881392            post.body = self.get_body_text(message_parts)
    13891393           
     1394            if self.parameters.dry_run:
     1395                self.logger.info('DRY-RUN: not creating blog entry "%s"' % post.title)
     1396                return
    13901397            blog.create_post(req, post, self.author, u'Created by email2trac', False)
    13911398
     
    17241731                if result.group('blog'):
    17251732                    self.system = 'blog'
    1726                     self.blog(result.group('blog_id'))
     1733                    self.blog(m, subject[result.end('blog'):], result.group('blog_id'))
    17271734
    17281735            if discussion_enabled:
Note: See TracChangeset for help on using the changeset viewer.