Skip to content

Commit

Permalink
refactored
Browse files Browse the repository at this point in the history
  • Loading branch information
lnxpy committed Nov 19, 2024
1 parent 0ef157f commit 8e82dc8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
12 changes: 6 additions & 6 deletions pyaction/issues/connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,23 @@
class IssueForm:
def __init__(self, repository: str, number: int, token: str | None = None) -> None:
"""
initializer
Initializer.
Args:
repository (str): repository name in the form of username/repository
number (int): issue number/ID
repository (str): Repository name in the form of username/repository.
number (int): Issue number/ID.
token (str, optional): GITHUB_TOKEN token. Defaults to None.
"""
self._token = token
self.repository = repository
self.number = number
self._token = token

def render(self) -> dict[str, str]:
"""
renders the issue body
Renders the issue body.
Returns:
OrderedDict: the issue body in form of dictionary
dict[str, str]: The issue body in form of dictionary.
"""
headers = {"Accept": "application/vnd.github+json"}

Expand Down
16 changes: 8 additions & 8 deletions pyaction/issues/rendering.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
from __future__ import annotations

import re
from typing import Dict


class IssueTemplate:
def __init__(self, context: str) -> None:
"""initializer
"""
Initializer.
Args:
context (str): issue body
context (str): The issue body.
"""
self.context = context

def to_dict(self) -> dict[str, str]:
"""converting the issue body to dictionary
def to_dict(self) -> Dict[str, str]:
"""
Converting the issue body to dictionary.
Returns:
Dict[str, str]: issue body in form of dictionary
Dict[str, str]: Issue body in form of dictionary.
"""

pattern = re.compile("### ([^\n]+)\n\n([^#]+)")
matches = pattern.findall(self.context)

Expand Down

0 comments on commit 8e82dc8

Please sign in to comment.