jmcomic 2.1.19__tar.gz → 2.1.21__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.
- {jmcomic-2.1.19/src/jmcomic.egg-info → jmcomic-2.1.21}/PKG-INFO +1 -1
- {jmcomic-2.1.19 → jmcomic-2.1.21}/src/jmcomic/__init__.py +1 -1
- {jmcomic-2.1.19 → jmcomic-2.1.21}/src/jmcomic/jm_client_impl.py +6 -1
- {jmcomic-2.1.19 → jmcomic-2.1.21}/src/jmcomic/jm_client_interface.py +10 -4
- {jmcomic-2.1.19 → jmcomic-2.1.21}/src/jmcomic/jm_option.py +3 -3
- {jmcomic-2.1.19 → jmcomic-2.1.21/src/jmcomic.egg-info}/PKG-INFO +1 -1
- {jmcomic-2.1.19 → jmcomic-2.1.21}/LICENSE +0 -0
- {jmcomic-2.1.19 → jmcomic-2.1.21}/README.md +0 -0
- {jmcomic-2.1.19 → jmcomic-2.1.21}/setup.cfg +0 -0
- {jmcomic-2.1.19 → jmcomic-2.1.21}/setup.py +0 -0
- {jmcomic-2.1.19 → jmcomic-2.1.21}/src/jmcomic/api.py +0 -0
- {jmcomic-2.1.19 → jmcomic-2.1.21}/src/jmcomic/jm_config.py +0 -0
- {jmcomic-2.1.19 → jmcomic-2.1.21}/src/jmcomic/jm_downloader.py +0 -0
- {jmcomic-2.1.19 → jmcomic-2.1.21}/src/jmcomic/jm_entity.py +0 -0
- {jmcomic-2.1.19 → jmcomic-2.1.21}/src/jmcomic/jm_toolkit.py +0 -0
- {jmcomic-2.1.19 → jmcomic-2.1.21}/src/jmcomic.egg-info/SOURCES.txt +0 -0
- {jmcomic-2.1.19 → jmcomic-2.1.21}/src/jmcomic.egg-info/dependency_links.txt +0 -0
- {jmcomic-2.1.19 → jmcomic-2.1.21}/src/jmcomic.egg-info/requires.txt +0 -0
- {jmcomic-2.1.19 → jmcomic-2.1.21}/src/jmcomic.egg-info/top_level.txt +0 -0
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
from .jm_client_interface import *
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
# noinspection PyAbstractClass
|
|
5
4
|
class AbstractJmClient(
|
|
6
5
|
JmcomicClient,
|
|
7
6
|
PostmanProxy,
|
|
@@ -139,6 +138,12 @@ class AbstractJmClient(
|
|
|
139
138
|
def get_jmcomic_domain_all(self, postman=None):
|
|
140
139
|
return JmModuleConfig.get_jmcomic_domain_all(postman or self.get_root_postman())
|
|
141
140
|
|
|
141
|
+
def get_domain_list(self):
|
|
142
|
+
return self.domain_list
|
|
143
|
+
|
|
144
|
+
def set_domain_list(self, domain_list: List[str]):
|
|
145
|
+
self.domain_list = domain_list
|
|
146
|
+
|
|
142
147
|
# noinspection PyUnusedLocal
|
|
143
148
|
def fallback(self, request, url, domain_index, retry_count, **kwargs):
|
|
144
149
|
msg = f"请求重试全部失败: [{url}], {self.domain_list}"
|
|
@@ -279,8 +279,14 @@ class JmcomicClient(
|
|
|
279
279
|
JmUserClient,
|
|
280
280
|
Postman,
|
|
281
281
|
):
|
|
282
|
-
def get_jmcomic_url(self
|
|
283
|
-
return JmModuleConfig.get_jmcomic_url(
|
|
282
|
+
def get_jmcomic_url(self):
|
|
283
|
+
return JmModuleConfig.get_jmcomic_url()
|
|
284
284
|
|
|
285
|
-
def get_jmcomic_domain_all(self
|
|
286
|
-
return JmModuleConfig.get_jmcomic_domain_all(
|
|
285
|
+
def get_jmcomic_domain_all(self):
|
|
286
|
+
return JmModuleConfig.get_jmcomic_domain_all()
|
|
287
|
+
|
|
288
|
+
def get_domain_list(self) -> List[str]:
|
|
289
|
+
raise NotImplementedError
|
|
290
|
+
|
|
291
|
+
def set_domain_list(self, domain_list: List[str]):
|
|
292
|
+
raise NotImplementedError
|
|
@@ -226,7 +226,7 @@ class JmOption:
|
|
|
226
226
|
"""
|
|
227
227
|
|
|
228
228
|
@field_cache("__jm_client_cache__")
|
|
229
|
-
def build_jm_client(self, **kwargs)
|
|
229
|
+
def build_jm_client(self, **kwargs):
|
|
230
230
|
"""
|
|
231
231
|
该方法会首次调用会创建JmcomicClient对象,
|
|
232
232
|
然后保存在self.__jm_client_cache__中,
|
|
@@ -234,7 +234,7 @@ class JmOption:
|
|
|
234
234
|
"""
|
|
235
235
|
return self.new_jm_client(**kwargs)
|
|
236
236
|
|
|
237
|
-
def new_jm_client(self, **kwargs) -> JmcomicClient:
|
|
237
|
+
def new_jm_client(self, domain_list=None, **kwargs) -> JmcomicClient:
|
|
238
238
|
postman_conf: dict = self.client.postman.src_dict
|
|
239
239
|
|
|
240
240
|
# support kwargs overwrite meta_data
|
|
@@ -247,7 +247,7 @@ class JmOption:
|
|
|
247
247
|
postman = Postmans.create(data=postman_conf)
|
|
248
248
|
|
|
249
249
|
# domain_list
|
|
250
|
-
domain_list = self.client.domain
|
|
250
|
+
domain_list: List[str] = domain_list or self.client.domain
|
|
251
251
|
if len(domain_list) == 0:
|
|
252
252
|
domain_list = [JmModuleConfig.domain()]
|
|
253
253
|
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|