pyscriptbase 1.1.1__tar.gz → 1.1.2__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.
Files changed (21) hide show
  1. {pyscriptbase-1.1.1 → pyscriptbase-1.1.2}/PKG-INFO +1 -1
  2. {pyscriptbase-1.1.1 → pyscriptbase-1.1.2}/pyscriptbase/script.py +13 -4
  3. {pyscriptbase-1.1.1 → pyscriptbase-1.1.2}/pyscriptbase.egg-info/PKG-INFO +1 -1
  4. {pyscriptbase-1.1.1 → pyscriptbase-1.1.2}/setup.py +1 -1
  5. {pyscriptbase-1.1.1 → pyscriptbase-1.1.2}/README.md +0 -0
  6. {pyscriptbase-1.1.1 → pyscriptbase-1.1.2}/pyscriptbase/__init__.py +0 -0
  7. {pyscriptbase-1.1.1 → pyscriptbase-1.1.2}/pyscriptbase/app.py +0 -0
  8. {pyscriptbase-1.1.1 → pyscriptbase-1.1.2}/pyscriptbase/cipher.py +0 -0
  9. {pyscriptbase-1.1.1 → pyscriptbase-1.1.2}/pyscriptbase/database.py +0 -0
  10. {pyscriptbase-1.1.1 → pyscriptbase-1.1.2}/pyscriptbase/env.py +0 -0
  11. {pyscriptbase-1.1.1 → pyscriptbase-1.1.2}/pyscriptbase/net.py +0 -0
  12. {pyscriptbase-1.1.1 → pyscriptbase-1.1.2}/pyscriptbase/panel.py +0 -0
  13. {pyscriptbase-1.1.1 → pyscriptbase-1.1.2}/pyscriptbase/pusher.py +0 -0
  14. {pyscriptbase-1.1.1 → pyscriptbase-1.1.2}/pyscriptbase/util.py +0 -0
  15. {pyscriptbase-1.1.1 → pyscriptbase-1.1.2}/pyscriptbase/webview.py +0 -0
  16. {pyscriptbase-1.1.1 → pyscriptbase-1.1.2}/pyscriptbase.egg-info/SOURCES.txt +0 -0
  17. {pyscriptbase-1.1.1 → pyscriptbase-1.1.2}/pyscriptbase.egg-info/dependency_links.txt +0 -0
  18. {pyscriptbase-1.1.1 → pyscriptbase-1.1.2}/pyscriptbase.egg-info/requires.txt +0 -0
  19. {pyscriptbase-1.1.1 → pyscriptbase-1.1.2}/pyscriptbase.egg-info/top_level.txt +0 -0
  20. {pyscriptbase-1.1.1 → pyscriptbase-1.1.2}/setup.cfg +0 -0
  21. {pyscriptbase-1.1.1 → pyscriptbase-1.1.2}/test/test.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyscriptbase
3
- Version: 1.1.1
3
+ Version: 1.1.2
4
4
  Summary: python script base library
5
5
  Home-page:
6
6
  Author: ASMan
@@ -2,6 +2,7 @@ from concurrent.futures import ThreadPoolExecutor, as_completed
2
2
  from traceback import format_exc
3
3
  from . import net
4
4
  from . import database
5
+ import random
5
6
 
6
7
 
7
8
  class ScriptApp:
@@ -12,8 +13,10 @@ class ScriptApp:
12
13
  self,
13
14
  index: int = 1,
14
15
  useProxy: bool = True,
16
+ randomProxy: bool = False,
15
17
  debug: bool = False,
16
18
  useCloud: bool = True,
19
+ randomCloud: bool = False,
17
20
  ) -> None:
18
21
  self.index = index
19
22
  self.logs = []
@@ -21,6 +24,8 @@ class ScriptApp:
21
24
  self.net = net.NetRequest()
22
25
  self.cloudNet = net.CloudRequest()
23
26
  self.cloudNet.net = self.net
27
+ self.randomProxy = randomProxy
28
+ self.randomCloud = randomCloud
24
29
  useProxy and self.__setProxy__(index)
25
30
  useCloud and self.__setCloudProxy__(index)
26
31
 
@@ -57,7 +62,10 @@ class ScriptApp:
57
62
  except:
58
63
  ScriptApp._proxies = [None]
59
64
  if len(ScriptApp._proxies):
60
- self.net.proxies = ScriptApp._proxies[index % len(ScriptApp._proxies)]
65
+ if self.randomProxy:
66
+ self.net.proxies = random.choice(ScriptApp._proxies)
67
+ else:
68
+ self.net.proxies = ScriptApp._proxies[index % len(ScriptApp._proxies)]
61
69
 
62
70
  def __setCloudProxy__(self, index: int) -> None:
63
71
  config = database.getDataConfig("account", "cloud_proxy")
@@ -84,9 +92,10 @@ class ScriptApp:
84
92
  except:
85
93
  ScriptApp._cloudProxies = []
86
94
  if len(ScriptApp._cloudProxies):
87
- self.cloudNet.cloud = ScriptApp._cloudProxies[
88
- index % len(ScriptApp._cloudProxies)
89
- ]
95
+ if self.randomCloud:
96
+ self.cloudNet.cloud = random.choice(ScriptApp._cloudProxies)
97
+ else:
98
+ self.cloudNet.cloud = ScriptApp._cloudProxies[index % len(ScriptApp._cloudProxies)]
90
99
 
91
100
  def __log__(self, msg: str | dict = "", flush: bool = False):
92
101
  if flush or self.debug:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyscriptbase
3
- Version: 1.1.1
3
+ Version: 1.1.2
4
4
  Summary: python script base library
5
5
  Home-page:
6
6
  Author: ASMan
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name="pyscriptbase", # 包名
5
- version="1.1.1", # 版本号
5
+ version="1.1.2", # 版本号
6
6
  packages=find_packages(), # 自动查找包
7
7
  author="ASMan",
8
8
  author_email="",
File without changes
File without changes
File without changes