def editHours(ref): email = git_utils.getEmail() uID = firebase_utils.getUserID(ref,email) pID = readProjectID() if pID == None: print 'Henry repository not initialized or corrupted' return mID = promptForMilestone(ref,pID) if mID == None: return tID = promptForTask(ref,uID,pID,mID) current = firebase_utils.getCurrentHourEstimate(ref,pID,mID,tID) update = promptForUpdate(current) if update != None: firebase_utils.setCurrentHourEstimate(ref,update,uID,pID,mID,tID)
multiprocessing.freeze_support() # this is a windows thing ref = firebase.FirebaseApplication(firebase_url,None) sys.argv = [v.strip() for v in sys.argv] try: if len(sys.argv) == 1: usage() elif sys.argv[1] == 'init': try: pID = firebase_utils.getProjectID(ref,sys.argv[2]) except: traceback.print_exc(file=sys.stdout) print 'HENRY Error: Invalid or nonexistant Henry project name' print ' henry init <project name>' exit(1) try: email = git_utils.getEmail() userID = firebase_utils.getUserID(ref,email) except: traceback.print_exc(file=sys.stdout) print 'HENRY Error: Invalid or unregistered Git email address' print ' henry init <project name>' exit(1) initialize_git(pID,OPSYS) elif sys.argv[1] in {'version','-version','--version','-v'}: version() elif sys.argv[1] in {'help','-help','--help','-h'}: helpmenu() elif sys.argv[1] in {'status'}: status(ref) elif sys.argv[1] in {'edit','edithours'}: editHours(ref)