Skip to content

Commit

Permalink
Merge pull request #277 from fetchai/feature/cli_gui
Browse files Browse the repository at this point in the history
GUI bug fix
  • Loading branch information
DavidMinarsch authored Oct 18, 2019
2 parents 6b89ee7 + f7ed68e commit 4431d54
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions aea/cli_gui/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,19 +101,22 @@ def get_agents():
return agent_list


def get_registered_items(item_type):
"""Return list of all protocols, connections or skills in the registry."""
item_dir = os.path.join(flask.app.agents_dir, "packages/" + item_type + "s")

def _add_items(item_dir, item_type, items_list):
file_list = glob.glob(os.path.join(item_dir, '*'))

items_list = []

for path in file_list:
if is_item_dir(path, item_type):
head, tail = os.path.split(path)
desc = read_description(path, item_type)
items_list.append({"id": tail, "description": desc})
if not {"id": tail, "description": desc} in items_list:
items_list.append({"id": tail, "description": desc})


def get_registered_items(item_type):
"""Return list of all protocols, connections or skills in the registry."""
items_list = []

_add_items(os.path.join(flask.app.agents_dir, "packages/" + item_type + "s"), item_type, items_list)
_add_items(os.path.join(flask.app.module_dir, "aea/" + item_type + "s"), item_type, items_list)

return items_list

Expand Down

0 comments on commit 4431d54

Please sign in to comment.