Bump hacking
hacking 3.0.x is too old. Bump it to the version currently used in mistral repo. Change-Id: I5483b461fe626f3dc2768ca0f8b78100c7e9c2a1
This commit is contained in:
parent
c82883e771
commit
794fd4bdd5
@ -180,7 +180,7 @@ def get_file_list(directory, package='mistral'):
|
|||||||
if path.isfile(path.join(base_path, f))]
|
if path.isfile(path.join(base_path, f))]
|
||||||
|
|
||||||
|
|
||||||
def cut_dict(d, length=100):
|
def cut_dict(dict_data, length=100):
|
||||||
"""Removes dictionary entries according to the given length.
|
"""Removes dictionary entries according to the given length.
|
||||||
|
|
||||||
This method removes a number of entries, if needed, so that a
|
This method removes a number of entries, if needed, so that a
|
||||||
@ -197,18 +197,18 @@ def cut_dict(d, length=100):
|
|||||||
be only approximately equal to the given value (up to around several
|
be only approximately equal to the given value (up to around several
|
||||||
chars difference).
|
chars difference).
|
||||||
|
|
||||||
:param d: A dictionary.
|
:param dict_data: A dictionary.
|
||||||
:param length: A length limiting the dictionary string representation.
|
:param length: A length limiting the dictionary string representation.
|
||||||
:return: A dictionary which is a subset of the given dictionary.
|
:return: A dictionary which is a subset of the given dictionary.
|
||||||
"""
|
"""
|
||||||
if not isinstance(d, dict):
|
if not isinstance(dict_data, dict):
|
||||||
raise ValueError("A dictionary is expected, got: %s" % type(d))
|
raise ValueError("A dictionary is expected, got: %s" % type(dict_data))
|
||||||
|
|
||||||
res = "{"
|
res = "{"
|
||||||
|
|
||||||
idx = 0
|
idx = 0
|
||||||
|
|
||||||
for key, value in d.items():
|
for key, value in dict_data.items():
|
||||||
k = str(key)
|
k = str(key)
|
||||||
v = str(value)
|
v = str(value)
|
||||||
|
|
||||||
@ -242,7 +242,7 @@ def cut_dict(d, length=100):
|
|||||||
else:
|
else:
|
||||||
res += "'%s'" % v if is_str else v
|
res += "'%s'" % v if is_str else v
|
||||||
|
|
||||||
res += ', ' if idx < len(d) - 1 else '}'
|
res += ', ' if idx < len(dict_data) - 1 else '}'
|
||||||
|
|
||||||
idx += 1
|
idx += 1
|
||||||
|
|
||||||
@ -252,19 +252,19 @@ def cut_dict(d, length=100):
|
|||||||
return res
|
return res
|
||||||
|
|
||||||
|
|
||||||
def cut_list(l, length=100):
|
def cut_list(list_data, length=100):
|
||||||
"""Truncates string representation of a list for a given length.
|
"""Truncates string representation of a list for a given length.
|
||||||
|
|
||||||
:param l: list to truncate
|
:param list_data: list to truncate
|
||||||
:param length: amount of characters to truncate to
|
:param length: amount of characters to truncate to
|
||||||
:return: string containing given length of characters from the list
|
:return: string containing given length of characters from the list
|
||||||
"""
|
"""
|
||||||
if not isinstance(l, list):
|
if not isinstance(list_data, list):
|
||||||
raise ValueError("A list is expected, got: %s" % type(l))
|
raise ValueError("A list is expected, got: %s" % type(list_data))
|
||||||
|
|
||||||
res = '['
|
res = '['
|
||||||
|
|
||||||
for idx, item in enumerate(l):
|
for idx, item in enumerate(list_data):
|
||||||
s = str(item)
|
s = str(item)
|
||||||
|
|
||||||
new_len = len(res) + len(s)
|
new_len = len(res) + len(s)
|
||||||
@ -279,7 +279,7 @@ def cut_list(l, length=100):
|
|||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
res += "'%s'" % s if is_str else s
|
res += "'%s'" % s if is_str else s
|
||||||
res += ', ' if idx < len(l) - 1 else ']'
|
res += ', ' if idx < len(list_data) - 1 else ']'
|
||||||
|
|
||||||
if 0 <= length <= len(res) and res[length - 1] != ']':
|
if 0 <= length <= len(res) and res[length - 1] != ']':
|
||||||
res = res[:length - 3] + '...'
|
res = res[:length - 3] + '...'
|
||||||
@ -287,17 +287,17 @@ def cut_list(l, length=100):
|
|||||||
return res
|
return res
|
||||||
|
|
||||||
|
|
||||||
def cut_string(s, length=100):
|
def cut_string(str_data, length=100):
|
||||||
"""Truncates a string for a given length.
|
"""Truncates a string for a given length.
|
||||||
|
|
||||||
:param s: string to truncate
|
:param s: string to truncate
|
||||||
:param length: amount of characters to truncate to
|
:param length: amount of characters to truncate to
|
||||||
:return: string containing given length of characters
|
:return: string containing given length of characters
|
||||||
"""
|
"""
|
||||||
if 0 <= length < len(s):
|
if 0 <= length < len(str_data):
|
||||||
return "%s..." % s[:length]
|
return "%s..." % str_data[:length]
|
||||||
|
|
||||||
return s
|
return str_data
|
||||||
|
|
||||||
|
|
||||||
def cut(data, length=100):
|
def cut(data, length=100):
|
||||||
|
@ -1,7 +1,3 @@
|
|||||||
# The order of packages is significant, because pip processes them in the order
|
|
||||||
# of appearance. Changing the order has an impact on the overall integration
|
|
||||||
# process, which may cause wedges in the gate later.
|
|
||||||
|
|
||||||
eventlet!=0.20.1,>=0.20.0 # MIT
|
eventlet!=0.20.1,>=0.20.0 # MIT
|
||||||
oslo.log>=3.36.0 # Apache-2.0
|
oslo.log>=3.36.0 # Apache-2.0
|
||||||
pbr!=2.1.0,>=2.0.0 # Apache-2.0
|
pbr!=2.1.0,>=2.0.0 # Apache-2.0
|
||||||
|
@ -1,8 +1,4 @@
|
|||||||
# The order of packages is significant, because pip processes them in the order
|
hacking>=6.1.0,<6.2.0 # Apache-2.0
|
||||||
# of appearance. Changing the order has an impact on the overall integration
|
|
||||||
# process, which may cause wedges in the gate later.
|
|
||||||
|
|
||||||
hacking>=3.0.1,<3.1.0 # Apache-2.0
|
|
||||||
doc8>=0.6.0 # Apache-2.0
|
doc8>=0.6.0 # Apache-2.0
|
||||||
Pygments>=2.2.0 # BSD license
|
Pygments>=2.2.0 # BSD license
|
||||||
coverage!=4.4,>=4.0 # Apache-2.0
|
coverage!=4.4,>=4.0 # Apache-2.0
|
||||||
|
Loading…
Reference in New Issue
Block a user