isrpa 1.1.1__tar.gz → 1.1.3__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.1
3
+ Version: 1.1.3
4
4
  Summary: isrpa package
5
5
  Home-page: https://github.com/yourusername/mypackage
6
6
  Author: ysq
@@ -60,11 +60,17 @@ def get_ssh_path(user_name):
60
60
  port = data.get('port')
61
61
 
62
62
  def get_ws_url():
63
- url = f"http://localhost:{port}/json/version"
64
- response = requests.get(url, headers={"Connection": "close"}, stream=True)
65
- if response.status_code != 200:
66
- return "failure"
67
- return response.json().get('webSocketDebuggerUrl')
63
+ for _ in range(3):
64
+ try:
65
+ url = f"http://localhost:{port}/json/version"
66
+ r = requests.get(url, headers={"Connection": "close"}, stream=True, timeout=5)
67
+ if r.status_code != 200:
68
+ return "failure"
69
+ url = r.json().get('webSocketDebuggerUrl')
70
+ r.close()
71
+ return url
72
+ except Exception as e:
73
+ pass
68
74
 
69
75
  ws_url = get_ws_url()
70
76
  return ws_url
@@ -84,11 +90,15 @@ def get_url(user_name):
84
90
  port = data.get('port')
85
91
 
86
92
  def get_json():
87
- url = f"http://localhost:{port}/json"
88
- response = requests.get(url, headers={"Connection": "close"}, stream=True)
89
- if response.status_code != 200:
90
- return "failure"
91
- return response.json()
93
+ for _ in range(3):
94
+ try:
95
+ url = f"http://localhost:{port}/json"
96
+ response = requests.get(url, headers={"Connection": "close"}, stream=True, timeout=5)
97
+ if response.status_code != 200:
98
+ return "failure"
99
+ return response.json()
100
+ except Exception as e:
101
+ pass
92
102
 
93
103
  pages = get_json()
94
104
  if pages:
@@ -119,11 +129,17 @@ def get_active_url(user_name):
119
129
  port = data.get('port')
120
130
 
121
131
  def get_json():
122
- url = f"http://localhost:{port}/json"
123
- response = requests.get(url, headers={"Connection": "close"}, stream=True)
124
- if response.status_code != 200:
125
- return "failure"
126
- return response.json()
132
+ for _ in range(3):
133
+ try:
134
+ url = f"http://localhost:{port}/json"
135
+ r = requests.get(url, headers={"Connection": "close"}, stream=True, timeout=5)
136
+ if r.status_code != 200:
137
+ return "failure"
138
+ json_data = r.json()
139
+ r.close()
140
+ return json_data
141
+ except Exception as e:
142
+ pass
127
143
 
128
144
  pages = get_json()
129
145
  if pages:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: isrpa
3
- Version: 1.1.1
3
+ Version: 1.1.3
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.1',
5
+ version='1.1.3',
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