def _print_dash(self, folder=True): if folder: todos = self._todos.fetch_folderwise_todos() else: todos = self._todos.fetch_tagwise_todos() for foldername in todos.keys(): folder = todos[foldername] points, earned, items, done, _ = self._calculate_points(folder) table = Goodtable([30, 50], foldername.capitalize()) percent_done = (done / float(items)) * 100 progress_bar_done = self._print_progress_bar( "Label", percent_done, 20)[1] table.add_row([ 'Tasks', "{:10}".format(str(done) + "/" + str(items)) + progress_bar_done ]) percent_points = (earned / float(points)) * 100 progress_bar_points = self._print_progress_bar( "Label", percent_points, 20)[1] table.add_row([ 'XP Points', "{:10}".format(str(earned) + "/" + str(points)) + progress_bar_points ]) table.print_table()
def _print_dash(self, folder=True): if folder: todos = self._todos.fetch_folderwise_todos() else: todos = self._todos.fetch_tagwise_todos() for foldername in todos.keys(): folder = todos[foldername] points, earned, items, done, _ = self._calculate_points(folder) table = Goodtable([30, 50], foldername.capitalize()) percent_done = (done/float(items))*100 progress_bar_done = self._print_progress_bar("Label", percent_done, 20)[1] table.add_row(['Tasks', "{:10}".format(str(done) + "/" + str(items)) + progress_bar_done ]) percent_points = (earned/float(points))*100 progress_bar_points = self._print_progress_bar("Label", percent_points, 20)[1] table.add_row(['XP Points', "{:10}".format(str(earned) + "/" + str(points)) + progress_bar_points ]) table.print_table()
def show_profile(self): """ prints out user Dashboard. """ if 'info' in self._profile.keys(): print("=" * 80) print("Name: " + self._profile['info']['name']) print("Email: " + self._profile['info']['email']) print("=" * 80) table = Goodtable([30, 50], "Your Dashboard") table.add_row(['Total Tasks', str(self._profile['total_items'])]) table.add_row(['Total Done', str(self._profile['done'])]) percent_done = (self._profile['done'] / float(self._profile['total_items'])) * 100 table.add_row(self._print_progress_bar('Done', percent_done)) table.add_row(['Available Points', str(self._profile['available'])]) table.add_row(['Points Earned', str(self._profile['points'])]) percent_points = (self._profile['points'] / float(self._profile['available'])) * 100 table.add_row(self._print_progress_bar('XP Level', percent_points)) table.add_row( ['Rewards Redeemed', str(self._profile['rewards_redeemed'])]) table.print_table() folderstable = Goodtable([80], "Folders/Projects Progress") folderstable.print_table() print("\n") self._print_dash(folder=True) print("\n\n") tagstable = Goodtable([80], 'Tags Progress') tagstable.print_table() print("\n") self._print_dash(folder=False)
def show_profile(self): """ prints out user Dashboard. """ if 'info' in self._profile.keys(): print("="*80) print("Name: " + self._profile['info']['name']) print("Email: " + self._profile['info']['email']) print("="*80) table = Goodtable([30, 50], "Your Dashboard") table.add_row(['Total Tasks', str(self._profile['total_items'])] ) table.add_row(['Total Done', str(self._profile['done'])]) percent_done = (self._profile['done'] / float(self._profile['total_items']))*100 table.add_row( self._print_progress_bar('Done', percent_done)) table.add_row(['Available Points', str(self._profile['available'])]) table.add_row(['Points Earned', str(self._profile['points'])]) percent_points = (self._profile['points'] / float(self._profile['available']))*100 table.add_row( self._print_progress_bar('XP Level', percent_points)) table.add_row(['Rewards Redeemed', str(self._profile['rewards_redeemed'])]) table.print_table() folderstable = Goodtable([80], "Folders/Projects Progress") folderstable.print_table() print("\n") self._print_dash(folder=True) print( "\n\n") tagstable = Goodtable([80], 'Tags Progress') tagstable.print_table() print( "\n") self._print_dash(folder=False)