示例#1
0
文件: meta.py 项目: AsterLaoWhy/Navi
 def __init__(self, username=None, password=None, state=None):
     self._state = {
         'username': username,
         'password': password,
     }
     self._ajax_api = AjaxApi()
     self._android_api = AndroidApi()
     if state is not None:
         self.set_state(state)
示例#2
0
def main(
    ctx: click.core.Context,
    username: str,
    password: str,
    stdin_password: bool,
) -> None:
    if not (password or stdin_password):
        raise click.UsageError(
            "Must supply one of `password` or `stdin_password`")

    if stdin_password:
        password = input()
    ctx.obj = api = AndroidApi()
    api.start_session()
    api.login(account=username, password=password)