Skip to content
Snippets Groups Projects
Commit 1d9a3ded authored by Christopher Bohn's avatar Christopher Bohn :thinking:
Browse files

Replaced GitlabIssue.get_state() with is_open() & is_closed()

parent 7bb51fc6
No related branches found
No related tags found
No related merge requests found
from datetime import datetime, date from datetime import datetime, date
from deprecated import deprecated
from functools import reduce from functools import reduce
from typing import ClassVar, Dict, Iterable, List, Optional, Set, Union from typing import ClassVar, Dict, Iterable, List, Optional, Set, Union
...@@ -110,12 +111,25 @@ class GitlabIssue: ...@@ -110,12 +111,25 @@ class GitlabIssue:
""" """
return self.git_issue.description return self.git_issue.description
def get_state(self) -> str: # TODO, deprecate and replace with is_opened & is_closed @deprecated
def get_state(self) -> str: # TODO, delete after we're sure there are no uses
""" """
:return: opened or closed :return: opened or closed
""" """
return self.git_issue.state return self.git_issue.state
def is_open(self) -> bool:
"""
:return: True if the issue is open; False if the issue is closed
"""
return self.git_issue.state == 'opened'
def is_closed(self) -> bool:
"""
:return: True if the issue is closed; False if the issue is open
"""
return self.git_issue.state == 'closed'
def get_created_at(self) -> datetime: def get_created_at(self) -> datetime:
""" """
:return: an "aware" datetime object representing the creation date/time :return: an "aware" datetime object representing the creation date/time
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment