UI.ShellUI.BankAccountApplication
index
/home/flempriere/personal_projects/Languages/Python/BeginToCodeWithPython/03_UsefulPython/13_PythonAndGraphicalUserInterfaces/Exercises/03_GraphicalBankingApplication/UI/ShellUI/BankAccountApplication.py

Exercise 13.3j Bank Account Application
 
Provides implementations for a shell-based user interface to a Bank Account System
 
Routine Listings
----------------
BankAccountApplication
    Class wrapping a storage class in a shell-based user interface layer.
    Assumes the storage class supports the `Data.Account.Account` interface
    for it's underlying items
 
See Also
--------
Data : Package defining storage and Account modules for a Bank

 
Modules
       
Data.Account
Data.AccountFactory
UI.ShellUI.BTCInput

 
Classes
       
builtins.object
BankAccountApplication

 
class BankAccountApplication(builtins.object)
    BankAccountApplication(filename, storage_class)
 
Provides a text-based interface for a Bank Account System
 
  Methods defined here:
__init__(self, filename, storage_class)
Creates a new `BankAccountApplication`
 
Attempts to load an existing application from the provided file.
Otherwise an empty instance is created
 
Parameters
----------
filename : str
    path to a file containing pickled `AccountSystem` data
storage_class : AccountSystem
    class that supports the Account System Data Management API
 
See Also
--------
AccountSystem : Main class for handling bank accounts
create_new_account(self)
Create a new account and add it to the system
 
Prompts the user for the type of account to create and
the necessary descriptors of the item. The account is
then added to the system
 
Returns
-------
None
 
Raises
------
ValueError
    Raised if an invalid account type id is encountered.
    Should not arise in production, please report if found.
deposit_into_account(self)
Deposit into a user-prompted account
 
User is prompted for an account, if the account exists,
the user is then prompted for how much to deposit
 
Returns
-------
None
get_account(self)
Prompts the user for an account number and returns any match
 
Returns
-------
Account | None
    Account is the account number matches, else `None`
main_menu(self)
Provides a looping main menu
 
Users are able to
1. Create a new account
2. Deposit into an account
3. Withdraw from an account
4. View an account
5. View all accounts associated with a name
6. Manage a matured long term savings account
7. Apply interest to all accounts
8. Exit
 
Returns
-------
None
 
Raises
------
ValueError
    Raised if an invalid command is received. Should not arise in
    production. Report if encountered
manage_matured_long_term_savings(self)
Close out or reinvest a user specified matured long-term account
 
Returns
-------
None
view_account(self)
Display a user-specified account
 
Returns
-------
None
view_accounts_for_name(self)
Find and display accounts for a user prompted name
 
Names are converted to lower case and stripped of
leading and trailing whitespace
 
Returns
-------
None
withdraw_from_account(self)
Withdraw from a user-prompted account
 
User is prompted for an account, if the account exists,
the user is then prompted for how much to withdraw
 
Returns
-------
None

Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object