Removed deprecated methods

PYTHON-305
This commit is contained in:
Ross Lawley 2012-01-17 16:07:41 +00:00 committed by behackett
parent afcd0f6900
commit c67674bfa4
2 changed files with 0 additions and 54 deletions

View File

@ -405,18 +405,6 @@ if _use_c:
_dict_to_bson = _cbson._dict_to_bson
def _to_dicts(data, as_class=dict, tz_aware=True):
"""DEPRECATED - `_to_dicts` has been renamed to `decode_all`.
.. versionchanged:: 1.9
Deprecated in favor of :meth:`decode_all`.
.. versionadded:: 1.7
The `as_class` parameter.
"""
warnings.warn("`_to_dicts` has been renamed to `decode_all`",
DeprecationWarning)
return decode_all(data, as_class, tz_aware)
def decode_all(data, as_class=dict, tz_aware=True):
"""Decode BSON data to multiple documents.
@ -474,17 +462,6 @@ class BSON(str):
"""BSON (Binary JSON) data.
"""
@classmethod
def from_dict(cls, dct, check_keys=False, uuid_subtype=OLD_UUID_SUBTYPE):
"""DEPRECATED - `from_dict` has been renamed to `encode`.
.. versionchanged:: 1.9
Deprecated in favor of :meth:`encode`
"""
warnings.warn("`from_dict` has been renamed to `encode`",
DeprecationWarning)
return cls.encode(dct, check_keys, uuid_subtype)
@classmethod
def encode(cls, document, check_keys=False, uuid_subtype=OLD_UUID_SUBTYPE):
"""Encode a document to a new :class:`BSON` instance.
@ -507,20 +484,6 @@ class BSON(str):
"""
return cls(_dict_to_bson(document, check_keys, uuid_subtype))
def to_dict(self, as_class=dict, tz_aware=False):
"""DEPRECATED - `to_dict` has been renamed to `decode`.
.. versionchanged:: 1.9
Deprecated in favor of :meth:`decode`
.. versionadded:: 1.8
The `tz_aware` parameter.
.. versionadded:: 1.7
The `as_class` parameter.
"""
warnings.warn("`to_dict` has been renamed to `decode`",
DeprecationWarning)
return self.decode(as_class, tz_aware)
def decode(self, as_class=dict, tz_aware=False):
"""Decode this BSON data.

View File

@ -183,23 +183,6 @@ class BaseObject(object):
else:
self.__set_safe_option(option, value)
def __get_slave_okay(self):
"""DEPRECATED. Use `read_preference` instead.
.. versionchanged:: 2.1
Deprecated slave_okay.
.. versionadded:: 2.0
"""
return self.__slave_okay
def __set_slave_okay(self, value):
"""Property setter for slave_okay"""
warnings.warn("slave_okay is deprecated. Please use "
"read_preference instead.", DeprecationWarning)
self.__slave_okay = validate_boolean('slave_okay', value)
slave_okay = property(__get_slave_okay, __set_slave_okay)
def __get_read_pref(self):
"""The read preference for this instance.