コード例 #1
0
ファイル: commands.py プロジェクト: JuhaJGamer/taubot
def process_list_accounts(author: AccountId, message: str, server: Server,
                          **kwargs):
    """Processes a message requesting a list of all accounts."""
    return '\n'.join(['| Account | Balance |', '| --- | --- |'] + [
        '| %s%s | %s |' %
        ('' if account.get_authorization() == Authorization.
         CITIZEN else '**%s** ' % account.get_authorization().name.lower(),
         ' aka '.join(str(x) for x in server.get_account_ids(account)),
         fraction_to_str(account.get_balance()))
        for account in server.list_accounts()
    ])
コード例 #2
0
def list_public_accounts(author: Union[AccountId, str],
                         server: Server) -> List[Account]:
    """returns a list of all accounts marked as public"""
    return [account for account in server.list_accounts() if account.public]
コード例 #3
0
def list_accounts(author: Union[AccountId, str],
                  server: Server) -> List[Account]:
    """List all accounts"""
    author = _get_account(author, server)
    _assert_authorized(author, None)
    return server.list_accounts()
コード例 #4
0
def process_list_accounts(author: AccountId, message: str, server: Server, **kwargs):
    """Processes a message requesting a list of all accounts."""
    return '\n'.join(['| Account | Balance |', '| --- | --- |'] + [
        '| %s | %s |' % (' aka '.join(str(x) for x in server.get_account_ids(account)), account.get_balance())
        for account in server.list_accounts()
    ])