+
+ def parse_csv_boards(self, today):
+ """ Parse the csv file that describes the boards to produce and fill
+ the dict d_input_boards that contain the csv file contain
+
+ :param today int: the current day of the week
+ """
+ # open the csv file and read its content
+ l_read = []
+ with open(self.file_boards, 'r') as f:
+ reader = csv.reader(f,delimiter=CSV_DELIMITER)
+ for row in reader:
+ l_read.append(row)
+ # get the delimiter for the boards (empty line)
+ boards_delimiter = [''] * len(l_read[0])
+ # Make the list of boards, by splitting with the delimiter
+ l_boards = [list(y) for x, y in itertools.groupby(l_read,
+ lambda z: z == boards_delimiter) if not x]
+
+ # loop over the csv lists of lines and get the rows, columns and jobs
+ d_boards = {}
+ for input_board in l_boards:
+ # get board name
+ board_name = input_board[0][0]
+
+ # Get columns list
+ columns = input_board[0][1:]
+
+ rows = []
+ jobs = []
+ for line in input_board[1:]:
+ row = line[0]
+ for i, square in enumerate(line[1:]):
+ if square=='':
+ continue
+ days = square.split(DAYS_SEPARATOR)
+ days = [int(day) for day in days]
+ if today in days:
+ if row not in rows:
+ rows.append(row)
+ job = (row, columns[i])
+ jobs.append(job)
+
+ d_boards[board_name] = {"rows" : rows,
+ "columns" : columns,
+ "jobs" : jobs}
+
+ self.d_input_boards = d_boards
+