Skip to content

Commit

Permalink
♻️ 공통 constants 분리 (#80)
Browse files Browse the repository at this point in the history
  • Loading branch information
mingi3314 authored Feb 18, 2024
1 parent 0c22dda commit b5122f1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
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))

0 comments on commit b5122f1

Please sign in to comment.