isrpa 1.0.5__py3-none-any.whl → 1.0.7__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
@@ -1,11 +1,14 @@
1
1
  import os
2
2
 
3
+ import redis
3
4
  import requests
4
5
  import tldextract
5
6
  from dotenv import load_dotenv
6
7
 
7
8
  load_dotenv("/isearch/aiAgent/.env", override=True)
8
9
  address = os.getenv("address")
10
+ client = redis.Redis(host=os.getenv("REDIS_HOST"), port=os.getenv("REDIS_PORT"), db=os.getenv("REDIS_DB"),
11
+ password=os.getenv("REDIS_PASSWORD"))
9
12
 
10
13
 
11
14
  def getPath(user_name):
@@ -90,9 +93,17 @@ def get_active_url(user_name):
90
93
  return "failure"
91
94
  return response.json()
92
95
 
93
- data = get_json()
94
- if data:
95
- return data[0].get("url")
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
+ return page.get("url")
96
107
  return None
97
108
 
98
109
 
@@ -106,6 +117,10 @@ def get_active_page(browser, active_url):
106
117
  return page
107
118
 
108
119
 
120
+ def set_playwright_file_path(key, value):
121
+ client.set(key, value, ex=30)
122
+
123
+
109
124
  def upload_file(file_path, dest_file, user_name):
110
125
  """
111
126
  通知客户端上传文件
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: isrpa
3
- Version: 1.0.5
3
+ Version: 1.0.7
4
4
  Summary: isrpa package
5
5
  Home-page: https://github.com/yourusername/mypackage
6
6
  Author: ysq
@@ -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=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,,
8
+ isrpa/utils.py,sha256=E4iTPy8frpxiSMASbIel8R_rgOY0JH-sQu5PwqUfonM,5412
9
+ isrpa-1.0.7.dist-info/METADATA,sha256=a4fQciGd3TKkA7l6OlWpq7m4I8HX_Y-f5uGDfxpcd9s,511
10
+ isrpa-1.0.7.dist-info/WHEEL,sha256=R06PA3UVYHThwHvxuRWMqaGcr-PuniXahwjmQRFMEkY,91
11
+ isrpa-1.0.7.dist-info/top_level.txt,sha256=J5HJbtR2WAeKnW1rrpkiuapwnlswv3RgM-riyZD87o0,6
12
+ isrpa-1.0.7.dist-info/RECORD,,
File without changes