summaryrefslogtreecommitdiff
path: root/scripts/rankings-tables-compile.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/rankings-tables-compile.py')
-rw-r--r--scripts/rankings-tables-compile.py8
1 files changed, 4 insertions, 4 deletions
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())