-
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
provide functions about sessions as a library #636
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.
コードはよさそうです。
PRありがとうございます! |
使っているのは |
@@ -353,6 +353,10 @@ def get_service(self) -> AtCoderService: | |||
return AtCoderService() | |||
|
|||
def list_problem_data(self, *, session: Optional[requests.Session] = None) -> List['AtCoderProblemData']: | |||
""" | |||
:raises Exception: if logging in is required to see the tasks page |
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.
:raises Exception: if logging in is required to see the tasks page | |
:raises NotLoggedInError: if logging in is required to see the tasks page |
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.
NotLoggedInError
は飛ばなくて HTTPError みたいなやつになるはず (未確認) です。なのでたぶん Exception
で正しい
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
@fukatani 確認ですが、 |
おっと、見逃してました。 ただ、ojで公開しないのは仕方がない感じはします。 |
(merge後で恐縮ですが、)私もfukunatiさんと同じ3つを使ってました 3つめはget_default_sessionに置き換えれば問題なさそうなので、問題ありません ありがとうございます! |
#480 (comment)
onlinejudge._implementation.utils
のなかからいくつかonlinejudge.utils
に移したget_default_session
with_cookiejar
default_cookie_path
なども移した (with_cookiejar
した結果から取れちゃうし、いっしょにあると便利だろうので)onlinejudge.session
という手もあるが細かく切るよりひとつにまとめた方がなんとなく楽かな、ぐらいの気持ちです。より良いのが思い付いたら提案してください@yosupo06 これはあなたの目的のためによさそうですか? ところで atcoder-tools 並に高機能でかつ AtCoder 以外にも対応してるラッパーはほしいので、期待しています