-
Notifications
You must be signed in to change notification settings - Fork 2
AnnoFab WebAPIのエンドポイントを設定可能にする #110
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
Conversation
annofabapi/api.py
Outdated
self.session = requests.Session() | ||
|
||
#: アクセスするURL | ||
URL_PREFIX = "https://annofab.com/api/v1" | ||
URL_PREFIX = f"{DEFAULT_ENDPOINT_URL}/v1" |
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.
ここにあるクラス変数の URL_PREFIX
は不要じゃないでしょうか
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.
_request_wrapper
メソッドと、login
メソッドの2か所で使っているので、必要だと思いました。
annofab-api-python-client/annofabapi/api.py
Line 171 in 6efa5b6
def _request_wrapper(self, http_method: str, url_path: str, query_params: Optional[Dict[str, Any]] = None, |
annofab-api-python-client/annofabapi/api.py
Line 233 in 6efa5b6
def login(self) -> Tuple[Dict[str, Any], requests.Response]: |
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.
???
あれ、必要といいつつ、結局消しちゃいました?
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.
すみません、クラス変数とインスタンス変数を勘違いしていました…
- クラス変数の
url_prefix
は不要です。 - インスタンス変数の
self.url_prefix
は、他のメソッドで使用しているので必要です。
annofabapi/api.py
Outdated
|
||
if not login_user_id or not login_password: | ||
raise ValueError("login_user_id or login_password is empty.") | ||
|
||
self.login_user_id = login_user_id | ||
self.login_password = login_password | ||
|
||
self.endpoint_url = endpoint_url | ||
self.URL_PREFIX = f"{endpoint_url}/v1" |
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.
ここだけ大文字なのはなぜ...
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.
もともと定数として扱っていたので、大文字にしていました。
今回の対応で定数ではなくなったので、小文字に変更します。
close #110