Ejemplo n.º 1
0
    def get_people_table(self, allocated=True):
        """ Returns the list of people with headers as the first item in the list """

        records = [Staff.headers()]
        counter = 0
        for person in self.people:
            if not person.is_allocated and not allocated:
                counter += 1
                records.append([counter] + person.details_list())
            else:
                counter += 1
                records.append([counter] + person.details_list())
        return records
Ejemplo n.º 2
0
    def list_people(self, args):
        """Displays the list of available people based on options specified (-u or -a)"""

        print('LIST OF AVAILABLE PEOPLE')
        Util.print_divider()
        if len(self.people) == 0:
            Util.print_line('No person found')
            return False

        data = [Staff.headers()]
        for index, person in enumerate(self.people):
            if args['-u']:
                if person.is_allocated:
                    continue

            if args['-a']:
                if not person.is_allocated:
                    continue

            data.append([(index + 1)] + person.details_list())
        Util.tabulate(data)