mirror of
https://github.com/phil-opp/blog_os.git
synced 2025-12-16 14:27:49 +00:00
Convert before_build.py to python3
This commit is contained in:
2
.github/workflows/build-site.yml
vendored
2
.github/workflows/build-site.yml
vendored
@@ -21,8 +21,6 @@ jobs:
|
|||||||
|
|
||||||
- name: 'Download Zola'
|
- 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
|
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'
|
- name: 'Install Python Libraries'
|
||||||
run: python -m pip install --user -r requirements.txt
|
run: python -m pip install --user -r requirements.txt
|
||||||
working-directory: "blog"
|
working-directory: "blog"
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
import io
|
import io
|
||||||
import urllib2
|
import urllib
|
||||||
import datetime
|
import datetime
|
||||||
from github import Github
|
from github import Github
|
||||||
|
|
||||||
@@ -23,7 +23,7 @@ with io.open("templates/auto/recent-updates.html", 'w', encoding='utf8') as rece
|
|||||||
recent_updates.truncate()
|
recent_updates.truncate()
|
||||||
|
|
||||||
relnotes_issues = g.search_issues("is:merged", repo="phil-opp/blog_os", type="pr", label="relnotes")[:100]
|
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:
|
if len(recent_relnotes_issues) == 0:
|
||||||
recent_updates.write(u"No notable updates recently.")
|
recent_updates.write(u"No notable updates recently.")
|
||||||
@@ -58,8 +58,8 @@ month = 4
|
|||||||
while True:
|
while True:
|
||||||
url = "https://rust-osdev.com/this-month/" + str(year) + "-" + str(month).zfill(2) + "/"
|
url = "https://rust-osdev.com/this-month/" + str(year) + "-" + str(month).zfill(2) + "/"
|
||||||
try:
|
try:
|
||||||
urllib2.urlopen(url)
|
urllib.request.urlopen(url)
|
||||||
except urllib2.HTTPError as e:
|
except urllib.error.HTTPError as e:
|
||||||
break
|
break
|
||||||
|
|
||||||
month_str = datetime.date(1900, month, 1).strftime('%B')
|
month_str = datetime.date(1900, month, 1).strftime('%B')
|
||||||
|
|||||||
@@ -1,2 +1 @@
|
|||||||
PyGithub
|
PyGithub
|
||||||
urllib2
|
|
||||||
|
|||||||
Reference in New Issue
Block a user