From 67bc2e0b18d990f08bfeb913be0c5bd7f299015a Mon Sep 17 00:00:00 2001 From: nyov Date: Fri, 2 Dec 2016 21:00:39 +0000 Subject: [PATCH] Wipe scrapy.xlib.tx --- scrapy/xlib/{tx/__init__.py => tx.py} | 0 scrapy/xlib/tx/LICENSE | 57 -------------------------- scrapy/xlib/tx/README | 2 - scrapy/xlib/tx/_newclient.py | 59 --------------------------- scrapy/xlib/tx/client.py | 58 -------------------------- scrapy/xlib/tx/endpoints.py | 26 ------------ scrapy/xlib/tx/interfaces.py | 28 ------------- scrapy/xlib/tx/iweb.py | 23 ----------- 8 files changed, 253 deletions(-) rename scrapy/xlib/{tx/__init__.py => tx.py} (100%) delete mode 100644 scrapy/xlib/tx/LICENSE delete mode 100644 scrapy/xlib/tx/README delete mode 100644 scrapy/xlib/tx/_newclient.py delete mode 100644 scrapy/xlib/tx/client.py delete mode 100644 scrapy/xlib/tx/endpoints.py delete mode 100644 scrapy/xlib/tx/interfaces.py delete mode 100644 scrapy/xlib/tx/iweb.py diff --git a/scrapy/xlib/tx/__init__.py b/scrapy/xlib/tx.py similarity index 100% rename from scrapy/xlib/tx/__init__.py rename to scrapy/xlib/tx.py diff --git a/scrapy/xlib/tx/LICENSE b/scrapy/xlib/tx/LICENSE deleted file mode 100644 index 8529f6edf..000000000 --- a/scrapy/xlib/tx/LICENSE +++ /dev/null @@ -1,57 +0,0 @@ -Copyright (c) 2001-2013 -Allen Short -Andy Gayton -Andrew Bennetts -Antoine Pitrou -Apple Computer, Inc. -Benjamin Bruheim -Bob Ippolito -Canonical Limited -Christopher Armstrong -David Reid -Donovan Preston -Eric Mangold -Eyal Lotem -Itamar Turner-Trauring -James Knight -Jason A. Mobarak -Jean-Paul Calderone -Jessica McKellar -Jonathan Jacobs -Jonathan Lange -Jonathan D. Simms -Jürgen Hermann -Kevin Horn -Kevin Turner -Mary Gardiner -Matthew Lefkowitz -Massachusetts Institute of Technology -Moshe Zadka -Paul Swartz -Pavel Pergamenshchik -Ralph Meijer -Sean Riley -Software Freedom Conservancy -Travis B. Hartwell -Thijs Triemstra -Thomas Herve -Timothy Allen - -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 -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -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. diff --git a/scrapy/xlib/tx/README b/scrapy/xlib/tx/README deleted file mode 100644 index 75ef485ce..000000000 --- a/scrapy/xlib/tx/README +++ /dev/null @@ -1,2 +0,0 @@ -This source files are adapted copies from Twisted trunk to support HTTP1.1 -handler under Twisted >= 11.1 and Twisted <= 13.0.0 diff --git a/scrapy/xlib/tx/_newclient.py b/scrapy/xlib/tx/_newclient.py deleted file mode 100644 index 39cd20f95..000000000 --- a/scrapy/xlib/tx/_newclient.py +++ /dev/null @@ -1,59 +0,0 @@ -# -*- test-case-name: twisted.web.test.test_newclient -*- -# Copyright (c) Twisted Matrix Laboratories. -# See LICENSE for details. - -""" -An U{HTTP 1.1} client. - -The way to use the functionality provided by this module is to: - - - Connect a L{HTTP11ClientProtocol} to an HTTP server - - Create a L{Request} with the appropriate data - - Pass the request to L{HTTP11ClientProtocol.request} - - The returned Deferred will fire with a L{Response} object - - Create a L{IProtocol} provider which can handle the response body - - Connect it to the response with L{Response.deliverBody} - - When the protocol's C{connectionLost} method is called, the response is - complete. See L{Response.deliverBody} for details. - -Various other classes in this module support this usage: - - - HTTPParser is the basic HTTP parser. It can handle the parts of HTTP which - are symmetric between requests and responses. - - - HTTPClientParser extends HTTPParser to handle response-specific parts of - HTTP. One instance is created for each request to parse the corresponding - response. -""" - -__metaclass__ = type - -from zope.interface import implements - -from twisted.python import log -from twisted.python.reflect import fullyQualifiedName -from twisted.python.failure import Failure -from twisted.internet.interfaces import IConsumer, IPushProducer -from twisted.internet.error import ConnectionDone -from twisted.internet.defer import Deferred, succeed, fail, maybeDeferred -from twisted.internet.defer import CancelledError -from twisted.internet.protocol import Protocol -from twisted.web.iweb import UNKNOWN_LENGTH, IResponse -from twisted.web.http import NO_CONTENT, NOT_MODIFIED -from twisted.web.http import _DataLoss, PotentialDataLoss -from twisted.web.http import _IdentityTransferDecoder, _ChunkedTransferDecoder - -from twisted.web._newclient import ( - BadHeaders, ExcessWrite, ParseError, BadResponseVersion, _WrapperException, - RequestGenerationFailed, RequestTransmissionFailed, ConnectionAborted, - WrongBodyLength, ResponseDone, ResponseFailed, RequestNotSent, - ResponseNeverReceived, HTTPParser, HTTPClientParser, Request, - LengthEnforcingConsumer, makeStatefulDispatcher, Response, ChunkedEncoder, - TransportProxyProducer, HTTP11ClientProtocol -) - -# States HTTPParser can be in -STATUS = 'STATUS' -HEADER = 'HEADER' -BODY = 'BODY' -DONE = 'DONE' diff --git a/scrapy/xlib/tx/client.py b/scrapy/xlib/tx/client.py deleted file mode 100644 index c2d50648a..000000000 --- a/scrapy/xlib/tx/client.py +++ /dev/null @@ -1,58 +0,0 @@ -# -*- test-case-name: twisted.web.test.test_webclient,twisted.web.test.test_agent -*- -# Copyright (c) Twisted Matrix Laboratories. -# See LICENSE for details. - -""" -HTTP client. -""" - -from __future__ import division, absolute_import - -import os - -try: - from urlparse import urlunparse - from urllib import splithost, splittype -except ImportError: - from urllib.parse import splithost, splittype - from urllib.parse import urlunparse as _urlunparse - - def urlunparse(parts): - result = _urlunparse(tuple([p.decode("charmap") for p in parts])) - return result.encode("charmap") -import zlib - -from zope.interface import implementer - -from twisted.python import log -from twisted.python.failure import Failure -from twisted.web import http -from twisted.internet import defer, protocol, task, reactor -from twisted.internet.interfaces import IProtocol -from twisted.internet.endpoints import TCP4ClientEndpoint, SSL4ClientEndpoint -from twisted.python import failure -from twisted.python.components import proxyForInterface -from twisted.web import error -from twisted.web.iweb import UNKNOWN_LENGTH, IBodyProducer, IResponse -from twisted.web.http_headers import Headers - -from twisted.web.client import ( - PartialDownloadError, FileBodyProducer, - CookieAgent, GzipDecoder, ContentDecoderAgent, RedirectAgent, - Agent, ProxyAgent, HTTPConnectionPool, readBody, -) - - -# The code which follows is based on the new HTTP client implementation. It -# should be significantly better than anything above, though it is not yet -# feature equivalent. - -from twisted.web._newclient import Response -from twisted.web._newclient import ResponseDone, ResponseFailed - - -__all__ = [ - 'PartialDownloadError', - 'ResponseDone', 'Response', 'ResponseFailed', 'Agent', 'CookieAgent', - 'ProxyAgent', 'ContentDecoderAgent', 'GzipDecoder', 'RedirectAgent', - 'HTTPConnectionPool', 'readBody'] diff --git a/scrapy/xlib/tx/endpoints.py b/scrapy/xlib/tx/endpoints.py deleted file mode 100644 index 197e43ed3..000000000 --- a/scrapy/xlib/tx/endpoints.py +++ /dev/null @@ -1,26 +0,0 @@ -# -*- test-case-name: twisted.internet.test.test_endpoints -*- -# Copyright (c) Twisted Matrix Laboratories. -# See LICENSE for details. - -""" -Implementations of L{IStreamServerEndpoint} and L{IStreamClientEndpoint} that -wrap the L{IReactorTCP}, L{IReactorSSL}, and L{IReactorUNIX} interfaces. - -This also implements an extensible mini-language for describing endpoints, -parsed by the L{clientFromString} and L{serverFromString} functions. - -@since: 10.1 -""" - -from __future__ import division, absolute_import - -from twisted.internet.endpoints import ( - clientFromString, serverFromString, quoteStringArgument, - TCP4ServerEndpoint, TCP6ServerEndpoint, - TCP4ClientEndpoint, TCP6ClientEndpoint, - UNIXServerEndpoint, UNIXClientEndpoint, - SSL4ServerEndpoint, SSL4ClientEndpoint, - AdoptedStreamServerEndpoint, connectProtocol, -) - -__all__ = ["TCP4ClientEndpoint", "SSL4ServerEndpoint"] diff --git a/scrapy/xlib/tx/interfaces.py b/scrapy/xlib/tx/interfaces.py deleted file mode 100644 index fdcbf3977..000000000 --- a/scrapy/xlib/tx/interfaces.py +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright (c) Twisted Matrix Laboratories. -# See LICENSE for details. - -""" -Interface documentation. - -Maintainer: Itamar Shtull-Trauring -""" - -from __future__ import division, absolute_import - -from twisted.internet.interfaces import ( - IAddress, IConnector, IResolverSimple, IReactorTCP, IReactorSSL, - IReactorWin32Events, IReactorUDP, IReactorMulticast, IReactorProcess, - IReactorTime, IDelayedCall, IReactorThreads, IReactorCore, - IReactorPluggableResolver, IReactorDaemonize, IReactorFDSet, - IListeningPort, ILoggingContext, IFileDescriptor, IReadDescriptor, - IWriteDescriptor, IReadWriteDescriptor, IHalfCloseableDescriptor, - ISystemHandle, IConsumer, IProducer, IPushProducer, IPullProducer, - IProtocol, IProcessProtocol, IHalfCloseableProtocol, - IFileDescriptorReceiver, IProtocolFactory, ITransport, ITCPTransport, - IUNIXTransport, - ITLSTransport, ISSLTransport, IProcessTransport, IServiceCollection, - IUDPTransport, IUNIXDatagramTransport, IUNIXDatagramConnectedTransport, - IMulticastTransport, IStreamClientEndpoint, IStreamServerEndpoint, - IStreamServerEndpointStringParser, IStreamClientEndpointStringParser, - IReactorUNIX, IReactorUNIXDatagram, IReactorSocket, IResolver -) diff --git a/scrapy/xlib/tx/iweb.py b/scrapy/xlib/tx/iweb.py deleted file mode 100644 index fd814dc22..000000000 --- a/scrapy/xlib/tx/iweb.py +++ /dev/null @@ -1,23 +0,0 @@ -# -*- test-case-name: twisted.web.test -*- -# Copyright (c) Twisted Matrix Laboratories. -# See LICENSE for details. - -""" -Interface definitions for L{twisted.web}. - -@var UNKNOWN_LENGTH: An opaque object which may be used as the value of - L{IBodyProducer.length} to indicate that the length of the entity - body is not known in advance. -""" - -from twisted.web.iweb import ( - IRequest, ICredentialFactory, IBodyProducer, IRenderable, ITemplateLoader, - IResponse, _IRequestEncoder, _IRequestEncoderFactory, UNKNOWN_LENGTH, -) - -__all__ = [ - "ICredentialFactory", "IRequest", - "IBodyProducer", "IRenderable", "IResponse", "_IRequestEncoder", - "_IRequestEncoderFactory", - - "UNKNOWN_LENGTH"]