isrpa 1.1.0__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: isrpa
3
- Version: 1.1.0
3
+ Version: 1.1.2
4
4
  Summary: isrpa package
5
5
  Home-page: https://github.com/yourusername/mypackage
6
6
  Author: ysq
@@ -24,13 +24,10 @@ def getPath(user_name):
24
24
  :return:
25
25
  """
26
26
 
27
- # address = os.environ.get("address", "192.168.12.249")
28
-
29
27
  url = f"{address}/client/getPath"
30
28
  headers = {
31
- 'Content-Type': 'application/json', # 说明请求体是 JSON 格式
29
+ 'Content-Type': 'application/json',
32
30
  }
33
- # 请求体的数据
34
31
  data = {
35
32
  'user_name': user_name
36
33
  }
@@ -64,10 +61,12 @@ def get_ssh_path(user_name):
64
61
 
65
62
  def get_ws_url():
66
63
  url = f"http://localhost:{port}/json/version"
67
- response = requests.get(url)
68
- if response.status_code != 200:
64
+ r = requests.get(url, headers={"Connection": "close"}, stream=True)
65
+ if r.status_code != 200:
69
66
  return "failure"
70
- return response.json().get('webSocketDebuggerUrl')
67
+ url = r.json().get('webSocketDebuggerUrl')
68
+ r.close()
69
+ return url
71
70
 
72
71
  ws_url = get_ws_url()
73
72
  return ws_url
@@ -88,7 +87,7 @@ def get_url(user_name):
88
87
 
89
88
  def get_json():
90
89
  url = f"http://localhost:{port}/json"
91
- response = requests.get(url)
90
+ response = requests.get(url, headers={"Connection": "close"}, stream=True)
92
91
  if response.status_code != 200:
93
92
  return "failure"
94
93
  return response.json()
@@ -123,10 +122,12 @@ def get_active_url(user_name):
123
122
 
124
123
  def get_json():
125
124
  url = f"http://localhost:{port}/json"
126
- response = requests.get(url)
127
- if response.status_code != 200:
125
+ r = requests.get(url, headers={"Connection": "close"}, stream=True)
126
+ if r.status_code != 200:
128
127
  return "failure"
129
- return response.json()
128
+ json_data = r.json()
129
+ r.close()
130
+ return json_data
130
131
 
131
132
  pages = get_json()
132
133
  if pages:
@@ -137,9 +138,6 @@ def get_active_url(user_name):
137
138
  page.get("title") == "MagicalAutomator-sidePanel"
138
139
  ):
139
140
  continue
140
- # else:
141
- # if page.get("url") == "chrome://newtab/":
142
- # return "chrome://new-tab-page/"
143
141
  return page.get("id")
144
142
  return None
145
143
 
@@ -169,12 +167,10 @@ def upload_file(file_path, dest_file, user_name):
169
167
  :return:
170
168
  """
171
169
 
172
- # address = os.environ.get("address", "192.168.12.249")
173
170
  url = f"{address}/client/noticeUpload"
174
171
  headers = {
175
- 'Content-Type': 'application/json', # 说明请求体是 JSON 格式
172
+ 'Content-Type': 'application/json',
176
173
  }
177
- # 请求体的数据
178
174
  data = {
179
175
  'file_path': file_path,
180
176
  'dest_file': dest_file,
@@ -194,10 +190,9 @@ def vCode(image: str, code_type, apiKey, secretKey):
194
190
  """
195
191
  url = "https://ai.i-search.com.cn/ocr/v2/vCode"
196
192
  headers = {
197
- 'Content-Type': 'application/json', # 说明请求体是 JSON 格式
193
+ 'Content-Type': 'application/json',
198
194
  }
199
195
 
200
- # 请求体的数据
201
196
  data = {
202
197
  'image': image,
203
198
  'code_type': code_type,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: isrpa
3
- Version: 1.1.0
3
+ Version: 1.1.2
4
4
  Summary: isrpa package
5
5
  Home-page: https://github.com/yourusername/mypackage
6
6
  Author: ysq
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name='isrpa',
5
- version='1.1.0',
5
+ version='1.1.2',
6
6
  packages=find_packages(),
7
7
  install_requires=["requests", "tldextract"],
8
8
  author='ysq',
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