Python:Issue
Jump to navigation
Jump to search
from dataclasses import dataclass from typing import Optional import dacite @dataclass class Issue:
""" I am a an issue """ pageTitle:str item:Optional[str] # the item this issue references check:Optional[str] # the check this issue references fix:Optional[str] # a potential fix for the issue
@classmethod
def askQuery(cls):
"""
get the ask Query for Issue
Returns:
str: the mediawiki markup for the ask query
"""
ask="""
"""
return ask
@classmethod
def fromDict(cls,data:dict):
"""
create a Issue from the given dict
Args:
data(dict): the dict to create the Issue from
Returns:
Issue: the freshly created Issue
"""
issue=dacite.from_dict(data_class=cls,data=data)
return issue