Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

♻️ 공통 constants 분리 #80

Merged
merged 1 commit into from
Feb 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions pyrb/controllers/cli/account.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
from pathlib import Path
from typing import Annotated

import typer

from pyrb.controllers.constants import APP_DIR
from pyrb.enums import BrokerageType
from pyrb.models.account import AccountFactory
from pyrb.repositories.account import LocalConfigAccountRepository
from pyrb.services.account import AccountService

app = typer.Typer()
APP_NAME = "pyrb" # TODO: parse from pyproject.toml and move to constants.py


@app.command("set")
Expand All @@ -26,8 +25,8 @@ def set(


def create_account_service() -> AccountService:
app_config_dir = Path(typer.get_app_dir(APP_NAME))
accounts_config_path = app_config_dir / "accounts"
app_dir = APP_DIR
accounts_config_path = app_dir / "accounts"

account_service = AccountService(
account_repo=LocalConfigAccountRepository(accounts_config_path)
Expand Down
6 changes: 6 additions & 0 deletions pyrb/controllers/constants.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from pathlib import Path

import typer

APP_NAME = "pyrb" # TODO: parse from pyproject.toml and move to constants.py
APP_DIR = Path(typer.get_app_dir(APP_NAME))