Skip to content

Commit

Permalink
Refactor user config path setting (#257)
Browse files Browse the repository at this point in the history
Co-authored-by: Kazuma Mikami <tyotyo3@gmail.com>
  • Loading branch information
pogin503 and kyuridenamida committed Jun 8, 2024
1 parent d33504b commit f3c8423
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
5 changes: 1 addition & 4 deletions atcodertools/tools/compiler.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
#!/usr/bin/python3
import argparse
from os.path import expanduser

from atcodertools.executils.run_command import run_command_with_returncode
from atcodertools.tools.models.metadata import Metadata
from atcodertools.common.language import Language
import os
import pathlib
from atcodertools.config.config import Config, ConfigType
from atcodertools.config.config import Config, ConfigType, USER_CONFIG_PATH
from atcodertools.tools import get_default_config_path

USER_CONFIG_PATH = os.path.join(expanduser("~"), ".atcodertools.toml")


class BadStatusCodeException(Exception):
pass
Expand Down
7 changes: 1 addition & 6 deletions atcodertools/tools/envgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import sys
import traceback
from multiprocessing import Pool, cpu_count
from os.path import expanduser
import time
from typing import Tuple

Expand All @@ -28,7 +27,7 @@
from atcodertools.tools import get_default_config_path
from atcodertools.tools.models.metadata import Metadata
from atcodertools.tools.utils import with_color
from atcodertools.config.config import ConfigType
from atcodertools.config.config import ConfigType, USER_CONFIG_PATH


class BannedFileDetectedError(Exception):
Expand Down Expand Up @@ -223,10 +222,6 @@ def prepare_contest(atcoder_client: AtCoderClient,
contest_dir_path)


USER_CONFIG_PATH = os.path.join(
expanduser("~"), ".atcodertools.toml")


def get_config(args: argparse.Namespace) -> Config:
def _load(path: str) -> Config:
logger.info("Going to load {} as config".format(path))
Expand Down

0 comments on commit f3c8423

Please sign in to comment.