Skip to content

Commit

Permalink
Upgrade to Py3.7+
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastinas committed May 1, 2024
1 parent b83cd97 commit 9c769bc
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion pwmt/menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def __init__(self, caption, endpoint="#"):
def render(self):
render_string = ""

if len(self.items) is not 0:
if len(self.items) != 0:
render_string += (
'<li class="dropdown">'
'<a href="#" class="dropdown-toggle" data-toggle="dropdown">'
Expand Down
2 changes: 1 addition & 1 deletion pwmt/news.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
_punct_re = re.compile(r'\W+')


def slugify(text, delim=u'-'):
def slugify(text, delim='-'):
result = []
for word in _punct_re.split(text.lower()):
result.extend(unidecode(word).split())
Expand Down
4 changes: 2 additions & 2 deletions pwmt/page.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from werkzeug.utils import cached_property
from pathlib import Path

class Page(object):
class Page:

def __init__(self, filePath, endpoint):
filePath = Path(filePath).resolve()
Expand Down Expand Up @@ -54,7 +54,7 @@ def __getitem__(self, name):
return None


class PageManager(object):
class PageManager:

suffix = ".md"

Expand Down
10 changes: 5 additions & 5 deletions pwmt/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,19 @@ def __init__(self, project, meta):
self.changelog = meta["changelog"] if "changelog" in meta else {}

try:
self.filename = "%s-%s.tar.gz" % (project.name, self.name)
self.filename = "{}-{}.tar.gz".format(project.name, self.name)
self.path = os.path.join(project.path, "download", self.filename)
if not os.path.exists(self.path):
self.filename = "%s-%s.tar.xz" % (project.name, self.name)
self.filename = "{}-{}.tar.xz".format(project.name, self.name)
self.path = os.path.join(project.path, "download", self.filename)
self.sha2 = calculate_sha2_of_file(self.path)
except:
print("Can not read file for version '%s-%s'" % (self.project.name, self.name))
print("Can not read file for version '{}-{}'".format(self.project.name, self.name))
pass

def getNewsItem(self):
news = NewsItem()
news["title"] = "%s %s" % (self.project.name, self.name)
news["title"] = "{} {}".format(self.project.name, self.name)
news["date"] = self.date
news["tags"] = ["release"]
news["categories"] = [self.project.name]
Expand Down Expand Up @@ -66,7 +66,7 @@ def __init__(self, name, path):
tmp_versions = {}
info_file = os.path.join(path, "info.json")
try:
with io.open(info_file, encoding='utf8') as fd:
with open(info_file, encoding='utf8') as fd:
try:
self.json = json.load(fd)
self.name = self.json["name"]
Expand Down
1 change: 0 additions & 1 deletion run.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-

import click
from pwmt import app, freezer
Expand Down

0 comments on commit 9c769bc

Please sign in to comment.