|
3 | 3 | from typing import AsyncGenerator, TYPE_CHECKING |
4 | 4 |
|
5 | 5 |
|
6 | | -import others.common as common |
7 | | -import others.error as exception |
8 | | -import sites.base as base |
9 | | -from sites.comment import Comment |
| 6 | +from ..others import common |
| 7 | +from ..others import error as exception |
| 8 | +from . import base |
| 9 | +from .comment import Comment |
10 | 10 |
|
11 | 11 | if TYPE_CHECKING: |
12 | | - from sites.session import Session |
13 | | - from sites.user import User |
14 | | - from sites.studio import Studio |
| 12 | + from .session import Session |
| 13 | + from .user import User |
| 14 | + from .studio import Studio |
15 | 15 |
|
16 | 16 | class Project(base._BaseSiteAPI): |
17 | 17 | raise_class = exception.ObjectNotFound |
@@ -51,7 +51,7 @@ def __init__( |
51 | 51 | self.remix_root:int|None = None |
52 | 52 |
|
53 | 53 | def _update_from_dict(self, data:dict) -> None: |
54 | | - from sites.user import User |
| 54 | + from .user import User |
55 | 55 | _author:dict = data.get("author",{}) |
56 | 56 | self.author = User(self.ClientSession,_author.get("username",None),self.Session) |
57 | 57 | self.author._update_from_dict(_author) |
@@ -137,7 +137,7 @@ async def download(self) -> dict: |
137 | 137 | def studios(self, *, limit=40, offset=0) -> AsyncGenerator["Studio",None]: |
138 | 138 | common.no_data_checker(self.author) |
139 | 139 | common.no_data_checker(self.author.username) |
140 | | - from sites.studio import Studio |
| 140 | + from .studio import Studio |
141 | 141 | return base.get_object_iterator( |
142 | 142 | self.ClientSession,f"https://api.scratch.mit.edu/users/{self.author.username}/projects/{self.id}/studios", |
143 | 143 | None,Studio,self.Session, |
@@ -187,7 +187,7 @@ def create_Partial_Project(project_id:int,author_name:"str|None"=None,*,ClientSe |
187 | 187 | ClientSession = common.create_ClientSession(ClientSession) |
188 | 188 | _project = Project(ClientSession,project_id) |
189 | 189 | if author_name is not None: |
190 | | - from sites.user import create_Partial_User |
| 190 | + from .user import create_Partial_User |
191 | 191 | _project.author = create_Partial_User(author_name,ClientSession=ClientSession) |
192 | 192 | return _project |
193 | 193 |
|
|
0 commit comments