-
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
Changes from 4 commits
51fa59a
348051e
e696107
7faa573
751653b
67fc90f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -13,6 +13,9 @@ | |||||
|
||||||
logger = logging.getLogger(__name__) | ||||||
|
||||||
DEFAULT_ENDPOINT_URL = "https://annofab.com/api" | ||||||
"""AnnoFab WebAPIのデフォルトのエンドポイントURL""" | ||||||
|
||||||
|
||||||
def my_backoff(function): | ||||||
""" | ||||||
|
@@ -68,20 +71,21 @@ class AnnofabApi(AbstractAnnofabApi): | |||||
Args: | ||||||
login_user_id: AnnoFabにログインするときのユーザID | ||||||
login_password: AnnoFabにログインするときのパスワード | ||||||
|
||||||
endpoint_url: AnnoFab APIのエンドポイント。 | ||||||
""" | ||||||
def __init__(self, login_user_id: str, login_password: str): | ||||||
def __init__(self, login_user_id: str, login_password: str, endpoint_url: str = DEFAULT_ENDPOINT_URL): | ||||||
|
||||||
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" | ||||||
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 commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more.
annofab-api-python-client/annofabapi/api.py Line 171 in 6efa5b6
annofab-api-python-client/annofabapi/api.py Line 233 in 6efa5b6
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. すみません、クラス変数とインスタンス変数を勘違いしていました…
|
||||||
|
||||||
#: login, refresh_tokenで取得したtoken情報 | ||||||
token_dict: Optional[Dict[str, Any]] = None | ||||||
|
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.
もともと定数として扱っていたので、大文字にしていました。
今回の対応で定数ではなくなったので、小文字に変更します。