Permalink
Browse files

Switch everything to get_message_id

  • Loading branch information...
1 parent 2d2aaed commit 37104cc664696d1503808ec9335f4b99586a5404 @singpolyma committed Jul 6, 2010
Showing with 10 additions and 10 deletions.
  1. +10 −10 wordpress.py
View
@@ -117,7 +117,7 @@ def get_NEWNEWS(self, ts, group='*'):
num_rows = self.cursor.execute(stmt)
ids = list(self.cursor.fetchall())
for id in ids:
- articles.append("<%s@%s>" % (id, group)) # TODO
+ articles.append(self.get_message_id(id, group))
if len(articles) == 0:
return ''
else:
@@ -179,11 +179,11 @@ def get_ARTICLE(self, group_name, id, headers_only=False, body_only=False):
headers.append("Newsgroups: %s" % (group_name))
headers.append("Date: %s" % (formatted_time))
headers.append("Subject: %s" % (result[3]))
- headers.append("Message-ID: <%s@%s>" % (result[0], group_name)) # TODO
+ headers.append("Message-ID: " + self.get_message_id(result[0], group_name))
headers.append("Xref: %s %s:%s" % (settings.nntp_hostname, group_name, result[0]))
if result[6] != 0:
- headers.append("References: <%s@%s>" % (result[6], group_name))
- headers.append("In-Reply-To: <%s@%s>" % (result[6], group_name))
+ headers.append("References: " + self.get_message_id(result[6], group_name))
+ headers.append("In-Reply-To: " + self.get_message_id(result[6], group_name))
if headers_only:
return "\r\n".join(headers)
if body_only:
@@ -261,11 +261,11 @@ def get_XOVER(self, group_name, start_id, end_id='ggg'):
else:
author = "%s <%s>" % (row[2], row[3])
formatted_time = strutil.get_formatted_time(time.localtime(row[5]))
- message_id = "<%s@%s>" % (row[0], group_name)
+ message_id = self.get_message_id(row[0], group_name)
line_count = len(row[6].split('\n'))
xref = 'Xref: %s %s:%s' % (settings.nntp_hostname, group_name, row[0])
if row[1] != 0:
- reference = "<%s@%s>" % (row[1], group_name) # TODO
+ reference = self.get_message_id(row[1], group_name)
else:
reference = ""
# message_number <tab> subject <tab> author <tab> date <tab> message_id <tab> reference <tab> bytes <tab> lines <tab> xref
@@ -309,9 +309,9 @@ def get_XPAT(self, group_name, header, pattern, start_id, end_id='ggg'):
elif header.upper() == 'DATE':
hdrs.append('%s %s' % (row[0], strutil.get_formatted_time(time.localtime(result[5]))))
elif header.upper() == 'MESSAGE-ID':
- hdrs.append('%s <%s@%s>' % (row[0], row[0], group_name)) # TODO
+ hdrs.append(row[0] + ' ' + self.get_message_id(row[0], group_name))
elif (header.upper() == 'REFERENCES') and (row[1] != 0):
- hdrs.append('%s <%s@%s>' % (row[0], row[1], group_name))
+ hdrs.append(row[0] + ' ' + self.message_id(row[1], group_name))
elif header.upper() == 'BYTES':
hdrs.append('%s %s' % (row[0], len(row[6])))
elif header.upper() == 'LINES':
@@ -376,9 +376,9 @@ def get_XHDR(self, group_name, header, style, range):
elif header.upper() == 'DATE':
hdrs.append('%s %s' % (row[0], strutil.get_formatted_time(time.localtime(result[5]))))
elif header.upper() == 'MESSAGE-ID':
- hdrs.append('%s <%s@%s>' % (row[0], row[0], group_name)) # TODO
+ hdrs.append(row[0] + ' ' + self.get_message_id(row[0], group_name))
elif (header.upper() == 'REFERENCES') and (row[1] != 0):
- hdrs.append('%s <%s@%s>' % (row[0], row[1], group_name))
+ hdrs.append(row[0] + ' ' + self.get_message_id(row[1], group_name))
elif header.upper() == 'BYTES':
hdrs.append('%s %s' % (row[0], len(row[6])))
elif header.upper() == 'LINES':

0 comments on commit 37104cc

Please sign in to comment.