Skip to content
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

Merged
merged 6 commits into from
Nov 7, 2020

Conversation

granddaifuku
Copy link
Contributor

#836 に対応しました。
具体的には

  • if not is_updated の際に
    "Please run: $ pip3 install -U online-judge-tools online-judge-api-client" を加えて表示するようにしました。

至らないところなどがあればぜひご指摘お願いします。

Yudai Fukushima and others added 4 commits November 6, 2020 14:35
アップデートがなされていないときに表示するメッセージの追加
メッセージをプログラム内の他のコマンドの表示と合わせる
Copy link
Member

@kmyk kmyk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@granddaifuku 現状の表示より明らかに改善されるのでこのままマージすることもできます。しかし、表示はさらに改善できると思います。これについてレビューコメントを付けたので、修正して push するか、修正しないことを主張してください

Comment on lines 278 to 279
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')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(optional) 1行にまとめたいです。

Suggested change
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

Comment on lines 285 to 286
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')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

278-279 行目のコメントと同様

Yudai Fukushima and others added 2 commits November 7, 2020 01:46
@granddaifuku
Copy link
Contributor Author

@kmyk
レビューありがとうございます。
メッセージを一行にまとめました。
ご確認よろしくお願いします。

@kmyk
Copy link
Member

kmyk commented Nov 7, 2020

ありがとう。完璧です

@kmyk kmyk merged commit 1d02023 into online-judge-tools:master Nov 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pip install -U online-judge-tools で online-judge-api-client が更新されない
2 participants