Skip to content
This repository was archived by the owner on Apr 17, 2023. It is now read-only.

Commit 3605f4c

Browse files
committed
Move class Settings to models
1 parent b98f48c commit 3605f4c

File tree

4 files changed

+13
-9
lines changed

4 files changed

+13
-9
lines changed

main.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,11 @@
11
import json
2-
from typing import Optional
32

43
from playwright.sync_api import sync_playwright
5-
from pydantic import BaseModel
64

5+
from models import Settings
76
from utils import TwitterCrawler, VideoDownloader
87

98

10-
class Settings(BaseModel):
11-
username: str
12-
password: str
13-
recent_liked: str
14-
videos_path: Optional[str] = None
15-
16-
179
def get_settings() -> Settings:
1810
with open('settings.json', 'r', encoding='utf-8') as settings_file:
1911
settings_dict: dict[str, str] = json.load(settings_file)

models/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# pylint: disable=useless-import-alias
2+
from .settings import Settings as Settings

models/settings.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
from typing import Optional
2+
3+
from pydantic import BaseModel
4+
5+
6+
class Settings(BaseModel):
7+
username: str
8+
password: str
9+
recent_liked: str
10+
videos_path: Optional[str] = None

tests/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)