From 13e5db0637204b9164ed5cab4cef129505548407 Mon Sep 17 00:00:00 2001 From: emkael Date: Tue, 7 Feb 2023 17:30:13 +0100 Subject: Python 2.x -> 3.x conversion --- scripts/rankings-tables-compile.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'scripts/rankings-tables-compile.py') diff --git a/scripts/rankings-tables-compile.py b/scripts/rankings-tables-compile.py index 0270c54..45f72b5 100644 --- a/scripts/rankings-tables-compile.py +++ b/scripts/rankings-tables-compile.py @@ -6,7 +6,7 @@ subtitle = 'notowanie %s (%s), stan na %s' % ( sys.argv[1], sys.argv[2], '.'.join(ranking_date.split('-')[::-1]) ) -table = bs4(file('templates/ranking.html'), 'lxml') +table = bs4(open('templates/ranking.html'), 'lxml') table.select('.page-header h2 small')[0].string = subtitle table.select('table.data-table')[0]['data-ranking'] = '_data/%s.json?%d' % ( @@ -22,14 +22,14 @@ rawlink = table.select('a#rawlink')[0] rawlink['href'] = '%s/%s.csv' % (rawlink['href'], ranking_date) age_menu = sys.argv[5] -age_menu_file = file('templates/menu-age-%s.html' % (age_menu)) +age_menu_file = open('templates/menu-age-%s.html' % (age_menu)) age_menu_placeholder = table.select('div[data-menu="age"]')[0] age_menu_placeholder.clear() age_menu_placeholder.append(bs4(age_menu_file, 'html.parser')) -menu_file = file(sys.argv[3]) +menu_file = open(sys.argv[3]) menu = table.select('div.static-menu')[0] menu.clear() menu.append(bs4(menu_file, 'html.parser')) -print table.prettify().encode('utf-8') +print(table.prettify()) -- cgit v1.2.3