dualis_service.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:DualisWatcher 作者: LucaVazz 项目源码 文件源码
def interactively_acquire_token(self) -> str:
        """
        Walks the user through executing a login into the Dualis-System to get the Token and saves it.
        @return: The Token for Dualis.
        """
        print('[The following Input is not saved, it is only used temporarily to generate a login token.]')

        token = None
        while token is None:
            dualis_username = input('Username for Dualis:   ')
            dualis_password = getpass('Password for Dualis [no output]:   ')
            try:
                token = login_helper.obtain_login_token(dualis_username, dualis_password)
            except RequestRejectedError as error:
                print('Login Failed! (%s) Please try again.' % (error))
            except (ValueError, RuntimeError) as error:
                print('Error while communicating with the Dualis System! (%s) Please try again.' % (error))

        self.config_helper.set_property('token', token)

        return token
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号