isrpa 0.9.4__py3-none-any.whl → 0.9.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/credentials.py CHANGED
@@ -1,8 +1,10 @@
1
1
  import os
2
2
 
3
3
  import requests
4
+ from dotenv import load_dotenv
4
5
 
5
-
6
+ load_dotenv("/isearch/.env", override=True)
7
+ address = os.getenv("address")
6
8
  def store_key(key_name,key_value,user_name):
7
9
  """
8
10
  用户凭证存储
@@ -11,9 +13,9 @@ def store_key(key_name,key_value,user_name):
11
13
  user_name:用户名
12
14
 
13
15
  """
14
- address = os.environ.get("address", "192.168.12.249")
16
+ # address = os.environ.get("address", "192.168.12.249")
15
17
  print(address)
16
- url = f"http://192.168.12.241/console/api/user_credentials"
18
+ url = f"{address}/console/api/user_credentials"
17
19
  print(url)
18
20
  headers = {
19
21
  'Content-Type': 'application/json', # 说明请求体是 JSON 格式
@@ -39,8 +41,8 @@ def get_key(key_name, user_name):
39
41
  key_name:凭证key
40
42
  user_name:用户名称
41
43
  """
42
- address = os.environ.get("address", "192.168.12.249")
43
- url = f"http://192.168.12.241/console/api/user_credentials?certificate_key={key_name}&user_name={user_name}"
44
+ # address = os.environ.get("address", "192.168.12.249")
45
+ url = f"{address}/console/api/user_credentials?certificate_key={key_name}&user_name={user_name}"
44
46
  print(url)
45
47
  response = requests.get(url)
46
48
  if response.status_code != 200:
@@ -57,8 +59,8 @@ def delete_key(key_name,user_name):
57
59
  key_name:凭证key
58
60
  user_name:用户名称
59
61
  """
60
- address = os.environ.get("address", "192.168.12.249")
61
- url = f"http://192.168.12.241/console/api/user_credentials"
62
+ # address = os.environ.get("address", "192.168.12.249")
63
+ url = f"{address}/console/api/user_credentials"
62
64
  print(url)
63
65
  headers = {
64
66
  'Content-Type': 'application/json', # 说明请求体是 JSON 格式
@@ -76,8 +78,8 @@ def list(user_name):
76
78
  获取所有凭证key
77
79
  user_name:用户名称
78
80
  """
79
- address = os.environ.get("address", "192.168.12.249")
80
- url = f"http://192.168.12.241/console/api/user_credentials/list?user_name={user_name}"
81
+ # address = os.environ.get("address", "192.168.12.249")
82
+ url = f"{address}/console/api/user_credentials/list?user_name={user_name}"
81
83
  print(url)
82
84
  response = requests.get(url)
83
85
  if response.status_code != 200:
@@ -94,8 +96,8 @@ def exist(key_name, user_name):
94
96
  key_name:凭证key
95
97
  user_name:用户名称
96
98
  """
97
- address = os.environ.get("address", "192.168.12.249")
98
- url = f"http://192.168.12.241/console/api/user_credentials?certificate_key={key_name}&user_name={user_name}"
99
+ # address = os.environ.get("address", "192.168.12.249")
100
+ url = f"{address}/console/api/user_credentials?certificate_key={key_name}&user_name={user_name}"
99
101
  print(url)
100
102
  response = requests.get(url)
101
103
  if response.status_code != 200:
isrpa/utils.py CHANGED
@@ -2,8 +2,10 @@ import os
2
2
 
3
3
  import requests
4
4
  import tldextract
5
+ from dotenv import load_dotenv
5
6
 
6
-
7
+ load_dotenv("/isearch/.env", override=True)
8
+ address = os.getenv("address")
7
9
  def getPath(user_name):
8
10
  """
9
11
  环境变量设置
@@ -17,9 +19,9 @@ def getPath(user_name):
17
19
  :return:
18
20
  """
19
21
 
20
- address = os.environ.get("address", "192.168.12.249")
22
+ # address = os.environ.get("address", "192.168.12.249")
21
23
 
22
- url = f"http://192.168.12.241/client/getPath"
24
+ url = f"{address}/client/getPath"
23
25
  print(url)
24
26
  headers = {
25
27
  'Content-Type': 'application/json', # 说明请求体是 JSON 格式
@@ -45,8 +47,8 @@ def upload_file(file_path, dest_file, user_name):
45
47
  :return:
46
48
  """
47
49
 
48
- address = os.environ.get("address", "192.168.12.249")
49
- url = f"http://192.168.12.241/client/noticeUpload"
50
+ # address = os.environ.get("address", "192.168.12.249")
51
+ url = f"{address}/client/noticeUpload"
50
52
  print(url)
51
53
  headers = {
52
54
  'Content-Type': 'application/json', # 说明请求体是 JSON 格式
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: isrpa
3
- Version: 0.9.4
3
+ Version: 0.9.5
4
4
  Summary: isrpa package
5
5
  Home-page: https://github.com/yourusername/mypackage
6
6
  Author: ysq
@@ -2,10 +2,10 @@ isrpa/OCR.py,sha256=nSDmVLo_z9GV7GUY57xBh2kumERG5_xtpUPxeF6ziQE,2509
2
2
  isrpa/Template.py,sha256=UP1uovLvJzXEPGo_hzLrIYOu3vZP8Cf6m3G2hGzQ6XA,1958
3
3
  isrpa/Template_Exception.py,sha256=an6eQ1NMB8a9R-J0yyMdwHIZcZeDtdV5f7fWKZQsZ3s,819
4
4
  isrpa/__init__.py,sha256=pG-YPVG0gJIJ6s4xcAz9S_CnUxpUcz33wl9eNUSgxGk,20
5
- isrpa/credentials.py,sha256=YiE4C1crnljIIYreB6u2Bg7b1ZsRMYwmgkefdCAof1E,3247
5
+ isrpa/credentials.py,sha256=_QXB4ZzJ_gnSJiCv1kA3B3i40j9kSI7cOjlQrH2Z8eg,3304
6
6
  isrpa/message.py,sha256=N0s6hMaC5S-Pi4EhwcSp-ngfBTBQyW6ymU9sI9dUSeE,11329
7
- isrpa/utils.py,sha256=MRRikKbksJVU8cY03bwxPiAq51BqYtcVPAjHCJcEGYc,51352
8
- isrpa-0.9.4.dist-info/METADATA,sha256=pcHKouo_eOPU4lhU9DMgCo_x206ChdT6JI_EZLcmZGs,511
9
- isrpa-0.9.4.dist-info/WHEEL,sha256=R06PA3UVYHThwHvxuRWMqaGcr-PuniXahwjmQRFMEkY,91
10
- isrpa-0.9.4.dist-info/top_level.txt,sha256=J5HJbtR2WAeKnW1rrpkiuapwnlswv3RgM-riyZD87o0,6
11
- isrpa-0.9.4.dist-info/RECORD,,
7
+ isrpa/utils.py,sha256=uPCb1A1vDB0nTlII2BJz9kS0amk7mvzVA7ilI-UYA8Q,51439
8
+ isrpa-0.9.5.dist-info/METADATA,sha256=qO9iFu0KNh450zG_4NjC39mxVT09pvwTUz-gvCF5Mr8,511
9
+ isrpa-0.9.5.dist-info/WHEEL,sha256=R06PA3UVYHThwHvxuRWMqaGcr-PuniXahwjmQRFMEkY,91
10
+ isrpa-0.9.5.dist-info/top_level.txt,sha256=J5HJbtR2WAeKnW1rrpkiuapwnlswv3RgM-riyZD87o0,6
11
+ isrpa-0.9.5.dist-info/RECORD,,
File without changes