Skip to content

Models

models

Classes:

Name Description
CommitInfo
WorkflowRunInfo

CommitInfo dataclass

CommitInfo(author: str, date: datetime, email: str, message: str, sha: str)

Methods:

Name Description
from_string

"--pretty=format:%h;%an;%ae;%ad;%s"

Attributes:

Name Type Description
age int

Returns the integer number of days since the commit date (truncates partial days).

age property

age: int

Returns the integer number of days since the commit date (truncates partial days).

from_string classmethod

from_string(output: str, sep: str = ';') -> CommitInfo

"--pretty=format:%h;%an;%ae;%ad;%s" 1. sha 2. author name 3. author email 4. date (ISO 8601 format) 5. commit message

Source code in oops/core/models.py
@classmethod
def from_string(cls, output: str, sep: str = ";") -> "CommitInfo":
    """ "--pretty=format:%h;%an;%ae;%ad;%s"
    1. sha
    2. author name
    3. author email
    4. date (ISO 8601 format)
    5. commit message
    """
    sha, author, email, date_str, message = output.split(sep, 4)
    commit_date = datetime.fromisoformat(date_str)
    return cls(
        sha=sha,
        author=author,
        email=email,
        date=commit_date,
        message=message,
    )

WorkflowRunInfo dataclass

WorkflowRunInfo(actor: str, branch: str, conclusion: str, date: datetime, event: str, name: str, sha: str, status: str, url: str)

Attributes:

Name Type Description
age int

Returns the integer number of days since the commit date (truncates partial days).

age property

age: int

Returns the integer number of days since the commit date (truncates partial days).