@@ -12,12 +12,12 @@ repos:
|
|||||||
exclude: ".*(galleria|photoswipe|jquery|leaflet).*$"
|
exclude: ".*(galleria|photoswipe|jquery|leaflet).*$"
|
||||||
|
|
||||||
- repo: https://github.com/psf/black
|
- repo: https://github.com/psf/black
|
||||||
rev: 23.3.0
|
rev: 23.9.1
|
||||||
hooks:
|
hooks:
|
||||||
- id: black
|
- id: black
|
||||||
|
|
||||||
- repo: https://github.com/charliermarsh/ruff-pre-commit
|
- repo: https://github.com/charliermarsh/ruff-pre-commit
|
||||||
rev: v0.0.270
|
rev: v0.0.291
|
||||||
hooks:
|
hooks:
|
||||||
- id: ruff
|
- id: ruff
|
||||||
args: [ --fix, --show-fixes, --exit-non-zero-on-fix ]
|
args: [ --fix, --show-fixes, --exit-non-zero-on-fix ]
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ dependencies = [
|
|||||||
"click",
|
"click",
|
||||||
"Jinja2>=2.7",
|
"Jinja2>=2.7",
|
||||||
"Markdown",
|
"Markdown",
|
||||||
"Pillow>=8.0.0,<10.0.0",
|
"Pillow>=8.0.0",
|
||||||
"pilkit",
|
"pilkit",
|
||||||
"natsort",
|
"natsort",
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -418,9 +418,7 @@ class Album:
|
|||||||
signals.album_initialized.send(self)
|
signals.album_initialized.send(self)
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return "<{}>(path={!r}, title={!r})".format(
|
return f"<{self.__class__.__name__}>(path={self.path!r}, title={self.title!r})"
|
||||||
self.__class__.__name__, self.path, self.title
|
|
||||||
)
|
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return f"{self.path} : " + ", ".join(
|
return f"{self.path} : " + ", ".join(
|
||||||
|
|||||||
@@ -73,9 +73,7 @@ def generate_feed(gallery, medias, feed_type=None, feed_url="", nb_items=0):
|
|||||||
# unique_id='tag:%s,%s:%s' % (urlparse(link).netloc,
|
# unique_id='tag:%s,%s:%s' % (urlparse(link).netloc,
|
||||||
# item.date.date(),
|
# item.date.date(),
|
||||||
# urlparse(link).path.lstrip('/')),
|
# urlparse(link).path.lstrip('/')),
|
||||||
description='<img src="{}/{}/{}" />'.format(
|
description=f'<img src="{base_url}/{item.path}/{item.thumbnail}" />',
|
||||||
base_url, item.path, item.thumbnail
|
|
||||||
),
|
|
||||||
# categories=item.tags if hasattr(item, 'tags') else None,
|
# categories=item.tags if hasattr(item, 'tags') else None,
|
||||||
author_name=getattr(item, "author", ""),
|
author_name=getattr(item, "author", ""),
|
||||||
pubdate=item.date or datetime.now(),
|
pubdate=item.date or datetime.now(),
|
||||||
|
|||||||
@@ -36,9 +36,7 @@ def walk_destination(destination, suffixes, compress_suffix):
|
|||||||
for path, dirs, files in os.walk(destination):
|
for path, dirs, files in os.walk(destination):
|
||||||
for file in files:
|
for file in files:
|
||||||
original_filename = os.path.join(path, file)
|
original_filename = os.path.join(path, file)
|
||||||
compressed_filename = "{}.{}".format(
|
compressed_filename = f"{os.path.join(path, file)}.{compress_suffix}"
|
||||||
os.path.join(path, file), compress_suffix
|
|
||||||
)
|
|
||||||
path_exists = os.path.exists(compressed_filename)
|
path_exists = os.path.exists(compressed_filename)
|
||||||
file_ext = os.path.splitext(file)[1][1:]
|
file_ext = os.path.splitext(file)[1][1:]
|
||||||
if file_ext in suffixes:
|
if file_ext in suffixes:
|
||||||
|
|||||||
5
tox.ini
5
tox.ini
@@ -1,12 +1,12 @@
|
|||||||
[tox]
|
[tox]
|
||||||
envlist = py{38,39,310,311}-pillow{80,90,-latest},pypy3,check
|
envlist = py{38,39,310,311}-pillow{80,90,100,-latest},pypy3,check
|
||||||
skip_missing_interpreters = true
|
skip_missing_interpreters = true
|
||||||
|
|
||||||
[gh-actions]
|
[gh-actions]
|
||||||
python =
|
python =
|
||||||
3.8: py38-pillow80, check
|
3.8: py38-pillow80, check
|
||||||
3.9: py39-pillow90
|
3.9: py39-pillow90
|
||||||
3.10: py310-pillow-latest
|
3.10: py310-pillow100
|
||||||
3.11: py310-pillow-latest
|
3.11: py310-pillow-latest
|
||||||
pypy3: pypy3
|
pypy3: pypy3
|
||||||
|
|
||||||
@@ -16,6 +16,7 @@ wheel_build_env = .pkg
|
|||||||
deps =
|
deps =
|
||||||
pillow80: Pillow==8.0.1
|
pillow80: Pillow==8.0.1
|
||||||
pillow90: Pillow==9.0.1
|
pillow90: Pillow==9.0.1
|
||||||
|
pillow100: Pillow==10.0.1
|
||||||
extras =
|
extras =
|
||||||
all
|
all
|
||||||
tests
|
tests
|
||||||
|
|||||||
Reference in New Issue
Block a user