Merge "[Part 10] Remove all usage of six library"
This commit is contained in:
commit
14c3ffbe8e
@ -21,7 +21,7 @@ from gevent import monkey as curious_george
|
|||||||
curious_george.patch_all(thread=False, select=False)
|
curious_george.patch_all(thread=False, select=False)
|
||||||
import gevent
|
import gevent
|
||||||
import marktime
|
import marktime
|
||||||
from six.moves import urllib
|
import urllib
|
||||||
from zaqarclient.transport import errors
|
from zaqarclient.transport import errors
|
||||||
|
|
||||||
from zaqar.bench import config
|
from zaqar.bench import config
|
||||||
|
@ -33,7 +33,7 @@ class Api(object):
|
|||||||
|
|
||||||
:param action: Action for which params need
|
:param action: Action for which params need
|
||||||
to be validated.
|
to be validated.
|
||||||
:type action: `six.text_type`
|
:type action: `str`
|
||||||
|
|
||||||
:returns: Action's schema
|
:returns: Action's schema
|
||||||
:rtype: dict
|
:rtype: dict
|
||||||
@ -57,7 +57,7 @@ class Api(object):
|
|||||||
|
|
||||||
:param action: Action's for which body need
|
:param action: Action's for which body need
|
||||||
to be validated.
|
to be validated.
|
||||||
:type action: `six.text_type`
|
:type action: `str`
|
||||||
:param body: Params to validate
|
:param body: Params to validate
|
||||||
:type body: dict
|
:type body: dict
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ class Request(object):
|
|||||||
:param headers: Request headers. Default: None
|
:param headers: Request headers. Default: None
|
||||||
:type headers: dict
|
:type headers: dict
|
||||||
:param api: Api entry point. i.e: 'queues.v1'
|
:param api: Api entry point. i.e: 'queues.v1'
|
||||||
:type api: `six.text_type`.
|
:type api: `str`.
|
||||||
:param env: Request environment. Default: None
|
:param env: Request environment. Default: None
|
||||||
:type env: dict
|
:type env: dict
|
||||||
"""
|
"""
|
||||||
|
@ -24,7 +24,7 @@ class Response(object):
|
|||||||
:param request: The request sent to the server.
|
:param request: The request sent to the server.
|
||||||
:type request: `zaqar.transport.request.Request`
|
:type request: `zaqar.transport.request.Request`
|
||||||
:param body: Response's body
|
:param body: Response's body
|
||||||
:type body: `six.string_types`
|
:type body: `str`
|
||||||
:param headers: Optional headers returned in the response.
|
:param headers: Optional headers returned in the response.
|
||||||
:type headers: dict
|
:type headers: dict
|
||||||
"""
|
"""
|
||||||
|
@ -32,7 +32,6 @@ them do, an AttributeError exception will be raised.
|
|||||||
import contextlib
|
import contextlib
|
||||||
|
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
import six
|
|
||||||
|
|
||||||
from zaqar.common import decorators
|
from zaqar.common import decorators
|
||||||
from zaqar.i18n import _
|
from zaqar.i18n import _
|
||||||
@ -58,7 +57,7 @@ class Pipeline(object):
|
|||||||
for `method`.
|
for `method`.
|
||||||
|
|
||||||
:params method: The method name to call on each stage
|
:params method: The method name to call on each stage
|
||||||
:type method: `six.text_type`
|
:type method: `str`
|
||||||
|
|
||||||
:returns: A callable to consume the pipeline.
|
:returns: A callable to consume the pipeline.
|
||||||
"""
|
"""
|
||||||
@ -88,7 +87,7 @@ class Pipeline(object):
|
|||||||
try:
|
try:
|
||||||
target = getattr(stage, method)
|
target = getattr(stage, method)
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
sstage = six.text_type(stage)
|
sstage = str(stage)
|
||||||
msgtmpl = _(u"Stage %(stage)s does not "
|
msgtmpl = _(u"Stage %(stage)s does not "
|
||||||
"implement %(method)s")
|
"implement %(method)s")
|
||||||
LOG.debug(msgtmpl, {'stage': sstage, 'method': method})
|
LOG.debug(msgtmpl, {'stage': sstage, 'method': method})
|
||||||
|
@ -25,7 +25,7 @@ def weighted(objs, key='weight', generator=random.randint):
|
|||||||
:param objs: a list of objects containing at least the field `key`
|
:param objs: a list of objects containing at least the field `key`
|
||||||
:type objs: [dict]
|
:type objs: [dict]
|
||||||
:param key: the field in each obj that corresponds to weight
|
:param key: the field in each obj that corresponds to weight
|
||||||
:type key: six.text_type
|
:type key: str
|
||||||
:param generator: a number generator taking two ints
|
:param generator: a number generator taking two ints
|
||||||
:type generator: function(int, int) -> int
|
:type generator: function(int, int) -> int
|
||||||
:return: an object
|
:return: an object
|
||||||
|
Loading…
Reference in New Issue
Block a user