图片解析应用
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

94 lines
2.1 KiB

  1. import sys
  2. from redis import asyncio # noqa
  3. from redis.backoff import default_backoff
  4. from redis.client import Redis, StrictRedis
  5. from redis.cluster import RedisCluster
  6. from redis.connection import (
  7. BlockingConnectionPool,
  8. Connection,
  9. ConnectionPool,
  10. SSLConnection,
  11. UnixDomainSocketConnection,
  12. )
  13. from redis.credentials import CredentialProvider, UsernamePasswordCredentialProvider
  14. from redis.exceptions import (
  15. AuthenticationError,
  16. AuthenticationWrongNumberOfArgsError,
  17. BusyLoadingError,
  18. ChildDeadlockedError,
  19. ConnectionError,
  20. DataError,
  21. InvalidResponse,
  22. OutOfMemoryError,
  23. PubSubError,
  24. ReadOnlyError,
  25. RedisError,
  26. ResponseError,
  27. TimeoutError,
  28. WatchError,
  29. )
  30. from redis.sentinel import (
  31. Sentinel,
  32. SentinelConnectionPool,
  33. SentinelManagedConnection,
  34. SentinelManagedSSLConnection,
  35. )
  36. from redis.utils import from_url
  37. if sys.version_info >= (3, 8):
  38. from importlib import metadata
  39. else:
  40. import importlib_metadata as metadata
  41. def int_or_str(value):
  42. try:
  43. return int(value)
  44. except ValueError:
  45. return value
  46. try:
  47. __version__ = metadata.version("redis")
  48. except metadata.PackageNotFoundError:
  49. __version__ = "99.99.99"
  50. try:
  51. VERSION = tuple(map(int_or_str, __version__.split(".")))
  52. except AttributeError:
  53. VERSION = tuple([99, 99, 99])
  54. __all__ = [
  55. "AuthenticationError",
  56. "AuthenticationWrongNumberOfArgsError",
  57. "BlockingConnectionPool",
  58. "BusyLoadingError",
  59. "ChildDeadlockedError",
  60. "Connection",
  61. "ConnectionError",
  62. "ConnectionPool",
  63. "CredentialProvider",
  64. "DataError",
  65. "from_url",
  66. "default_backoff",
  67. "InvalidResponse",
  68. "OutOfMemoryError",
  69. "PubSubError",
  70. "ReadOnlyError",
  71. "Redis",
  72. "RedisCluster",
  73. "RedisError",
  74. "ResponseError",
  75. "Sentinel",
  76. "SentinelConnectionPool",
  77. "SentinelManagedConnection",
  78. "SentinelManagedSSLConnection",
  79. "SSLConnection",
  80. "UsernamePasswordCredentialProvider",
  81. "StrictRedis",
  82. "TimeoutError",
  83. "UnixDomainSocketConnection",
  84. "WatchError",
  85. ]