def withdraw_request(conn): print "WITHDRAWING SOME DOUGH \n" print "enter an account number 1-100:" while True: try: netBuffer = int(raw_input('>> ')) except ValueError: continue if (netBuffer > 0 and netBuffer <= 100): act = netBuffer break print "enter an amount to withdraw:" while True: try: netBuffer = int(raw_input('>> ')) except ValueError: continue if (netBuffer >= 0 and netBuffer < maxint): bal = netBuffer break package = xml.client_package(version, 40, [act, bal]) send_message(package, conn) return
def create_request(conn): print "CREATING AN ACCOUNT \n" print "enter a an account number 1-100:" while True: try: netBuffer = int(raw_input('>> ')) except ValueError: continue if (netBuffer > 0 and netBuffer <= 100): act = netBuffer break print "enter a starting balance:" while True: try: netBuffer = int(raw_input('>> ')) except ValueError: continue if (netBuffer >= 0 and netBuffer < maxint): bal = netBuffer break # should refactor opcodes package = xml.client_package(version, 10, [act, bal]) send_message(package, conn) return
def withdraw_request(conn): print "WITHDRAWING SOME DOUGH \n" print "enter an account number 1-100:" while True: try: netBuffer = int(raw_input('>> ')) except ValueError: continue if(netBuffer > 0 and netBuffer <= 100): act = netBuffer break print "enter an amount to withdraw:" while True: try: netBuffer = int(raw_input('>> ')) except ValueError: continue if(netBuffer >= 0 and netBuffer < maxint): bal = netBuffer break package = xml.client_package(version, 40, [act,bal]) send_message(package,conn) return
def create_request(conn): print "CREATING AN ACCOUNT \n" print "enter a an account number 1-100:" while True: try: netBuffer = int(raw_input('>> ')) except ValueError: continue if(netBuffer > 0 and netBuffer <= 100): act = netBuffer break print "enter a starting balance:" while True: try: netBuffer = int(raw_input('>> ')) except ValueError: continue if(netBuffer >= 0 and netBuffer < maxint): bal = netBuffer break # should refactor opcodes package = xml.client_package(version, 10, [act,bal]) send_message(package,conn) return
def delete_request(conn): print "DELETING AN ACCOUNT \n" print "enter a an account number 1-100:" while True: try: netBuffer = int(raw_input('>> ')) except ValueError: continue if (netBuffer > 0 and netBuffer <= 100): act = netBuffer break package = xml.client_package(version, 20, [act]) send_message(package, conn) return
def balance_request(conn): print "CHECKING THE BALANCE OF AN ACCOUNT \n" print "enter an account number 1-100:" while True: try: netBuffer = int(raw_input('>> ')) except ValueError: continue if (netBuffer > 0 and netBuffer <= 100): act = netBuffer break package = xml.client_package(version, 50, [act]) send_message(package, conn) return
def delete_request(conn): print "DELETING AN ACCOUNT \n" print "enter a an account number 1-100:" while True: try: netBuffer = int(raw_input('>> ')) except ValueError: continue if(netBuffer > 0 and netBuffer <= 100): act = netBuffer break package = xml.client_package(version, 20, [act]) send_message(package,conn) return
def balance_request(conn): print "CHECKING THE BALANCE OF AN ACCOUNT \n" print "enter an account number 1-100:" while True: try: netBuffer = int(raw_input('>> ')) except ValueError: continue if(netBuffer > 0 and netBuffer <= 100): act = netBuffer break package = xml.client_package(version, 50, [act]) send_message(package,conn) return
def end_session(conn): package = xml.client_package(version, 60, []) send_message(package, conn) return
def end_session(conn): package = xml.client_package(version, 60, []) send_message(package,conn) return