def but1(): if li.currentItem(): ln = li.currentItem().text() te = QMessageBox.question(window,'???','Are you sure you want to delete this league? (it will remove the league and all of the teams on the league)',QMessageBox.Yes|QMessageBox.No,QMessageBox.No) if te == QMessageBox.Yes: fbTool.removeLeague(str(ln)) li.clear() for i in fbTool.leagueLists: li.addItem(i.leagueName) mainMenu.updateTree() else: QMessageBox.critical(window,'error','No league selected')
def remLeagueUI(): if printLeagues(): return 1 ln = raw_input('Please enter the name of the league you wish to remove: ').strip() invar=' ' while invar.lower() not in ['y','yes','n','no']: invar=raw_input('Are you sure you want to do this? \nYou will lose not only the league, but all of it\'s teams and their rosters! (y/n): ').strip() if invar.lower() in ['y','yes']: invar = raw_input('Would you like to save before doing so?(y/n): ') if invar.lower() in ['y','yes']: saveFileUI() if invar.lower() in ['n','no']: print 'IF YOU SAY SO.....' invar = 'y' if invar.lower() not in ['y','yes','n','no']: print 'Invalid input. Please try again...' else: if fbTool.removeLeague(ln): print 'LEAGUE DOESN\'T EXIST!' else: print 'League %s was deleted.' %ln if invar.lower() in ['n','no']: print 'I DIDN\'T THINK SO!' if invar.lower() not in ['y','yes','n','no']: print 'Invalid input. Please try again...'