Skip to content

Commit 10cec0e

Browse files
committed
feat: ocular status typing
solves #464
1 parent dcf8966 commit 10cec0e

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

scratchattach/site/user.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import re
77
import string
88
import warnings
9-
from typing import Union, cast, Optional
9+
from typing import Union, cast, Optional, TypedDict
1010
from dataclasses import dataclass, field
1111
from datetime import datetime, timezone
1212
from enum import Enum
@@ -39,6 +39,17 @@ class Rank(Enum):
3939
SCRATCHER = 1
4040
SCRATCH_TEAM = 2
4141

42+
class _OcularStatusMeta(TypedDict):
43+
updated: str
44+
updatedBy: str
45+
46+
class _OcularStatus(TypedDict):
47+
_id: str
48+
name: str
49+
status: str
50+
color: str
51+
meta: _OcularStatusMeta
52+
4253
class Verificator:
4354

4455
def __init__(self, user: User, project_id: int):
@@ -894,7 +905,7 @@ def ranks(self):
894905
except Exception:
895906
return {"country":{"loves":0,"favorites":0,"comments":0,"views":0,"followers":0,"following":0},"loves":0,"favorites":0,"comments":0,"views":0,"followers":0,"following":0}
896907

897-
def ocular_status(self):
908+
def ocular_status(self) -> _OcularStatus:
898909
"""
899910
Gets information about the user's ocular status. Ocular is a website developed by jeffalo: https://ocular.jeffalo.net/
900911

0 commit comments

Comments
 (0)