Example #1
0
def _getDeprecationWarningString(fqpn, version, format=None):
    """
	Return a string indicating that the Python name was deprecated in the given
	version.

	@type fqpn: C{str}
	@param fqpn: Fully qualified Python name of the thing being deprecated

	@type version: L{lib.twisted.python.versions.Version}
	@param version: Version that C{fqpn} was deprecated in

	@type format: C{str}
	@param format: A user-provided format to interpolate warning values into,
		or L{DEPRECATION_WARNING_FORMAT} if C{None} is given

	@rtype: C{str}
	@return: A textual description of the deprecation
	"""
    if format is None:
        format = DEPRECATION_WARNING_FORMAT
    return format % {'fqpn': fqpn, 'version': getVersionString(version)}
Example #2
0
def _getDeprecationWarningString(fqpn, version, format=None):
	"""
	Return a string indicating that the Python name was deprecated in the given
	version.

	@type fqpn: C{str}
	@param fqpn: Fully qualified Python name of the thing being deprecated

	@type version: L{lib.twisted.python.versions.Version}
	@param version: Version that C{fqpn} was deprecated in

	@type format: C{str}
	@param format: A user-provided format to interpolate warning values into,
		or L{DEPRECATION_WARNING_FORMAT} if C{None} is given

	@rtype: C{str}
	@return: A textual description of the deprecation
	"""
	if format is None:
		format = DEPRECATION_WARNING_FORMAT
	return format % {
		'fqpn': fqpn,
		'version': getVersionString(version)}
Example #3
0
def _getDeprecationDocstring(version):
    return "Deprecated in %s." % getVersionString(version)
Example #4
0
# -*- test-case-name: lib.twisted.test.test_enterprise -*-
# Copyright (c) 2001-2008 Twisted Matrix Laboratories.
# See LICENSE for details.

import warnings, types

from lib.twisted.python.versions import Version, getVersionString
from lib.twisted.python.deprecate import deprecated
from lib.twisted.enterprise.adbapi import _safe

# Common deprecation decorator used for all deprecations.
_deprecatedVersion = Version("Twisted", 8, 0, 0)
_releasedDeprecation = deprecated(_deprecatedVersion)

warnings.warn("lib.twisted.enterprise.util is deprecated since %s." %
              (getVersionString(_deprecatedVersion), ),
              category=DeprecationWarning)

NOQUOTE = 1
USEQUOTE = 2

dbTypeMap = {
    "bigint": NOQUOTE,
    "bool": USEQUOTE,
    "boolean": USEQUOTE,
    "bytea": USEQUOTE,
    "date": USEQUOTE,
    "int2": NOQUOTE,
    "int4": NOQUOTE,
    "int8": NOQUOTE,
    "int": NOQUOTE,
Example #5
0
def _getDeprecationDocstring(version):
	return "Deprecated in %s." % getVersionString(version)
Example #6
0
# See LICENSE for details.


import warnings, types

from lib.twisted.python.versions import Version, getVersionString
from lib.twisted.python.deprecate import deprecated
from lib.twisted.enterprise.adbapi import _safe

# Common deprecation decorator used for all deprecations.
_deprecatedVersion = Version("Twisted", 8, 0, 0)
_releasedDeprecation = deprecated(_deprecatedVersion)

warnings.warn(
	"lib.twisted.enterprise.util is deprecated since %s." % (
		getVersionString(_deprecatedVersion),),
	category=DeprecationWarning)

NOQUOTE = 1
USEQUOTE = 2

dbTypeMap = {
	"bigint": NOQUOTE,
	"bool": USEQUOTE,
	"boolean": USEQUOTE,
	"bytea": USEQUOTE,
	"date": USEQUOTE,
	"int2": NOQUOTE,
	"int4": NOQUOTE,
	"int8": NOQUOTE,
	"int": NOQUOTE,