-
Notifications
You must be signed in to change notification settings - Fork 94
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
アップデートがなされていない際に表示するメッセージの追加 #839
Conversation
アップデートがなされていないときに表示するメッセージの追加
メッセージをプログラム内の他のコマンドの表示と合わせる
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@granddaifuku 現状の表示より明らかに改善されるのでこのままマージすることもできます。しかし、表示はさらに改善できると思います。これについてレビューコメントを付けたので、修正して push するか、修正しないことを主張してください
onlinejudge_command/main.py
Outdated
logger.info('hint: try updating the version of online-judge-tools') | ||
logger.info('Please run: $ pip3 install -U online-judge-tools online-judge-api-client') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(optional) 1行にまとめたいです。
logger.info('hint: try updating the version of online-judge-tools') | |
logger.info('Please run: $ pip3 install -U online-judge-tools online-judge-api-client') | |
logger.info('hint: try updating the version of online-judge-tools: $ pip3 install -U online-judge-tools online-judge-api-client') |
現状ではログ出力は以下のようになると思います。「更新してね」を伝えるためのメッセージが [HINT]
の行と [INFO]
の行に分かれてしまっていますが、両方を [HINT]
の行にまとめた方がユーザにとって分かりやすいはずです。
$ oj d http://x
[WARNING] update available for online-judge-tools: 11.0.0 -> 11.1.0
[INFO] run: $ pip3 install -U online-judge-tools
[INFO] online-judge-tools 11.0.0 (+ online-judge-api-client 10.5.0)
[ERROR] unknown problem: http://x
[ERROR] unknown contest: http://x
[ERROR] The URL "http://x" is not supported
Traceback (most recent call last):
File "/home/user/.local/lib/python3.6/site-packages/onlinejudge_command/main.py", line 251, in main
run_program(parsed, parser=parser)
File "/home/user/.local/lib/python3.6/site-packages/onlinejudge_command/main.py", line 217, in run_program
download(args)
File "/home/user/.local/lib/python3.6/site-packages/onlinejudge_command/subcommand/download.py", line 36, in download
raise requests.exceptions.InvalidURL('The URL "%s" is not supported' % args.url)
requests.exceptions.InvalidURL: The URL "x" is not supported
[HINT] try updating the version of online-judge-tools
[INFO] Please run: $ pip3 install -U online-judge-tools online-judge-api-client
onlinejudge_command/main.py
Outdated
logger.info('hint: try updating the version of online-judge-tools') | ||
logger.info('Please run: $ pip3 install -U online-judge-tools online-judge-api-client') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
278-279 行目のコメントと同様
@kmyk |
ありがとう。完璧です |
#836 に対応しました。
具体的には
if not is_updated
の際に"Please run: $ pip3 install -U online-judge-tools online-judge-api-client" を加えて表示するようにしました。
至らないところなどがあればぜひご指摘お願いします。