pygetcomics 1.4.4__tar.gz → 1.4.6__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pygetcomics-1.4.4 → pygetcomics-1.4.6}/PKG-INFO +1 -1
- {pygetcomics-1.4.4 → pygetcomics-1.4.6}/berhoel/get_comics/__init__.py +4 -9
- {pygetcomics-1.4.4 → pygetcomics-1.4.6}/berhoel/get_comics/gocomics/__init__.py +3 -7
- {pygetcomics-1.4.4 → pygetcomics-1.4.6}/pyproject.toml +4 -4
- {pygetcomics-1.4.4 → pygetcomics-1.4.6}/LICENSE +0 -0
- {pygetcomics-1.4.4 → pygetcomics-1.4.6}/README.rst +0 -0
- {pygetcomics-1.4.4 → pygetcomics-1.4.6}/berhoel/__init__.py +0 -0
- {pygetcomics-1.4.4 → pygetcomics-1.4.6}/berhoel/get_comics/garfield/__init__.py +0 -0
- {pygetcomics-1.4.4 → pygetcomics-1.4.6}/berhoel/get_comics/gen_pdf/__init__.py +0 -0
- {pygetcomics-1.4.4 → pygetcomics-1.4.6}/berhoel/get_comics/gen_pdf/template/book.tex +0 -0
- {pygetcomics-1.4.4 → pygetcomics-1.4.6}/berhoel/get_comics/peanuts/__init__.py +0 -0
- {pygetcomics-1.4.4 → pygetcomics-1.4.6}/berhoel/get_comics/peanuts/clean_up.py +0 -0
- {pygetcomics-1.4.4 → pygetcomics-1.4.6}/berhoel/get_comics/peanuts/gen_book.py +0 -0
- {pygetcomics-1.4.4 → pygetcomics-1.4.6}/berhoel/get_comics/tests/test_get_comics.py +0 -0
|
@@ -3,26 +3,21 @@
|
|
|
3
3
|
"""Download various daily comics.
|
|
4
4
|
"""
|
|
5
5
|
|
|
6
|
-
from __future__ import annotations, generator_stop
|
|
7
|
-
|
|
8
6
|
# Standard library imports.
|
|
9
7
|
import argparse
|
|
10
8
|
|
|
11
9
|
# Local library imports.
|
|
12
10
|
from . import peanuts, garfield
|
|
13
11
|
|
|
14
|
-
__date__ = "
|
|
12
|
+
__date__ = "2024/06/02 01:09:05 hoel"
|
|
15
13
|
__author__ = "Berthold Höllmann"
|
|
16
14
|
__copyright__ = "Copyright © 2017, 2022 by Berthold Höllmann"
|
|
17
15
|
__credits__ = ["Berthold Höllmann"]
|
|
18
16
|
__maintainer__ = "Berthold Höllmann"
|
|
19
17
|
__email__ = "berhoel@gmail.com"
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
from ._version import __version__
|
|
24
|
-
except ImportError:
|
|
25
|
-
__version__ = "0.0.0.invalid0"
|
|
18
|
+
__version__ = __import__("importlib.metadata", fromlist=["version"]).version(
|
|
19
|
+
"get_comics"
|
|
20
|
+
)
|
|
26
21
|
|
|
27
22
|
|
|
28
23
|
def get_parser() -> argparse.ArgumentParser:
|
|
@@ -25,8 +25,6 @@ from selenium import webdriver
|
|
|
25
25
|
from lxml.html import fromstring
|
|
26
26
|
from selenium.webdriver.common import action_chains
|
|
27
27
|
from selenium.webdriver.common.keys import Keys
|
|
28
|
-
|
|
29
|
-
# from selenium.webdriver.chrome.options import Options
|
|
30
28
|
from selenium.webdriver.firefox.options import Options
|
|
31
29
|
from selenium.webdriver.firefox.firefox_profile import FirefoxProfile
|
|
32
30
|
|
|
@@ -48,10 +46,8 @@ class SeleniumSingleton:
|
|
|
48
46
|
"""Virtually private constructor."""
|
|
49
47
|
self.driver = None
|
|
50
48
|
if SeleniumSingleton.__instance is None:
|
|
51
|
-
# https://stackoverflow.com/questions/46920243/how-to-configure-chromedriver-to-initiate-chrome-browser-in-headless-mode-thr<oug
|
|
52
49
|
options = Options()
|
|
53
50
|
options.add_argument("--headless")
|
|
54
|
-
# options.binary_location = "/usr/bin/google-chrome-stable"
|
|
55
51
|
if os.name == "nt":
|
|
56
52
|
options.add_argument(
|
|
57
53
|
"--disable-gpu"
|
|
@@ -61,8 +57,6 @@ class SeleniumSingleton:
|
|
|
61
57
|
firefox_profile.set_preference("javascript.enabled", True)
|
|
62
58
|
options.profile = firefox_profile
|
|
63
59
|
self.driver = webdriver.Firefox(options=options)
|
|
64
|
-
|
|
65
|
-
# self.driver = webdriver.Chrome(options)
|
|
66
60
|
self.driver.get("http://www.gocomics.com/")
|
|
67
61
|
if self.driver.current_url.startswith("https://login.microsoftonline.com/"):
|
|
68
62
|
self.ms_login()
|
|
@@ -238,7 +232,9 @@ class GoComics:
|
|
|
238
232
|
if res[1].get_content_type() == "text/html" and data != data_norm:
|
|
239
233
|
request.urlretrieve(data_norm, gif_path)
|
|
240
234
|
|
|
241
|
-
process = subprocess.Popen(
|
|
235
|
+
process = subprocess.Popen(
|
|
236
|
+
f"magick {gif_path} -strip {png_path}", shell=True
|
|
237
|
+
)
|
|
242
238
|
os.waitpid(process.pid, 0)
|
|
243
239
|
|
|
244
240
|
gif_path.unlink()
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "pyGetComics"
|
|
3
|
-
version = "1.4.
|
|
3
|
+
version = "1.4.6"
|
|
4
4
|
|
|
5
5
|
description = "Download various daily comics."
|
|
6
6
|
|
|
7
7
|
packages = [{ include = "berhoel" }]
|
|
8
|
+
exclude = ["**/.#*.py", "**/#*.py#"]
|
|
8
9
|
|
|
9
10
|
authors = ["Berthold Höllmann <berhoel@gmail.com>"]
|
|
10
11
|
license = "BSD-2-Clause"
|
|
@@ -50,7 +51,6 @@ rope = "*"
|
|
|
50
51
|
pylint = "*"
|
|
51
52
|
pylint-common = "*"
|
|
52
53
|
pylint-plugin-utils = "*"
|
|
53
|
-
bhoelhelper = ">=1.3.0"
|
|
54
54
|
berhoel-sphinx-settings = { git = "https://gitlab.com/berhoel/python/berhoel-sphinx-settings.git", rev = "main" }
|
|
55
55
|
tomli = "*"
|
|
56
56
|
sphinx-argparse-cli = "*"
|
|
@@ -94,5 +94,5 @@ testpaths = ["berhoel"]
|
|
|
94
94
|
max-line-length = 88
|
|
95
95
|
|
|
96
96
|
[build-system]
|
|
97
|
-
requires = ["poetry>=0.
|
|
98
|
-
build-backend = "poetry.masonry.api"
|
|
97
|
+
requires = ["poetry-core>=1.0.0"]
|
|
98
|
+
build-backend = "poetry.core.masonry.api"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|