Skip to content

Commit 8dbb771

Browse files
committed
Refactor: fix better var name & fix help sentences starting with a lower-case letter
1 parent 88a2e63 commit 8dbb771

File tree

3 files changed

+25
-27
lines changed

3 files changed

+25
-27
lines changed

atcodertools/tools/envgen.py

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -207,9 +207,9 @@ def check_lang(lang: str):
207207
return lang
208208

209209

210-
PRIMARY_DEFAULT_CONFIG_PATH = os.path.join(
210+
USER_CONFIG_PATH = os.path.join(
211211
expanduser("~"), ".atcodertools.toml")
212-
SECONDARY_DEFAULT_CONFIG_PATH = os.path.abspath(
212+
DEFAULT_CONFIG_PATH = os.path.abspath(
213213
os.path.join(script_dir_path, "./atcodertools-default.toml"))
214214

215215

@@ -222,10 +222,10 @@ def _load(path: str):
222222
if config_path:
223223
return _load(config_path)
224224

225-
if os.path.exists(PRIMARY_DEFAULT_CONFIG_PATH):
226-
return _load(PRIMARY_DEFAULT_CONFIG_PATH)
225+
if os.path.exists(USER_CONFIG_PATH):
226+
return _load(USER_CONFIG_PATH)
227227

228-
return _load(SECONDARY_DEFAULT_CONFIG_PATH)
228+
return _load(DEFAULT_CONFIG_PATH)
229229

230230

231231
def main(prog, args):
@@ -234,35 +234,34 @@ def main(prog, args):
234234
formatter_class=argparse.RawTextHelpFormatter)
235235

236236
parser.add_argument("contest_id",
237-
help="contest ID (e.g. arc001)")
237+
help="Contest ID (e.g. arc001)")
238238

239239
parser.add_argument("--without-login",
240240
action="store_true",
241-
help="download data without login")
241+
help="Download data without login")
242242

243243
parser.add_argument("--workspace",
244-
help="path to workspace's root directory. This script will create files"
244+
help="Path to workspace's root directory. This script will create files"
245245
" in {{WORKSPACE}}/{{contest_name}}/{{alphabet}}/ e.g. ./your-workspace/arc001/A/\n"
246246
"[Default] {}".format(DEFAULT_WORKSPACE_DIR_PATH),
247247
default=DEFAULT_WORKSPACE_DIR_PATH)
248248

249249
parser.add_argument("--lang",
250-
help="programming language of your template code, {}.\n"
250+
help="Programming language of your template code, {}.\n"
251251
.format(" or ".join(SUPPORTED_LANGUAGES)) + "[Default] {}".format(DEFAULT_LANG),
252252
default=DEFAULT_LANG,
253253
type=check_lang)
254254

255255
parser.add_argument("--template",
256-
help="{0}{1}".format("file path to your template code\n"
257-
"[Default (C++)] {}\n".format(
258-
get_default_template_path('cpp')),
259-
"[Default (Java)] {}".format(
260-
get_default_template_path('java')))
256+
help="File path to your template code\n{0}{1}".format(
257+
"[Default (C++)] {}\n".format(
258+
get_default_template_path('cpp')),
259+
"[Default (Java)] {}".format(
260+
get_default_template_path('java')))
261261
)
262262

263263
parser.add_argument("--replacement",
264-
help="{0}{1}".format(
265-
"file path to the replacement code created when template generation is failed.\n"
264+
help="File path to your config file\n{0}{1}".format(
266265
"[Default (C++)] {}\n".format(get_default_replacement_path('cpp')),
267266
"[Default (Java)] {}".format(
268267
get_default_replacement_path('java')))
@@ -279,11 +278,10 @@ def main(prog, args):
279278
default=False)
280279

281280
parser.add_argument("--config",
282-
help="{0}{1}{2}".format("file path to your config file\n",
283-
"[Default (Primary)] {}\n".format(
284-
PRIMARY_DEFAULT_CONFIG_PATH),
285-
"[Default (Secondary)] {}\n".format(
286-
SECONDARY_DEFAULT_CONFIG_PATH))
281+
help="File path to your config file\n{0}{1}".format("[Default (Primary)] {}\n".format(
282+
USER_CONFIG_PATH),
283+
"[Default (Secondary)] {}\n".format(
284+
DEFAULT_CONFIG_PATH))
287285
)
288286

289287
args = parser.parse_args(args)

atcodertools/tools/submit.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ def main(prog, args, credential_supplier=None, use_local_session_cache=True) ->
2424
formatter_class=argparse.RawTextHelpFormatter)
2525

2626
parser.add_argument("--exec", '-e',
27-
help="file path to the execution target. [Default] Automatically detected exec file",
27+
help="File path to the execution target. [Default] Automatically detected exec file",
2828
default=None)
2929

3030
parser.add_argument("--dir", '-d',
31-
help="target directory to test. [Default] Current directory",
31+
help="Target directory to test. [Default] Current directory",
3232
default=".")
3333

3434
parser.add_argument("--timeout", '-t',
@@ -37,7 +37,7 @@ def main(prog, args, credential_supplier=None, use_local_session_cache=True) ->
3737
default=1)
3838

3939
parser.add_argument("--code", '-c',
40-
help="path to the source code to submit [Default] Code path written in metadata.json",
40+
help="Path to the source code to submit [Default] Code path written in metadata.json",
4141
type=str,
4242
default=None)
4343

atcodertools/tools/tester.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -230,16 +230,16 @@ def main(prog, args) -> bool:
230230
formatter_class=argparse.RawTextHelpFormatter)
231231

232232
parser.add_argument("--exec", '-e',
233-
help="file path to the execution target. [Default] Automatically detected exec file",
233+
help="File path to the execution target. [Default] Automatically detected exec file",
234234
default=None)
235235

236236
parser.add_argument("--num", '-n',
237-
help="the case number to test (1-origin). All cases are tested if not specified.",
237+
help="The case number to test (1-origin). All cases are tested if not specified.",
238238
type=int,
239239
default=None)
240240

241241
parser.add_argument("--dir", '-d',
242-
help="target directory to test. [Default] Current directory",
242+
help="Target directory to test. [Default] Current directory",
243243
default=".")
244244

245245
parser.add_argument("--timeout", '-t',

0 commit comments

Comments
 (0)