mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 16:34:53 +01:00
added some typehints
This commit is contained in:
parent
2c362fb35f
commit
a1ed54c44d
1 changed files with 13 additions and 8 deletions
|
|
@ -27,12 +27,17 @@ PLUGIN_ORDER_OFFSET = 0.5
|
|||
|
||||
|
||||
class PublishErrorInfo:
|
||||
def __init__(self, description, title, detail):
|
||||
self.description = description
|
||||
self.title = title
|
||||
self.detail = detail
|
||||
def __init__(
|
||||
self,
|
||||
description: str,
|
||||
title: Optional[str],
|
||||
detail: Optional[str]
|
||||
):
|
||||
self.description: str = description
|
||||
self.title: Optional[str] = title
|
||||
self.detail: Optional[str] = detail
|
||||
|
||||
def __eq__(self, other):
|
||||
def __eq__(self, other: Any) -> bool:
|
||||
if not isinstance(other, PublishErrorInfo):
|
||||
return False
|
||||
return (
|
||||
|
|
@ -41,11 +46,11 @@ class PublishErrorInfo:
|
|||
and self.detail == other.detail
|
||||
)
|
||||
|
||||
def __ne__(self, other):
|
||||
def __ne__(self, other: Any) -> bool:
|
||||
return not self.__eq__(other)
|
||||
|
||||
@classmethod
|
||||
def from_exception(cls, exc):
|
||||
def from_exception(cls, exc) -> "PublishErrorInfo":
|
||||
if isinstance(exc, PublishArtistError):
|
||||
return cls(
|
||||
exc.description or exc.message,
|
||||
|
|
@ -60,7 +65,7 @@ class PublishErrorInfo:
|
|||
"Something went wrong. Send report"
|
||||
" to your supervisor or Ynput team."
|
||||
)
|
||||
return cls(msg, title)
|
||||
return cls(msg, title, None)
|
||||
|
||||
|
||||
class PublishReportMaker:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue