pygetcomics 1.3.3__tar.gz → 1.4.1__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
- Name: pygetcomics
3
- Version: 1.3.3
2
+ Name: pyGetComics
3
+ Version: 1.4.1
4
4
  Summary: Download various daily comics.
5
5
  Home-page: https://gitlab.com/berhoel/python/pyGetComics.git
6
6
  License: BSD-2-Clause
@@ -15,6 +15,7 @@ Classifier: Programming Language :: Python :: 3
15
15
  Classifier: Programming Language :: Python :: 3.9
16
16
  Classifier: Programming Language :: Python :: 3.10
17
17
  Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
18
19
  Classifier: Programming Language :: Python :: Implementation :: CPython
19
20
  Requires-Dist: Pillow (>8.0.0)
20
21
  Requires-Dist: jinja2 (>3.0.0)
@@ -25,9 +25,11 @@ 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
- from selenium.webdriver.chrome.options import Options
28
+ # from selenium.webdriver.chrome.options import Options
29
+ from selenium.webdriver.firefox.options import Options
30
+ from selenium.webdriver.firefox.firefox_profile import FirefoxProfile
29
31
 
30
- __date__ = "2023/06/13 20:34:28 hoel"
32
+ __date__ = "2023/06/20 21:57:10 hoel"
31
33
  __author__ = "Berthold Höllmann"
32
34
  __copyright__ = "Copyright © 2011-2017 by Berthold Höllmann"
33
35
  __credits__ = ["Berthold Höllmann"]
@@ -38,25 +40,14 @@ FILE_MODE = stat.S_IRUSR | stat.S_IWUSR | stat.S_IRGRP | stat.S_IROTH
38
40
  TOUCH_FMT = "%Y%m%d0300"
39
41
 
40
42
 
41
- class SeleniumSingleton(object):
43
+ class SeleniumSingleton:
42
44
  __instance = None
43
45
 
44
46
  def __init__(self):
45
47
  """Virtually private constructor."""
48
+ self.driver = None
46
49
  if SeleniumSingleton.__instance is None:
47
- driverpath = None
48
- for path in [
49
- Path(i)
50
- for i in (
51
- "/usr/bin/",
52
- "/usr/lib64/chromium/",
53
- "/usr/lib/chromium-browser",
54
- )
55
- ]:
56
- if (driverpath := path / "chromedriver").is_file():
57
- break
58
-
59
- # https://stackoverflow.com/questions/46920243/how-to-configure-chromedriver-to-initiate-chrome-browser-in-headless-mode-throug
50
+ # https://stackoverflow.com/questions/46920243/how-to-configure-chromedriver-to-initiate-chrome-browser-in-headless-mode-thr<oug
60
51
  options = Options()
61
52
  options.add_argument("--headless")
62
53
  options.binary_location = "/usr/bin/google-chrome-stable"
@@ -64,9 +55,13 @@ class SeleniumSingleton(object):
64
55
  options.add_argument(
65
56
  "--disable-gpu"
66
57
  ) # Last I checked this was necessary.
67
- self.driver = webdriver.Chrome(
68
- executable_path=driverpath, chrome_options=options
69
- )
58
+ options.add_argument("--headless")
59
+ firefox_profile = FirefoxProfile()
60
+ firefox_profile.set_preference("javascript.enabled", True)
61
+ options.profile = firefox_profile
62
+ self._driver = webdriver.Firefox(options=options)
63
+
64
+ # self.driver = webdriver.Chrome(options)
70
65
  self.driver.get("http://www.gocomics.com/")
71
66
  if self.driver.current_url.startswith("https://login.microsoftonline.com/"):
72
67
  self.ms_login()
@@ -100,16 +95,8 @@ class SeleniumSingleton(object):
100
95
  SeleniumSingleton()
101
96
  return SeleniumSingleton.__instance
102
97
 
103
- def close(self):
104
- self.driver.close()
105
- SeleniumSingleton.__instance = None
106
-
107
- def __del__(self):
108
- self.driver.close()
109
- SeleniumSingleton.__instance = None
110
-
111
98
 
112
- class SaveState(object):
99
+ class SaveState:
113
100
  "Save state information on already downloaded files and dates tried"
114
101
 
115
102
  def __init__(self):
@@ -139,7 +126,7 @@ def mk_dir_tree(path):
139
126
  path.chmod(mode)
140
127
 
141
128
 
142
- class GoComics(object):
129
+ class GoComics:
143
130
  """Download comics from GoComics."""
144
131
 
145
132
  start_year = -1
@@ -1,12 +1,10 @@
1
1
  [tool.poetry]
2
2
  name = "pyGetComics"
3
- version = "1.3.3"
3
+ version = "1.4.1"
4
4
 
5
5
  description = "Download various daily comics."
6
6
 
7
- packages = [
8
- { include = "berhoel" },
9
- ]
7
+ packages = [{ include = "berhoel" }]
10
8
 
11
9
  authors = ["Berthold Höllmann <berhoel@gmail.com>"]
12
10
  license = "BSD-2-Clause"
@@ -15,12 +13,12 @@ repository = "https://gitlab.com/berhoel/python/pyGetComics.git"
15
13
 
16
14
  readme = "README.rst"
17
15
 
18
- classifiers =[
19
- "Development Status :: 4 - Beta",
20
- "License :: OSI Approved :: BSD License",
21
- "Programming Language :: Python",
22
- "Programming Language :: Python :: Implementation :: CPython",
23
- "Operating System :: OS Independent"
16
+ classifiers = [
17
+ "Development Status :: 4 - Beta",
18
+ "License :: OSI Approved :: BSD License",
19
+ "Programming Language :: Python",
20
+ "Programming Language :: Python :: Implementation :: CPython",
21
+ "Operating System :: OS Independent",
24
22
  ]
25
23
 
26
24
  [tool.poetry.dependencies]
@@ -38,7 +36,7 @@ pdbpp = "*"
38
36
  tox = "*"
39
37
  pytest = "*"
40
38
  pytest-benchmark = "*"
41
- pytest-black = "*"
39
+ pytest-black-ng = "*"
42
40
  pytest-cache = "*"
43
41
  pytest-cov = "*"
44
42
  pytest-env = "*"
@@ -53,7 +51,7 @@ pylint = "*"
53
51
  pylint-common = "*"
54
52
  pylint-plugin-utils = "*"
55
53
  bhoelhelper = ">=1.3.0"
56
- berhoel-sphinx-settings = {git = "https://gitlab.com/berhoel/python/berhoel-sphinx-settings.git", rev = "main"}
54
+ berhoel-sphinx-settings = { git = "https://gitlab.com/berhoel/python/berhoel-sphinx-settings.git", rev = "main" }
57
55
  tomli = "*"
58
56
  sphinx-argparse-cli = "*"
59
57
 
@@ -85,9 +83,7 @@ import_heading_firstparty = 'First party library imports.'
85
83
  import_heading_localfolder = 'Local library imports.'
86
84
  default_section = "THIRDPARTY"
87
85
  known_first_party = ["berhoel"]
88
- known_third_party = [
89
- "pytest",
90
- ]
86
+ known_third_party = ["pytest"]
91
87
 
92
88
  [tool.pytest.ini_options]
93
89
  minversion = "7.0"
File without changes
File without changes