Skip to content

Commit

Permalink
Fix: data corruption exception
Browse files Browse the repository at this point in the history
  • Loading branch information
mosoriob committed Aug 14, 2019
1 parent c54212c commit b48a198
Showing 1 changed file with 19 additions and 16 deletions.
35 changes: 19 additions & 16 deletions src/wcm/_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,28 +27,31 @@ def list_components(profile="default"):
component = wings_instance.component.get_all_items()
component = component["children"]
for i in component:
comp_class = ((i["cls"])["component"])["id"]
comp_class = comp_class.split('#')
try:
comp_class = ((i["cls"])["component"])["id"]
comp_class = comp_class.split('#')

outp += "[" + comp_class[-1] + "]\n"
outp += "[" + comp_class[-1] + "]\n"

length = len(i["children"])
count = 1
length = len(i["children"])
count = 1

if length > 0:
outp += " └─┐\n"
if length > 0:
outp += " └─┐\n"

for j in i["children"]:
comp_id = ((j["cls"])["component"])["id"]
comp_id = comp_id.split('#')
for j in i["children"]:
comp_id = ((j["cls"])["component"])["id"]
comp_id = comp_id.split('#')

if length == 1 or count == length:
outp += " └─ " + comp_id[-1] + "\n"
else:
outp += " ├─ " + comp_id[-1] + "\n"
count += 1
if length == 1 or count == length:
outp += " └─ " + comp_id[-1] + "\n"
else:
outp += " ├─ " + comp_id[-1] + "\n"
count += 1

outp += "\n"
outp += "\n"
except:
logger.error("Wings error: Maybe, the component is corrupted.")

click.echo(outp)

Expand Down

0 comments on commit b48a198

Please sign in to comment.