mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-20 21:33:13 -07:00
Updated stevedore to 2.0.1
This commit is contained in:
parent
f1624a586f
commit
fb6011f88d
52 changed files with 581 additions and 1960 deletions
10
libs/common/dogpile/cache/util.py
vendored
10
libs/common/dogpile/cache/util.py
vendored
|
@ -4,7 +4,7 @@ from ..util import compat
|
|||
from ..util import langhelpers
|
||||
|
||||
|
||||
def function_key_generator(namespace, fn, to_str=str):
|
||||
def function_key_generator(namespace, fn, to_str=compat.string_type):
|
||||
"""Return a function that generates a string
|
||||
key, based on a given function as well as
|
||||
arguments to the returned function itself.
|
||||
|
@ -45,7 +45,7 @@ def function_key_generator(namespace, fn, to_str=str):
|
|||
return generate_key
|
||||
|
||||
|
||||
def function_multi_key_generator(namespace, fn, to_str=str):
|
||||
def function_multi_key_generator(namespace, fn, to_str=compat.string_type):
|
||||
|
||||
if namespace is None:
|
||||
namespace = "%s:%s" % (fn.__module__, fn.__name__)
|
||||
|
@ -68,7 +68,7 @@ def function_multi_key_generator(namespace, fn, to_str=str):
|
|||
return generate_keys
|
||||
|
||||
|
||||
def kwarg_function_key_generator(namespace, fn, to_str=str):
|
||||
def kwarg_function_key_generator(namespace, fn, to_str=compat.string_type):
|
||||
"""Return a function that generates a string
|
||||
key, based on a given function as well as
|
||||
arguments to the returned function itself.
|
||||
|
@ -131,7 +131,7 @@ def kwarg_function_key_generator(namespace, fn, to_str=str):
|
|||
def sha1_mangle_key(key):
|
||||
"""a SHA1 key mangler."""
|
||||
|
||||
if isinstance(key, str):
|
||||
if isinstance(key, compat.text_type):
|
||||
key = key.encode("utf-8")
|
||||
|
||||
return sha1(key).hexdigest()
|
||||
|
@ -162,7 +162,7 @@ PluginLoader = langhelpers.PluginLoader
|
|||
to_list = langhelpers.to_list
|
||||
|
||||
|
||||
class repr_obj:
|
||||
class repr_obj(object):
|
||||
|
||||
__slots__ = ("value", "max_chars")
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue