Exemplo n.º 1
0
 def has_sibling(account):
     if not all_accounts:
         return False
     for a in all_accounts:
         if a.depth() <= account.depth():
             break
     return a.depth() == account.depth()
Exemplo n.º 2
0
def cmd_chart(config, opts):
    chart = get_chart(config, opts)
    for account in sorted(fullset(select_accounts(chart, opts))):
        if opts['--verbose']:
            line = [account.full_name()]
        else:
            line = ['\t' * (account.depth() - 1) + account.bare_name()]
        if account.label:
            line.append('[%s]' % (account.label,))
        if account.atype and not (account.parent and account.parent.atype == account.atype):
            line.append('=%s' % (abo.account.atype_to_tag[account.atype]))
        for tag in account.tags:
            line.append('=%s' % (tag,))
        yield ' '.join(line)