Skip to content

Commit

Permalink
試験的な機能を削除
Browse files Browse the repository at this point in the history
  • Loading branch information
otkrickey committed Sep 19, 2023
1 parent 88cec3c commit 5895b03
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 13 deletions.
3 changes: 1 addition & 2 deletions letusc/models/account.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
from dataclasses import dataclass, field

from letusc.logger import L

from ..db import DBManager
from ..logger import L
from .base import BaseDatabase, BaseModel, attrs, from_api_attrs, to_api_attrs, types
from .cookie import Cookie
from .discord import DiscordUser, DiscordUserAny, DiscordUserBase
Expand Down
12 changes: 1 addition & 11 deletions letusc/models/page.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
from ..db import DBManager
from ..logger import L
from ..session import SessionManager
from ..util import env_bool
from .base import (
BaseDatabase,
BaseModel,
Expand Down Expand Up @@ -150,13 +149,6 @@ async def get(self, cookie: Cookie) -> bs4.BeautifulSoup:
html = await response.text()
return BeautifulSoup(html, "html.parser")

async def get_local(self) -> bs4.BeautifulSoup:
_l = self._l.gm("get_local")
_l.info(f"Requesting page: {self.url}")
with open(f"{self.page_id}.example.html", "r") as f:
html = f.read()
return BeautifulSoup(html, "html.parser")


@dataclass
class Page(PageBase):
Expand Down Expand Up @@ -233,9 +225,7 @@ async def parse(cls, code: PageCode, cookie: Cookie) -> "NewPage":
page = NewCoursePage(code.code)
case _:
raise ValueError(_l.c("UnknownPageType"))
soup = (
await page.get_local() if env_bool("USE_LOCAL") else await page.get(cookie)
)
soup = await page.get(cookie)
await page._parse(soup)
return page

Expand Down

0 comments on commit 5895b03

Please sign in to comment.