isrpa 1.0.9__py3-none-any.whl → 1.1.0__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
@@ -73,6 +73,41 @@ def get_ssh_path(user_name):
|
|
73
73
|
return ws_url
|
74
74
|
|
75
75
|
|
76
|
+
def get_url(user_name):
|
77
|
+
"""
|
78
|
+
获取当前激活page对象
|
79
|
+
"""
|
80
|
+
url = f"{address}/client/getPath"
|
81
|
+
headers = {'Content-Type': 'application/json'}
|
82
|
+
data = {'user_name': user_name}
|
83
|
+
response = requests.post(url, headers=headers, json=data)
|
84
|
+
if response.status_code != 200:
|
85
|
+
return "failure"
|
86
|
+
data = response.json()
|
87
|
+
port = data.get('port')
|
88
|
+
|
89
|
+
def get_json():
|
90
|
+
url = f"http://localhost:{port}/json"
|
91
|
+
response = requests.get(url)
|
92
|
+
if response.status_code != 200:
|
93
|
+
return "failure"
|
94
|
+
return response.json()
|
95
|
+
|
96
|
+
pages = get_json()
|
97
|
+
if pages:
|
98
|
+
for page in pages:
|
99
|
+
if (
|
100
|
+
page.get("url").startswith("chrome-extension://") or
|
101
|
+
page.get("url").startswith("chrome-untrusted://") or
|
102
|
+
page.get("title") == "MagicalAutomator-sidePanel"
|
103
|
+
):
|
104
|
+
continue
|
105
|
+
else:
|
106
|
+
if page.get("url") == "chrome://newtab/":
|
107
|
+
return "chrome://new-tab-page/"
|
108
|
+
return page.get("url")
|
109
|
+
return None
|
110
|
+
|
76
111
|
def get_active_url(user_name):
|
77
112
|
"""
|
78
113
|
获取当前激活page对象
|
@@ -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=tN270H9E_NK3bc-FnUX0fONjvb52yskBBMD0pUMf-ug,6819
|
9
|
+
isrpa-1.1.0.dist-info/METADATA,sha256=jeFGuZLYUJ42huP0r-gliPCx6yvoMhhbAnUKpypIQJ0,511
|
10
|
+
isrpa-1.1.0.dist-info/WHEEL,sha256=R06PA3UVYHThwHvxuRWMqaGcr-PuniXahwjmQRFMEkY,91
|
11
|
+
isrpa-1.1.0.dist-info/top_level.txt,sha256=J5HJbtR2WAeKnW1rrpkiuapwnlswv3RgM-riyZD87o0,6
|
12
|
+
isrpa-1.1.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|