Commit 02e2992d authored by ‮rekcäH nitraM‮'s avatar rekcäH nitraM Committed by Michael Howitz

Warn about deprecation at runtime (#15)

* Document deprecation of this package.
* Document suggested alternatives.
* Warn at runtime about the deprecation status of the package so developers using it can get a hint even when they don't read the readme of this package.
parent c5d99c2a
...@@ -20,6 +20,7 @@ This is a ripoff of Jim's Packless bsddb3 storage. ...@@ -20,6 +20,7 @@ This is a ripoff of Jim's Packless bsddb3 storage.
""" """
import bisect import bisect
from logging import getLogger from logging import getLogger
import warnings
import time import time
from ZODB import POSException from ZODB import POSException
...@@ -84,6 +85,14 @@ class TemporaryStorage(BaseStorage, ConflictResolvingStorage): ...@@ -84,6 +85,14 @@ class TemporaryStorage(BaseStorage, ConflictResolvingStorage):
_conflict_cache_maxage -- age at whic conflict cache items are GC'ed _conflict_cache_maxage -- age at whic conflict cache items are GC'ed
""" """
deprecation_warning = """\
DEPRECATED: Usage of the package tempstorage is deprecated, as it is known to randomly lose data.
Especially on Zope 4. For details see https://github.com/zopefoundation/tempstorage/issues/8
and https://github.com/zopefoundation/tempstorage
"""
LOG.warning(deprecation_warning)
warnings.warn(deprecation_warning, DeprecationWarning)
BaseStorage.__init__(self, name) BaseStorage.__init__(self, name)
self._index = {} self._index = {}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment