diff options
| author | Jordan Cook <jordan.cook@pioneer.com> | 2022-04-20 16:50:40 -0500 |
|---|---|---|
| committer | Jordan Cook <jordan.cook@pioneer.com> | 2022-04-22 17:28:33 -0500 |
| commit | 0dbd82d4d28875f2c0a592dfc89f50bf1c63cb2b (patch) | |
| tree | f3982671c81005c29c39fbd6da241e79509cc0cf /requests_cache/backends/__init__.py | |
| parent | 57579af3a5c4e683f2dd96f493471077808d1d39 (diff) | |
| download | requests-cache-0dbd82d4d28875f2c0a592dfc89f50bf1c63cb2b.tar.gz | |
Merge *PickleDict storage classes into parent classes
Diffstat (limited to 'requests_cache/backends/__init__.py')
| -rw-r--r-- | requests_cache/backends/__init__.py | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/requests_cache/backends/__init__.py b/requests_cache/backends/__init__.py index 7695b8f..9dd206a 100644 --- a/requests_cache/backends/__init__.py +++ b/requests_cache/backends/__init__.py @@ -15,35 +15,35 @@ logger = getLogger(__name__) # Import all backend classes for which dependencies are installed try: - from .dynamodb import DynamoDbCache, DynamoDbDict, DynamoDbDocumentDict + from .dynamodb import DynamoDbCache, DynamoDbDict except ImportError as e: - DynamoDbCache = DynamoDbDict = DynamoDbDocumentDict = get_placeholder_class(e) # type: ignore + DynamoDbCache = DynamoDbDict = get_placeholder_class(e) # type: ignore + try: - from .gridfs import GridFSCache, GridFSPickleDict + from .gridfs import GridFSCache, GridFSDict except ImportError as e: - GridFSCache = GridFSPickleDict = get_placeholder_class(e) # type: ignore + GridFSCache = GridFSDict = get_placeholder_class(e) # type: ignore + try: - from .mongodb import MongoCache, MongoDict, MongoDocumentDict + from .mongodb import MongoCache, MongoDict except ImportError as e: - MongoCache = MongoDict = MongoDocumentDict = get_placeholder_class(e) # type: ignore + MongoCache = MongoDict = get_placeholder_class(e) # type: ignore + try: from .redis import RedisCache, RedisDict, RedisHashDict except ImportError as e: RedisCache = RedisDict = RedisHashDict = get_placeholder_class(e) # type: ignore + try: - # Note: Heroku doesn't support SQLite due to ephemeral storage - from .sqlite import SQLiteCache, SQLiteDict, SQLitePickleDict + from .sqlite import SQLiteCache, SQLiteDict except ImportError as e: - SQLiteCache = SQLiteDict = SQLitePickleDict = get_placeholder_class(e) # type: ignore + SQLiteCache = SQLiteDict = get_placeholder_class(e) # type: ignore + try: from .filesystem import FileCache, FileDict except ImportError as e: FileCache = FileDict = get_placeholder_class(e) # type: ignore -# Aliases for backwards-compatibility -DbCache = SQLiteCache -DbDict = SQLiteDict -DbPickleDict = SQLitePickleDict BACKEND_CLASSES = { 'dynamodb': DynamoDbCache, |
