def cmd_list(config, opts): chart = get_chart(config, opts) try: accounts = filter_accounts(chart, opts['<PRED>'].lstrip()) except ValueError as e: raise InvalidArg('<PRED>', e) for account in sorted(accounts): if opts['--verbose']: yield account.full_name() else: yield account.short_name()
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)