Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 
 
 

34 Zeilen
666 B

  1. from contextlib import contextmanager
  2. try:
  3. import hiredis
  4. HIREDIS_AVAILABLE = True
  5. except ImportError:
  6. HIREDIS_AVAILABLE = False
  7. def from_url(url, db=None, **kwargs):
  8. """
  9. Returns an active Redis client generated from the given database URL.
  10. Will attempt to extract the database id from the path url fragment, if
  11. none is provided.
  12. """
  13. from redis.client import Redis
  14. return Redis.from_url(url, db, **kwargs)
  15. @contextmanager
  16. def pipeline(redis_obj):
  17. p = redis_obj.pipeline()
  18. yield p
  19. p.execute()
  20. class dummy(object):
  21. """
  22. Instances of this class can be used as an attribute container.
  23. """
  24. pass