<commit_before># -*- coding: utf-8 -*-
from helpers import *
from api import add_organization, add_lesson
import xlwt, xlrd
from xlutils.copy import copy as xlcopy


if __name__ == "__main__":
    print("Enter file name: ")
    file_name = input()

    file = xlrd.open_workbook(file_name, formatting_info=True)
    write_book = xlcopy(file)   # Excel книга в которой будет показано какие записи были добавлены в БД

    xlwt.add_palette_colour("ok_colour", 0x21)
    write_book.set_colour_RGB(0x21, 39, 91, 39)

    xlwt.add_palette_colour("fail_colour", 0x22)
    write_book.set_colour_RGB(0x22, 91, 39, 39)

    style_ok = xlwt.easyxf('pattern: pattern solid, fore_colour ok_colour')
    style_fail = xlwt.easyxf('pattern: pattern solid, fore_colour fail_colour')

    organization = "МГТУ им.Баумана КФ"
    sheet_names = file.sheet_names()
    for index in range(file.nsheets):
        sheet = file.sheet_by_index(index)
        write_sheet = write_book.get_sheet(index)

        faculty = sheet_names[index]

        for col in range(2, sheet.ncols, 1):
            # Группа
            group = sheet.cell_value(0, col)
            print("{0}:".format(group))

            # Знаю что костыли костыльные но а что делать, надо как то выкручиваться
            if sheet.cell_value(1, col + 2) == "Понедельник":
                break
            if group == "":
                continue

            tag = add_organization(organization, faculty, group)
            if tag is None:
                print("Oops! some errors")
                continue

            day = ""
            for row in range(1, sheet.nrows, 2):
                number = parse_lesson_number(sheet.cell_value(row, 1))
                time_start, time_end = parse_time(sheet.cell_value(row, 1))
                title = parse_title(sheet.cell_value(row, col))
                classroom = parse_classroom(sheet.cell_value(row, col))<commit_msg>Исправлена ошибка в  примере парсера Не добавлялся последний столбец таблицы с расписанием<commit_after># -*- coding: utf-8 -*-
from helpers import *
from api import add_organization, add_lesson
import xlwt, xlrd
from xlutils.copy import copy as xlcopy


if __name__ == "__main__":
    print("Enter file name: ")
    file_name = input()

    file = xlrd.open_workbook(file_name, formatting_info=True)
    write_book = xlcopy(file)   # Excel книга в которой будет показано какие записи были добавлены в БД

    xlwt.add_palette_colour("ok_colour", 0x21)
    write_book.set_colour_RGB(0x21, 39, 91, 39)

    xlwt.add_palette_colour("fail_colour", 0x22)
    write_book.set_colour_RGB(0x22, 91, 39, 39)

    style_ok = xlwt.easyxf('pattern: pattern solid, fore_colour ok_colour')
    style_fail = xlwt.easyxf('pattern: pattern solid, fore_colour fail_colour')

    organization = "МГТУ им.Баумана КФ"
    sheet_names = file.sheet_names()
    for index in range(file.nsheets):
        sheet = file.sheet_by_index(index)
        write_sheet = write_book.get_sheet(index)

        faculty = sheet_names[index]

        for col in range(2, sheet.ncols, 1):
            # Группа
            group = sheet.cell_value(0, col)
            print("{0}:".format(group))

            # Знаю что костыли костыльные но а что делать, надо как то выкручиваться
            if sheet.cell_value(1, col + 1) == "Понедельник":
                break
            if group == "":
                continue

            tag = add_organization(organization, faculty, group)
            if tag is None:
                print("Oops! some errors")
                continue

            day = ""
            for row in range(1, sheet.nrows, 2):
                number = parse_lesson_number(sheet.cell_value(row, 1))
                time_start, time_end = parse_time(sheet.cell_value(row, 1))
                title = parse_title(sheet.cell_value(row, col))
                classroom = parse_classroom(sheet.cell_value(row, col))
{'fraction_non_alphanumeric': 0.09721156305960604, 'fraction_numerical': 0.017907393195190587, 'mean_word_length': 2.506726457399103, 'pattern_counts': {'":': 6, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4904328', 'n_tokens_mistral': 1388, 'n_tokens_neox': 1312, 'n_words': 308}