From bdf0749ec3cf9593b73a7909411930789318d985 Mon Sep 17 00:00:00 2001 From: Ian Samir Yep Manzano Date: Mon, 12 Feb 2024 04:02:26 +0000 Subject: [PATCH 1/4] Update README.md Updated README to: 1) Include the oj-prepare config file path for macOS 2) Edit the English in the oj-prepare subsection to sound more natural --- README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 67dc772..f954889 100644 --- a/README.md +++ b/README.md @@ -189,8 +189,11 @@ Also you can use certain directory (when you use Linux, it's `~/.config/online-j ### oj-prepare -There is the config file for `oj-prepare` at `~/.config/online-judge-tools/prepare.config.toml` (in Linux). -Please write as the following. +The config file for `oj-prepare` can be found at the following paths according to your operating system: +`~/.config/online-judge-tools/prepare.config.toml` (Linux) +`/Users/{user_name}/Library/Application Support/online-judge-tools/prepare.config.toml` (MacOS) + +Please use the following format when editing the file: ``` toml contest_directory = "~/Desktop/{service_domain}/{contest_id}/{problem_id}" From 156c21a83260fadf51e486a32d0caf1e2ea89e2c Mon Sep 17 00:00:00 2001 From: Ian Samir Yep Manzano Date: Mon, 12 Feb 2024 08:49:26 +0000 Subject: [PATCH 2/4] Update README.ja.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit MacOSのoj-prepare の設定のファイルの場所を追加した。 --- README.ja.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.ja.md b/README.ja.md index d3156e3..bf3c54d 100644 --- a/README.ja.md +++ b/README.ja.md @@ -199,8 +199,7 @@ API ドキュメントは [onlinejudge_template.generator package](https://onlin ### oj-prepare -`oj-prepare` の設定は (Linux の場合は) `~/.config/online-judge-tools/prepare.config.toml` で行えます。 -以下のように書いてください。 +`oj-prepare` の設定は (Linux の場合は) `~/.config/online-judge-tools/prepare.config.toml` で行えます。MacOS の場合は `/Users/{user_name}/Library/Application Support/online-judge-tools/prepare.config.toml` で行えます。以下のように書いてください。 ``` toml contest_directory = "~/Desktop/{service_domain}/{contest_id}/{problem_id}" From cf921a4d2896dd4a13d0b4c14d561504fd0fb01c Mon Sep 17 00:00:00 2001 From: Hiroki Kobayashi <3303362+koba-e964@users.noreply.github.com> Date: Tue, 13 Feb 2024 18:31:39 +0900 Subject: [PATCH 3/4] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f954889..1485938 100644 --- a/README.md +++ b/README.md @@ -189,7 +189,7 @@ Also you can use certain directory (when you use Linux, it's `~/.config/online-j ### oj-prepare -The config file for `oj-prepare` can be found at the following paths according to your operating system: +The config file for `oj-prepare` can be found at the following paths depending on your operating system: `~/.config/online-judge-tools/prepare.config.toml` (Linux) `/Users/{user_name}/Library/Application Support/online-judge-tools/prepare.config.toml` (MacOS) From cb3a9a6feb4425f5c7e2728171c9948a782e5af0 Mon Sep 17 00:00:00 2001 From: t4-project Date: Thu, 26 Sep 2024 03:49:21 -0400 Subject: [PATCH 4/4] Replace pkg_resources with importlib --- onlinejudge_template/generator/_main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/onlinejudge_template/generator/_main.py b/onlinejudge_template/generator/_main.py index 26be2f3..79f4699 100644 --- a/onlinejudge_template/generator/_main.py +++ b/onlinejudge_template/generator/_main.py @@ -1,3 +1,4 @@ +import importlib.resources import pathlib from logging import getLogger from typing import * @@ -5,7 +6,6 @@ import appdirs import mako.lookup import mako.template -import pkg_resources import onlinejudge_template.generator.hook as hook from onlinejudge_template.types import * @@ -16,7 +16,7 @@ def _get_template(template_file: str) -> mako.template.Template: directories = [ str(pathlib.Path(appdirs.user_config_dir('online-judge-tools')) / 'template'), - pkg_resources.resource_filename('onlinejudge_template_resources', 'template'), + importlib.resources.files('onlinejudge_template_resources') / 'template', ] lookup = mako.lookup.TemplateLookup(directories=directories, input_encoding="utf-8", output_encoding="utf-8") path = pathlib.Path(template_file)