Ejemplo n.º 1
0
    match = re.search(r'get money (?P<money_amount>\d+(\.\d+)?)', command)
    if match:
        operation = operations.get_money_operation(float(match.group('money_amount')))
        result = operation.process()
        if result:
            print result
        else:
            print 'Operation executed successfully'
        continue

    match = re.search(r'pay rent (?P<money_amount>\d+(.\d+)?)', command)
    if match:
        operation = operations.pay_rent_operation(float(match.group('money_amount')))
        result = operation.process()
        if result:
            print result
        else:
            print 'Operation executed successfully'
        continue

    match = re.search(r'info', command)
    if match:
        account_repository = AccountRep()
        for acc in account_repository.get_all_accounts():
            print acc
        print cash_machine

    match = re.search(r'ex(it)?', command)
    if match:
        break