Skip to content

Commit 37f0902

Browse files
committed
formatted
1 parent a35ac49 commit 37f0902

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

src/ontobot_change_agent/api.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,8 @@ def get_issues(
9797
else:
9898
yield None
9999

100-
def get_comment_from_repo(repository_name: str, token: str = None, comment_id:int = 0):
100+
101+
def get_comment_from_repo(repository_name: str, token: str = None, comment_id: int = 0):
101102
"""Get a comment from a Github repository."""
102103
repo = _get_repo_object(repository_name, token)
103104

@@ -106,6 +107,7 @@ def get_comment_from_repo(repository_name: str, token: str = None, comment_id:in
106107
return comment.body
107108
return None
108109

110+
109111
def _get_repo_object(repository_name: str, token: str = None):
110112
if token is None:
111113
token_file = TOKEN_FILE
@@ -115,6 +117,7 @@ def _get_repo_object(repository_name: str, token: str = None):
115117
g = Github(token)
116118
return g.get_repo(repository_name)
117119

120+
118121
def _extract_info_from_issue_object(issue: Issue) -> dict:
119122
issue_as_dict = issue.__dict__
120123
important_info = {k: issue_as_dict[RAW_DATA][k] for k in ISSUE_KEYS}

src/ontobot_change_agent/cli.py

+9-3
Original file line numberDiff line numberDiff line change
@@ -194,10 +194,14 @@ def process_issue(
194194

195195
if comment_id:
196196
formatted_body = "The following commands were executed: </br> "
197-
comment_body = get_comment_from_repo(repository_name=repo, token=token, comment_id=comment_id)
197+
comment_body = get_comment_from_repo(
198+
repository_name=repo, token=token, comment_id=comment_id
199+
)
198200
KGCL_COMMANDS = _get_kgcl_commands(comment_body)
199-
issue = next(get_issues(repository_name=repo, token=token, label=label, number=number, state=state))
200-
201+
issue = next(
202+
get_issues(repository_name=repo, token=token, label=label, number=number, state=state)
203+
)
204+
201205
else:
202206
for issue in get_issues(
203207
repository_name=repo, token=token, label=label, number=number, state=state
@@ -282,6 +286,7 @@ def _convert_to_markdown(item: Union[list, dict]) -> str:
282286
md += bullet + k + ":" + str(v) + "</br>"
283287
return md
284288

289+
285290
def _get_kgcl_commands(issue_body: str) -> list:
286291
KGCL_COMMANDS = []
287292
bullet_starters = ["* ", "- "]
@@ -296,6 +301,7 @@ def _get_kgcl_commands(issue_body: str) -> list:
296301
KGCL_COMMANDS = [x.strip() for x in KGCL_COMMANDS]
297302
return KGCL_COMMANDS
298303

304+
299305
@main.command("update-readme")
300306
@input_argument
301307
def get_implementers(input: str):

0 commit comments

Comments
 (0)