Convert before_build.py to python3

This commit is contained in:
Philipp Oppermann
2021-03-19 12:13:26 +01:00
parent 3f29b7b582
commit f87cc129fc
3 changed files with 4 additions and 7 deletions

View File

@@ -21,8 +21,6 @@ jobs:
- name: 'Download Zola'
run: curl -sL https://github.com/getzola/zola/releases/download/v0.12.1/zola-v0.12.1-x86_64-unknown-linux-gnu.tar.gz | tar zxv
- name: "Install Python Tools"
run: python -m pip install --upgrade pip setuptools wheel
- name: 'Install Python Libraries'
run: python -m pip install --user -r requirements.txt
working-directory: "blog"

View File

@@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-
import io
import urllib2
import urllib
import datetime
from github import Github
@@ -23,7 +23,7 @@ with io.open("templates/auto/recent-updates.html", 'w', encoding='utf8') as rece
recent_updates.truncate()
relnotes_issues = g.search_issues("is:merged", repo="phil-opp/blog_os", type="pr", label="relnotes")[:100]
recent_relnotes_issues = filter(filter_date, relnotes_issues)
recent_relnotes_issues = list(filter(filter_date, relnotes_issues))
if len(recent_relnotes_issues) == 0:
recent_updates.write(u"No notable updates recently.")
@@ -58,8 +58,8 @@ month = 4
while True:
url = "https://rust-osdev.com/this-month/" + str(year) + "-" + str(month).zfill(2) + "/"
try:
urllib2.urlopen(url)
except urllib2.HTTPError as e:
urllib.request.urlopen(url)
except urllib.error.HTTPError as e:
break
month_str = datetime.date(1900, month, 1).strftime('%B')

View File

@@ -1,2 +1 @@
PyGithub
urllib2