コード例 #1
0
    def login(self):
        """ 
        Login to tinychat.

        :return: True if logged in, else False.
        :rtype: bool
        """
        account = acc.Account(account=self.account, password=self.password)
        if self.account and self.password:
            if account.is_logged_in():
                return True
            account.login()
        return account.is_logged_in()
コード例 #2
0
ファイル: pinylib.py プロジェクト: mikeyy/apinylib-rtc
    async def login(self):
        """
        Login to tinychat.

        :return: True if logged in, else False.
        :rtype: bool
        """
        # TODO this can handle errors better
        account = acc.Account(account=self.account, password=self.password)
        if self.account and self.password:
            if await account.is_logged_in():
                return True
            await account.login()
        return await account.is_logged_in()