Hello community, here is the log from the commit of package python-twisted-news checked in at Thu Oct 26 21:07:22 CEST 2006. -------- --- python-twisted-news/python-twisted-news.changes 2006-02-28 16:46:03.000000000 +0100 +++ /mounts/work_src_done/STABLE/python-twisted-news/python-twisted-news.changes 2006-10-26 18:40:38.000000000 +0200 @@ -1,0 +2,7 @@ +Thu Oct 26 18:40:08 CEST 2006 - jmatejek@suse.cz + +- update to 0.2.0 + - upgrade to Twisted 2.4 install system + - fixed critical bug in news moderation support + +------------------------------------------------------------------- Old: ---- TwistedNews-0.1.0.tar.bz2 New: ---- TwistedNews-0.2.0.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-twisted-news.spec ++++++ --- /var/tmp/diff_new_pack.E6oGnw/_old 2006-10-26 21:07:20.000000000 +0200 +++ /var/tmp/diff_new_pack.E6oGnw/_new 2006-10-26 21:07:20.000000000 +0200 @@ -1,5 +1,5 @@ # -# spec file for package python-twisted-news (Version 0.1.0) +# spec file for package python-twisted-news (Version 0.2.0) # # Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany. # This file and all modifications and additions to the pristine @@ -13,13 +13,13 @@ Name: python-twisted-news BuildRequires: python-devel python-twisted Summary: Twisted News -Version: 0.1.0 -Release: 6 +Version: 0.2.0 +Release: 1 %define tarname TwistedNews Source: %{tarname}-%{version}.tar.bz2 License: X11/MIT Group: Development/Languages/Python -URL: http://twistedmatrix.com/projects/news/ +URL: http://twistedmatrix.com/trac/wiki/TwistedNews BuildRoot: %{_tmppath}/%{name}-%{version}-build Requires: python-twisted %{py_requires} @@ -56,6 +56,10 @@ %doc LICENSE README %changelog -n python-twisted-news +* Thu Oct 26 2006 - jmatejek@suse.cz +- update to 0.2.0 + - upgrade to Twisted 2.4 install system + - fixed critical bug in news moderation support * Tue Feb 28 2006 - jmatejek@suse.cz - updated to reflect python changes due to #149809 * Wed Jan 25 2006 - mls@suse.de ++++++ TwistedNews-0.1.0.tar.bz2 -> TwistedNews-0.2.0.tar.bz2 ++++++ diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/TwistedNews-0.1.0/LICENSE new/TwistedNews-0.2.0/LICENSE --- old/TwistedNews-0.1.0/LICENSE 2005-02-12 00:28:49.000000000 +0100 +++ new/TwistedNews-0.2.0/LICENSE 2006-04-18 04:43:54.000000000 +0200 @@ -1,11 +1,13 @@ - -Copyright (c) 2004 +Copyright (c) 2001-2006 Allen Short Andrew Bennetts +Apple Computer, Inc. Benjamin Bruheim Bob Ippolito +Canonical Limited Christopher Armstrong Donovan Preston +Eric Mangold Itamar Shtull-Trauring James Knight Jason A. Mobarak @@ -20,11 +22,10 @@ Moshe Zadka Paul Swartz Pavel Pergamenshchik +Ralph Meijer Sean Riley Travis B. Hartwell -except as noted at the end of this file. - Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including @@ -43,7 +44,3 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - -Copyright Exceptions: - diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/TwistedNews-0.1.0/NEWS new/TwistedNews-0.2.0/NEWS --- old/TwistedNews-0.1.0/NEWS 1970-01-01 01:00:00.000000000 +0100 +++ new/TwistedNews-0.2.0/NEWS 2006-05-25 03:26:06.000000000 +0200 @@ -0,0 +1,6 @@ +0.2.0 (2006-05-24) +================== + +Fixes: + - Fixed a critical bug in moderation support. + diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/TwistedNews-0.1.0/README new/TwistedNews-0.2.0/README --- old/TwistedNews-0.1.0/README 2005-03-22 12:14:01.000000000 +0100 +++ new/TwistedNews-0.2.0/README 2006-05-25 03:26:06.000000000 +0200 @@ -1,6 +1,4 @@ -Twisted News 0.1.0 - -News was recently split out of Twisted. +Twisted News 0.2.0 News depends on Twisted, and, if you want to use the moderation features, Twisted Mail. diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/TwistedNews-0.1.0/setup.py new/TwistedNews-0.2.0/setup.py --- old/TwistedNews-0.1.0/setup.py 2005-03-22 12:14:01.000000000 +0100 +++ new/TwistedNews-0.2.0/setup.py 2006-05-13 21:26:09.000000000 +0200 @@ -1,19 +1,22 @@ -import sys -from twisted.python import dist +try: + from twisted.python import dist +except ImportError: + raise SystemExit("twisted.python.dist module not found. Make sure you " + "have installed the Twisted core package before " + "attempting to install any other Twisted projects.") if __name__ == '__main__': dist.setup( twisted_subproject="news", # metadata name="Twisted News", - version="0.1.0", description="Twisted News is an NNTP server and programming library.", author="Twisted Matrix Laboratories", author_email="twisted-python@twistedmatrix.com", maintainer="Jp Calderone", maintainer_email="exarkun@divmod.com", - url="http://twistedmatrix.com/projects/news/", + url="http://twistedmatrix.com/trac/wiki/TwistedNews", license="MIT", long_description="""\ Twisted News is an NNTP protocol (Usenet) programming library. The diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/TwistedNews-0.1.0/twisted/news/__init__.py new/TwistedNews-0.2.0/twisted/news/__init__.py --- old/TwistedNews-0.1.0/twisted/news/__init__.py 2005-03-22 12:14:01.000000000 +0100 +++ new/TwistedNews-0.2.0/twisted/news/__init__.py 2006-05-25 03:31:41.000000000 +0200 @@ -1,11 +1,11 @@ # Copyright (c) 2001-2004 Twisted Matrix Laboratories. # See LICENSE for details. - - """ Twisted News: an NNTP-based news service. """ -__version__ = '0.1.0' + +from twisted.news._version import version +__version__ = version.short() diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/TwistedNews-0.1.0/twisted/news/_version.py new/TwistedNews-0.2.0/twisted/news/_version.py --- old/TwistedNews-0.1.0/twisted/news/_version.py 1970-01-01 01:00:00.000000000 +0100 +++ new/TwistedNews-0.2.0/twisted/news/_version.py 2006-05-25 03:26:06.000000000 +0200 @@ -0,0 +1,3 @@ +# This is an auto-generated file. Use admin/change-versions to update. +from twisted.python import versions +version = versions.Version(__name__[:__name__.rfind('.')], 0, 2, 0) diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/TwistedNews-0.1.0/twisted/news/database.py new/TwistedNews-0.2.0/twisted/news/database.py --- old/TwistedNews-0.1.0/twisted/news/database.py 2004-08-25 10:36:30.000000000 +0200 +++ new/TwistedNews-0.2.0/twisted/news/database.py 2006-03-12 21:59:12.000000000 +0100 @@ -260,7 +260,7 @@ def notifyModerators(self, moderators, article): # Moderated postings go through as long as they have an Approved # header, regardless of what the value is - a.putHeader('To', ', '.join(moderators)) + article.putHeader('To', ', '.join(moderators)) return smtp.sendEmail( 'twisted@' + socket.gethostname(), moderators, @@ -316,7 +316,7 @@ a.putHeader('Xref', '%s %s' % ( socket.gethostname().split()[0], - ''.join(map(lambda x: string.join(x, ':'), xref)) + ''.join(map(lambda x: ':'.join(x), xref)) )) self.flush() @@ -435,8 +435,6 @@ self.db['moderators'] = dict(moderators) self.flush() -components.backwardsCompatImplements(PickleStorage) - class Group: name = None @@ -680,8 +678,6 @@ else: return defer.succeed((index, a.getHeader('Message-ID'), StringIO.StringIO(a.body))) -components.backwardsCompatImplements(NewsShelf) - class NewsStorageAugmentation: """ @@ -985,8 +981,6 @@ lambda (index, id, body): (index, id, StringIO.StringIO(body)) ) -components.backwardsCompatImplements(NewsStorageAugmentation) - #### #### XXX - make these static methods some day #### diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/TwistedNews-0.1.0/twisted/news/nntp.py new/TwistedNews-0.2.0/twisted/news/nntp.py --- old/TwistedNews-0.1.0/twisted/news/nntp.py 2005-02-27 02:43:47.000000000 +0100 +++ new/TwistedNews-0.2.0/twisted/news/nntp.py 2005-11-10 04:18:15.000000000 +0100 @@ -32,11 +32,6 @@ - A control protocol """ -from twisted.internet import protocol -from twisted.protocols import basic -from twisted.python import log -from twisted.python import failure - import time import types @@ -45,6 +40,9 @@ except: import StringIO +from twisted.protocols import basic +from twisted.python import log + def parseRange(text): articles = text.split('-') if len(articles) == 1: diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/TwistedNews-0.1.0/twisted/news/tap.py new/TwistedNews-0.2.0/twisted/news/tap.py --- old/TwistedNews-0.1.0/twisted/news/tap.py 2005-03-22 08:24:47.000000000 +0100 +++ new/TwistedNews-0.2.0/twisted/news/tap.py 2005-11-10 04:18:15.000000000 +0100 @@ -2,13 +2,10 @@ # See LICENSE for details. -from twisted.enterprise import adbapi from twisted.news import news, database from twisted.application import strports from twisted.python import usage, log -import sys, getpass - class DBOptions(usage.Options): optParameters = [ ['module', None, 'pyPgSQL.PgSQL', "DB-API 2.0 module to use"], diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/TwistedNews-0.1.0/twisted/news/test/test_news.py new/TwistedNews-0.2.0/twisted/news/test/test_news.py --- old/TwistedNews-0.1.0/twisted/news/test/test_news.py 2004-08-25 10:36:30.000000000 +0200 +++ new/TwistedNews-0.2.0/twisted/news/test/test_news.py 2006-01-03 04:27:28.000000000 +0100 @@ -1,11 +1,11 @@ # Copyright (c) 2001-2004 Twisted Matrix Laboratories. # See LICENSE for details. -import os, types +import sys, types from pprint import pformat from twisted.trial import unittest -from twisted.news import news, database +from twisted.news import database from twisted.internet import reactor MESSAGE_ID = "f83ba57450ed0fd8ac9a472b847e830e" @@ -32,121 +32,76 @@ """ % (MESSAGE_ID) class NewsTestCase(unittest.TestCase): - def callback(self, result): - self.result = result - - def errback(self, failure): - try: - self.fail('Errback called: ' + str(failure)) - except Exception, e: - self.error = sys.exc_info() - raise - - def timeout(self): - reactor.crash() - self.fail('Timed out') - def setUp(self): self.backend = database.NewsShelf(None, 'news2.db') self.backend.addGroup('alt.test.nntp', 'y') self.backend.postRequest(POST_STRING.replace('\n', '\r\n')) - def tearDown(self): - try: - del self.result - except: - pass - try: - del self.error - except: - pass def testArticleExists(self): d = self.backend.articleExistsRequest(MESSAGE_ID) - self.assert_(d.result) + d.addCallback(self.failUnless) + return d + def testArticleRequest(self): d = self.backend.articleRequest(None, None, MESSAGE_ID) - d.addCallbacks(self.callback, self.errback) - id = reactor.callLater(5, self.timeout) - while not hasattr(self, 'result') and not hasattr(self, 'error'): - reactor.iterate() - try: - id.cancel() - except ValueError: pass - - error = getattr(self, 'error', None) - if error: - raise error[0], error[1], error[2] - - self.failUnless(type(self.result) == types.TupleType, - 'callback result is wrong type: ' + str(self.result)) - self.failUnless(len(self.result) == 3, - 'callback result list should have three entries: ' + - str(self.result)) - self.failUnless(self.result[1] == MESSAGE_ID, - "callback result Message-Id doesn't match: %s vs %s" % - (MESSAGE_ID, self.result[1])) - body = self.result[2].read() - self.failUnless(body.find('\r\n\r\n'), - "Can't find \\r\\n\\r\\n between header and body") + def cbArticle(result): + self.failUnless(isinstance(result, tuple), + 'callback result is wrong type: ' + str(result)) + self.assertEquals(len(result), 3, + 'callback result list should have three entries: ' + + str(result)) + self.assertEquals(result[1], MESSAGE_ID, + "callback result Message-Id doesn't match: %s vs %s" % + (MESSAGE_ID, result[1])) + body = result[2].read() + self.failIfEqual(body.find('\r\n\r\n'), -1, + "Can't find \\r\\n\\r\\n between header and body") + return result + + d.addCallback(cbArticle) + return d + def testHeadRequest(self): - self.testArticleRequest() - index = self.result[0] + d = self.testArticleRequest() + + def cbArticle(result): + index = result[0] + + d = self.backend.headRequest("alt.test.nntp", index) + d.addCallback(cbHead) + return d - try: del self.result - except: pass + def cbHead(result): + self.assertEquals(result[1], MESSAGE_ID, + "callback result Message-Id doesn't match: %s vs %s" % + (MESSAGE_ID, result[1])) - try: del self.error - except: pass + self.assertEquals(result[2][-2:], '\r\n', + "headers must be \\r\\n terminated.") - d = self.backend.headRequest("alt.test.nntp", index) - d.addCallbacks(self.callback, self.errback) - - id = reactor.callLater(5, self.timeout) - while not hasattr(self, 'result') and not hasattr(self, 'error'): - reactor.iterate() - try: - id.cancel() - except ValueError: pass - - error = getattr(self, 'error', None) - if error: - raise error[0], error[1], error[2] - - self.failUnless(self.result[1] == MESSAGE_ID, - "callback result Message-Id doesn't match: %s vs %s" % - (MESSAGE_ID, self.result[1])) + d.addCallback(cbArticle) + return d - self.failUnless(self.result[2][-2:] == '\r\n', - "headers must be \\r\\n terminated.") def testBodyRequest(self): - self.testArticleRequest() - index = self.result[0] + d = self.testArticleRequest() - try: del self.result - except: pass + def cbArticle(result): + index = result[0] - try: del self.error - except: pass + d = self.backend.bodyRequest("alt.test.nntp", index) + d.addCallback(cbBody) + return d + + def cbBody(result): + body = result[2].read() + self.assertEquals(body[0:4], 'this', + "message body has been altered: " + + pformat(body[0:4])) - d = self.backend.bodyRequest("alt.test.nntp", index) - d.addCallbacks(self.callback, self.errback) - - id = reactor.callLater(5, self.timeout) - while not hasattr(self, 'result') and not hasattr(self, 'error'): - reactor.iterate() - try: - id.cancel() - except ValueError: pass - - error = getattr(self, 'error', None) - if error: - raise error[0], error[1], error[2] - - body = self.result[2].read() - self.failUnless(body[0:4] == 'this', "message body has been altered: " + - pformat(body[0:4])) + d.addCallback(cbArticle) + return d diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/TwistedNews-0.1.0/twisted/news/test/test_nntp.py new/TwistedNews-0.2.0/twisted/news/test/test_nntp.py --- old/TwistedNews-0.1.0/twisted/news/test/test_nntp.py 2005-02-27 02:43:47.000000000 +0100 +++ new/TwistedNews-0.2.0/twisted/news/test/test_nntp.py 2005-11-10 04:18:15.000000000 +0100 @@ -1,13 +1,10 @@ # Copyright (c) 2001-2004 Twisted Matrix Laboratories. # See LICENSE for details. -import os, string, shutil - from twisted.trial import unittest -from twisted.news import news, database +from twisted.news import database from twisted.news import nntp from twisted.protocols import loopback -from twisted.internet import reactor, protocol ALL_GROUPS = ('alt.test.nntp', 0, 1, 'y'), GROUP = ('0', '1', '0', 'alt.test.nntp', 'group', 'selected') ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org
participants (1)
-
root@suse.de