Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_baseWithPrerelease(self):
"""
The base version includes 'preX' for versions with prereleases.
"""
self.assertEqual(Version("foo", 1, 0, 0, prerelease=8).base(),
"1.0.0pre8")
def test_versionComparison(self):
"""
Versions can be compared for equality and order.
"""
va = Version("dummy", 1, 0, 0)
vb = Version("dummy", 0, 1, 0)
self.assertTrue(va > vb)
self.assertTrue(vb < va)
self.assertTrue(va >= vb)
self.assertTrue(vb <= va)
self.assertTrue(va != vb)
self.assertTrue(vb == Version("dummy", 0, 1, 0))
self.assertTrue(vb == vb)
"""
Provides klein version information.
"""
# This file is auto-generated! Do not edit!
# Use `python -m incremental.update klein` to change this file.
from incremental import Version
__version__ = Version("klein", 19, 6, 0)
__all__ = ["__version__"]
return self is not other
return NotImplemented
def __hash__(self):
"""
A C{Request} is hashable so that it can be used as a mapping key.
@return A C{int} based on the instance's identity.
"""
return id(self)
Request.getClientIP = deprecated(
Version("Twisted", "NEXT", 0, 0),
replacement="getClientAddress",
)(Request.getClientIP)
Request.noLongerQueued = deprecated(
Version("Twisted", 16, 3, 0))(Request.noLongerQueued)
class _DataLoss(Exception):
"""
L{_DataLoss} indicates that not all of a message body was received. This
is only one of several possible exceptions which may indicate that data
was lost. Because of this, it should not be checked for by
specifically; any unexpected exception should be treated as having
caused data loss.
"""
Twisted Web: HTTP clients and servers, plus tools for implementing them.
Contains a L{web server} (including an
L{HTTP implementation}, a
L{resource model}), and
a L{web client}.
"""
from incremental import Version
from twisted.python.deprecate import deprecatedModuleAttribute
from twisted._version import __version__ as version
__version__ = version.short()
deprecatedModuleAttribute(
Version("Twisted", 16, 0, 0),
"Use twisted.__version__ instead.",
"twisted.web", "__version__")
"""
A C{Request} is hashable so that it can be used as a mapping key.
@return A C{int} based on the instance's identity.
"""
return id(self)
Request.getClientIP = deprecated(
Version("Twisted", "NEXT", 0, 0),
replacement="getClientAddress",
)(Request.getClientIP)
Request.noLongerQueued = deprecated(
Version("Twisted", 16, 3, 0))(Request.noLongerQueued)
class _DataLoss(Exception):
"""
L{_DataLoss} indicates that not all of a message body was received. This
is only one of several possible exceptions which may indicate that data
was lost. Because of this, it should not be checked for by
specifically; any unexpected exception should be treated as having
caused data loss.
"""
class PotentialDataLoss(Exception):
"""
L{PotentialDataLoss} may be raised by a transfer encoding decoder's
def opt_port(self, port):
"""
(DEPRECATED: use --listen)
Strports description of port to start the server on
"""
msg = deprecate.getDeprecationWarningString(
self.opt_port, incremental.Version('Twisted', 18, 4, 0))
warnings.warn(msg, category=DeprecationWarning, stacklevel=2)
self['port'] = port
@deprecated(Version("Twisted", 16, 7, 0),
_GETPAGE_REPLACEMENT_TEXT)
def downloadPage(url, file, contextFactory=None, *args, **kwargs):
"""
Download a web page to a file.
@param file: path to file on filesystem, or file-like object.
See HTTPDownloader to see what extra args can be passed.
"""
factoryFactory = lambda url, *a, **kw: HTTPDownloader(url, file, *a, **kw)
return _makeGetterFactory(
url,
factoryFactory,
contextFactory=contextFactory,
*args, **kwargs).deferred