def fetchNewNews(self, groups, date, distributions = ''):
"""
Get the Message-IDs for all new news posted to any of the given
groups since the specified date - in seconds since the epoch, GMT -
optionally restricted to the given distributions. gotNewNews() is
called on success, getNewNewsFailed() on failure.
One invocation of this function may result in multiple invocations
of gotNewNews()/getNewNewsFailed().
"""
date, timeStr = time.strftime('%y%m%d %H%M%S', time.gmtime(date)).split()
line = 'NEWNEWS %%s %s %s %s' % (date, timeStr, distributions)
groupPart = ''
while len(groups) and len(line) + len(groupPart) + len(groups[-1]) + 1 < NNTPClient.MAX_COMMAND_LENGTH:
group = groups.pop()
groupPart = groupPart + ',' + group
self.sendLine(line % (groupPart,))
self._newState(self._stateNewNews, self.getNewNewsFailed)
if len(groups):
self.fetchNewNews(groups, date, distributions)
评论列表
文章目录