Skip to content

Commit 2136841

Browse files
refactor: fix imports
1 parent 9e7dd9f commit 2136841

File tree

11 files changed

+31
-35
lines changed

11 files changed

+31
-35
lines changed

src/__init__.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +0,0 @@
1-
from .commands.show import show
2-
from .commands.profile import profile
3-
__version__ = "0.1.0"
4-
5-
__all__ = ["show", "profile"]

src/commands/daily.py

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
import typer
2-
from src.commands import show
3-
from src.commands.edit import edit
4-
from src.server.api import get_daily_question
2+
from .edit import edit
3+
from ..server.api import get_daily_question
54

65
def daily(
7-
lang: str = typer.Argument("python", help="Programming language to use."),
8-
editor: str = typer.Option("code", '-e', help="Code editor to use."),
6+
lang: str = typer.Argument("python", help="Programming language to use."),
7+
editor: str = typer.Option("code", '-e', help="Code editor to use."),
98
):
10-
"""Check the daily problem."""
11-
result = get_daily_question()
12-
question = result['data']['activeDailyCodingChallengeQuestion']
9+
"""Check the daily problem."""
10+
from .show import show
1311

14-
show(problem=question['question']['titleSlug'], layout=True)
12+
result = get_daily_question()
13+
question = result['data']['activeDailyCodingChallengeQuestion']
1514

16-
if editor:
17-
edit(problem=question['question']['titleSlug'], lang=lang, editor=editor)
15+
show(problem=question['question']['titleSlug'], layout=True)
16+
17+
if editor:
18+
edit(problem=question['question']['titleSlug'], lang=lang, editor=editor)

src/commands/edit.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import typer
22

3-
from src.server.solution_manager import SolutionManager
4-
from src.server.auth import Auth
5-
from commands.test import map_lang
3+
from ..server.solution_manager import SolutionManager
4+
from ..server.auth import Auth
5+
from .test import map_lang
66

77
solution_manager = SolutionManager(Auth().get_session())
88

src/commands/list_problems.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
from rich.spinner import Spinner
33
from rich.live import Live
44
from typing import Optional
5-
from src.lib.ui import display_problem_list
6-
from src.server.auth import Auth
5+
from ..lib.ui import display_problem_list
6+
from ..server.auth import Auth
77

88
import typer
99

10-
from src.server.api import fetch_problem_list
10+
from ..server.api import fetch_problem_list
1111

1212
status_map = {
1313
"attempted": "TRIED",

src/commands/login.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import typer
2-
from src.server.auth import Auth
2+
from ..server.auth import Auth
33

44
auth_manager = Auth()
55

src/commands/profile.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
from server.api import fetch_user_profile
1+
from ..server.api import fetch_user_profile
22
from rich.spinner import Spinner
3-
from src.lib.ui import display_user_stats
3+
from ..lib.ui import display_user_stats
44
from rich.live import Live
55

66
def profile():

src/commands/show.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import typer
22
from rich.console import Console
3-
from src.lib.problem_ui import ProblemDetails
4-
from src.server.auth import Auth
5-
from src.server.solution_manager import SolutionManager
3+
from ..lib.problem_ui import ProblemDetails
4+
from ..server.auth import Auth
5+
from ..server.solution_manager import SolutionManager
66

77
auth_manager = Auth()
88
solution_manager = SolutionManager(auth_manager.get_session())

src/commands/submit.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import typer
22
from pathlib import Path
3-
from src.server.auth import Auth
4-
from src.server.solution_manager import SolutionManager
3+
from ..server.auth import Auth
4+
from ..server.solution_manager import SolutionManager
55

66
auth_manager = Auth()
77
solution_manager = SolutionManager(auth_manager.get_session())

src/commands/test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import typer
22
from pathlib import Path
3-
from src.server.auth import Auth
4-
from src.server.solution_manager import SolutionManager
3+
from ..server.auth import Auth
4+
from ..server.solution_manager import SolutionManager
55

66
auth_manager = Auth()
77
solution_manager = SolutionManager(auth_manager.get_session())

src/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import profile
21
import typer
3-
from src import show, profile
42
from src.commands.daily import daily
3+
from src.commands.show import show
4+
from src.commands.profile import profile
55
from src.commands.edit import edit
66
from src.commands.list_problems import list_problems
77
from src.commands.login import login, logout

0 commit comments

Comments
 (0)