コード例 #1
0
def test_bulten_filenames():
    # Checks bultens start with an increasing identifying week number:
    # 01, 02, 03, ..., 10, 11, ...
    count = 1
    for file in bt.get_bulten_filenames():
        assert int(bt.get_bulten_week_number_as_str(file)) is count
        count = count+1
コード例 #2
0
def test_leagues():
    for file in bt.get_bulten_filenames():
        match_list = bt.get_matches(file)
        for match in match_list:
            assert match.league in ['SAL', 'U12', 'U15B', 'U15A','U17A',\
                                    'U17B', '1AL', 'ELİT U15', 'ELİT U16',\
                                    'BGL U15', 'BGL U16', 'BGL U17',\
                                    'BGL U19','KDN', 'ELİT U14', 'ELİT U17',\
                                    'ELİT U19', 'ÖZEL']
コード例 #3
0
def create_efso_html():
    all_bulten_filenames = bt.get_bulten_filenames()
    bulten_html_foldername = bt.get_bulten_html_foldername()
    efso_html_filename = bulten_html_foldername + '/efsolar.html'
    efso_list = bt.get_efso_list()

    with open(efso_html_filename, 'w') as myFile:
        myFile.write('<html>')
        myFile.write('<body>')
        myFile.write('<br>')
        for hakem in efso_list:
            myFile.write('<br>')
            myFile.write('<br>')
            myFile.write('EFSO HAKEM: ' + hakem)
            myFile.write('<table  border="1">')
            myFile.write('<td>Gun</td>')
            myFile.write('<td>Stad</td>')
            myFile.write('<td>Saat</td>')
            myFile.write('<td>Ev sahibi</td>')
            myFile.write('<td>Deplasman</td>')
            myFile.write('<td>Lig</td>')
            myFile.write('<td>Grup</td>')
            myFile.write('<td>Hakem</td>')
            myFile.write('<td>1. Yardimci</td>')
            myFile.write('<td>2. Yardimci</td>')
            myFile.write('<td>4. Hakem</td>')
            myFile.write('<td>Gozlemci</td>')
            for bulten_filename in all_bulten_filenames:
                match_list = bt.get_matches(bulten_filename)
                for mac in match_list:
                    if bt.is_this_an_efso_mac(hakem, mac):
                        myFile.write('<tr>')
                        myFile.write('<td>' + mac.date + '</td>')
                        myFile.write('<td>' + mac.place + '</td>')
                        myFile.write('<td>' + mac.time + '</td>')
                        myFile.write('<td>' + mac.home + '</td>')
                        myFile.write('<td>' + mac.away + '</td>')
                        myFile.write('<td>' + mac.league + '</td>')
                        myFile.write('<td>' + mac.group + '</td>')
                        myFile.write('<td>' + mac.ref + '</td>')
                        myFile.write('<td>' + mac.ar1 + '</td>')
                        myFile.write('<td>' + mac.ar2 + '</td>')
                        myFile.write('<td>' + mac.fourth + '</td>')
                        myFile.write('<td>' + mac.observer + '</td>')
                        myFile.write('</tr>')
            myFile.write('</table>')

        myFile.write('</body>')
        myFile.write('</html>')
コード例 #4
0
def create_bulten_html(week_number):
    all_bulten_filenames = bt.get_bulten_filenames()
    bulten_filename = all_bulten_filenames[week_number - 1]
    week_no_str = bt.get_bulten_week_number_as_str(bulten_filename)
    match_list = bt.get_matches(bulten_filename)
    bulten_html_foldername = bt.get_bulten_html_foldername()
    bulten_html_filename = bulten_html_foldername + '/' + \
                                f'bulten_{week_no_str}.html'

    with open(bulten_html_filename, 'w') as myFile:
        myFile.write('<html>')
        myFile.write('<body>')
        myFile.write('<br>')
        myFile.write('HAFTA: ' + week_no_str)
        myFile.write('<br>')

        myFile.write('<table  border="1">')
        myFile.write('<td>Gun</td>')
        myFile.write('<td>Stad</td>')
        myFile.write('<td>Saat</td>')
        myFile.write('<td>Ev sahibi</td>')
        myFile.write('<td>Deplasman</td>')
        myFile.write('<td>Lig</td>')
        myFile.write('<td>Grup</td>')
        myFile.write('<td>Hakem</td>')
        myFile.write('<td>1. Yardimci</td>')
        myFile.write('<td>2. Yardimci</td>')
        myFile.write('<td>4. Hakem</td>')
        myFile.write('<td>Gozlemci</td>')
        for mac in match_list:
            myFile.write('<tr>')
            myFile.write('<td>' + mac.date + '</td>')
            myFile.write('<td>' + mac.place + '</td>')
            myFile.write('<td>' + mac.time + '</td>')
            myFile.write('<td>' + mac.home + '</td>')
            myFile.write('<td>' + mac.away + '</td>')
            myFile.write('<td>' + mac.league + '</td>')
            myFile.write('<td>' + mac.group + '</td>')
            myFile.write('<td>' + mac.ref + '</td>')
            myFile.write('<td>' + mac.ar1 + '</td>')
            myFile.write('<td>' + mac.ar2 + '</td>')
            myFile.write('<td>' + mac.fourth + '</td>')
            myFile.write('<td>' + mac.observer + '</td>')
            myFile.write('</tr>')
        myFile.write('</table>')

        myFile.write('</body>')
        myFile.write('</html>')
コード例 #5
0
def test_whether_all_mac_details_are_str():
    for file in bt.get_bulten_filenames():
        match_list = bt.get_matches(file)
        for match in match_list:
            assert type(match.date) is str
            assert type(match.day) is str
            assert type(match.place) is str
            assert type(match.time) is str
            assert type(match.home) is str
            assert type(match.away) is str
            assert type(match.league) is str
            assert type(match.group) is str
            assert type(match.ref) is str
            assert type(match.ar1) is str
            assert type(match.ar2) is str
            assert type(match.fourth) is str
            assert type(match.observer) is str
コード例 #6
0
def test_dates():
    for file in bt.get_bulten_filenames():
        match_list = bt.get_matches(file)
        for match in match_list:
            assert match.date[-4::] in ['2018', '2019']
コード例 #7
0
def test_times():
    for file in bt.get_bulten_filenames():
        match_list = bt.get_matches(file)
        for match in match_list:
            assert bt.is_time(match.time)