isrpa 1.0.4__py3-none-any.whl → 1.0.5__py3-none-any.whl
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.
isrpa/utils.py
CHANGED
@@ -20,13 +20,44 @@ def getPath(user_name):
|
|
20
20
|
:param port:
|
21
21
|
:return:
|
22
22
|
"""
|
23
|
+
|
24
|
+
# address = os.environ.get("address", "192.168.12.249")
|
25
|
+
|
26
|
+
url = f"{address}/client/getPath"
|
27
|
+
headers = {
|
28
|
+
'Content-Type': 'application/json', # 说明请求体是 JSON 格式
|
29
|
+
}
|
30
|
+
# 请求体的数据
|
31
|
+
data = {
|
32
|
+
'user_name': user_name
|
33
|
+
}
|
34
|
+
response = requests.post(url, headers=headers, json=data)
|
35
|
+
if response.status_code != 200:
|
36
|
+
return "failure"
|
37
|
+
data = response.json()
|
38
|
+
return f"ws://{data.get('ip_address')}:{data.get('port')}"
|
39
|
+
|
40
|
+
|
41
|
+
def get_ssh_path(user_name):
|
42
|
+
"""
|
43
|
+
环境变量设置
|
44
|
+
windows
|
45
|
+
setx address "192.168.12.249"
|
46
|
+
|
47
|
+
linux
|
48
|
+
export address = "192.168.12.249"
|
49
|
+
source /etc/profile
|
50
|
+
:param port:
|
51
|
+
:return:
|
52
|
+
"""
|
23
53
|
url = f"{address}/client/getPath"
|
24
54
|
headers = {'Content-Type': 'application/json'}
|
25
55
|
data = {'user_name': user_name}
|
26
56
|
response = requests.post(url, headers=headers, json=data)
|
27
57
|
if response.status_code != 200:
|
28
58
|
return "failure"
|
29
|
-
|
59
|
+
data = response.json()
|
60
|
+
port = data.get('port')
|
30
61
|
|
31
62
|
def get_ws_url():
|
32
63
|
url = f"http://localhost:{port}/json/version"
|
@@ -49,7 +80,8 @@ def get_active_url(user_name):
|
|
49
80
|
response = requests.post(url, headers=headers, json=data)
|
50
81
|
if response.status_code != 200:
|
51
82
|
return "failure"
|
52
|
-
|
83
|
+
data = response.json()
|
84
|
+
port = data.get('port')
|
53
85
|
|
54
86
|
def get_json():
|
55
87
|
url = f"http://localhost:{port}/json"
|
@@ -5,8 +5,8 @@ isrpa/__init__.py,sha256=pG-YPVG0gJIJ6s4xcAz9S_CnUxpUcz33wl9eNUSgxGk,20
|
|
5
5
|
isrpa/credentials.py,sha256=5paT4rxtZIUPqADmi1bLkoSKEYoosgS7rIjrJsgMNIs,3350
|
6
6
|
isrpa/llm_chat.py,sha256=jTuK9wcm3X36V9lXuGuTCdNup_zi2NeG2GuYHzO7gm4,1541
|
7
7
|
isrpa/message.py,sha256=N0s6hMaC5S-Pi4EhwcSp-ngfBTBQyW6ymU9sI9dUSeE,11329
|
8
|
-
isrpa/utils.py,sha256=
|
9
|
-
isrpa-1.0.
|
10
|
-
isrpa-1.0.
|
11
|
-
isrpa-1.0.
|
12
|
-
isrpa-1.0.
|
8
|
+
isrpa/utils.py,sha256=7gtqQhWaQezuOO9WcS03TN6meqNYD8bAgn4NK7yqxDc,4815
|
9
|
+
isrpa-1.0.5.dist-info/METADATA,sha256=Isa7hR1IkpzD9lCotUpEC0ORXxK_N2NIf0tp6BVmesU,511
|
10
|
+
isrpa-1.0.5.dist-info/WHEEL,sha256=R06PA3UVYHThwHvxuRWMqaGcr-PuniXahwjmQRFMEkY,91
|
11
|
+
isrpa-1.0.5.dist-info/top_level.txt,sha256=J5HJbtR2WAeKnW1rrpkiuapwnlswv3RgM-riyZD87o0,6
|
12
|
+
isrpa-1.0.5.dist-info/RECORD,,
|
File without changes
|
File without changes
|