mirror of
https://github.com/xcat2/confluent.git
synced 2024-11-25 19:10:10 +00:00
More style tweaks for PEP8
This commit is contained in:
parent
1fc7a0716a
commit
5e79db5ca4
@ -15,5 +15,6 @@
|
||||
# limitations under the License.
|
||||
# Define types for TLV use in logs and other
|
||||
|
||||
|
||||
class Types(object):
|
||||
text, json = range(2)
|
||||
|
@ -734,9 +734,9 @@ class ConfigManager(object):
|
||||
for attr in attribmap[group].iterkeys():
|
||||
if (attr != 'nodes' and
|
||||
(attr not in allattributes.node or
|
||||
('type' in allattributes.node[attr] and not isinstance(
|
||||
attribmap[group][attr],
|
||||
allattributes.node[attr]['type'])))):
|
||||
('type' in allattributes.node[attr] and
|
||||
not isinstance(attribmap[group][attr],
|
||||
allattributes.node[attr]['type'])))):
|
||||
raise ValueError
|
||||
if attr == 'nodes':
|
||||
if not isinstance(attribmap[group][attr], list):
|
||||
@ -1056,4 +1056,3 @@ try:
|
||||
ConfigManager._read_from_path()
|
||||
except IOError:
|
||||
_cfgstore = {}
|
||||
|
||||
|
@ -52,7 +52,8 @@ def group_creation_resources():
|
||||
yield confluent.messages.Attributes(
|
||||
kv={'name': None}, desc="Name of the group").html() + '<br>'
|
||||
yield confluent.messages.ListAttributes(kv={'nodes': []},
|
||||
desc='Nodes to add to the group').html() + '<br>\n'
|
||||
desc='Nodes to add to the group'
|
||||
).html() + '<br>\n'
|
||||
for attr in sorted(attribs.node.iterkeys()):
|
||||
if attr == 'groups':
|
||||
continue
|
||||
@ -60,8 +61,8 @@ def group_creation_resources():
|
||||
yield confluent.messages.CryptedAttributes(
|
||||
kv={attr: None},
|
||||
desc=attribs.node[attr]['description']).html() + '<br>\n'
|
||||
elif 'type' in attribs.node[attr] and list == attribs.node[attr][
|
||||
'type']:
|
||||
elif ('type' in attribs.node[attr] and
|
||||
list == attribs.node[attr]['type']):
|
||||
yield confluent.messages.ListAttributes(
|
||||
kv={attr: []},
|
||||
desc=attribs.node[attr]['description']).html() + '<br>\n'
|
||||
@ -79,8 +80,8 @@ def node_creation_resources():
|
||||
yield confluent.messages.CryptedAttributes(
|
||||
kv={attr: None},
|
||||
desc=attribs.node[attr]['description']).html() + '<br>\n'
|
||||
elif 'type' in attribs.node[attr] and list == attribs.node[attr][
|
||||
'type']:
|
||||
elif ('type' in attribs.node[attr] and
|
||||
list == attribs.node[attr]['type']):
|
||||
yield confluent.messages.ListAttributes(
|
||||
kv={attr: []},
|
||||
desc=attribs.node[attr]['description']).html() + '<br>\n'
|
||||
@ -373,7 +374,8 @@ def resourcehandler_backend(env, start_response):
|
||||
def _assemble_html(responses, resource, querydict, url):
|
||||
yield '<html><head><title>' \
|
||||
'Confluent REST Explorer: ' + url + '</title></head>' \
|
||||
'<body><form action="' + resource + '" method="post">'
|
||||
'<body><form action="' + \
|
||||
resource + '" method="post">'
|
||||
if querydict:
|
||||
yield 'Response to input data:<br>' + \
|
||||
json.dumps(querydict, separators=(',', ': '),
|
||||
|
Loading…
Reference in New Issue
Block a user