sc-common-interface 2.9.2__tar.gz → 2.9.4__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.
- {sc_common_interface-2.9.2 → sc_common_interface-2.9.4}/PKG-INFO +1 -1
- {sc_common_interface-2.9.2 → sc_common_interface-2.9.4}/sc_common_interface/ScWebsocket.py +5 -6
- {sc_common_interface-2.9.2 → sc_common_interface-2.9.4}/sc_common_interface.egg-info/PKG-INFO +1 -1
- sc_common_interface-2.9.4/sc_common_interface.egg-info/requires.txt +4 -0
- {sc_common_interface-2.9.2 → sc_common_interface-2.9.4}/setup.py +4 -2
- sc_common_interface-2.9.2/sc_common_interface.egg-info/requires.txt +0 -2
- {sc_common_interface-2.9.2 → sc_common_interface-2.9.4}/sc_common_interface/CommonOa.py +0 -0
- {sc_common_interface-2.9.2 → sc_common_interface-2.9.4}/sc_common_interface/LiveCommonInterface.py +0 -0
- {sc_common_interface-2.9.2 → sc_common_interface-2.9.4}/sc_common_interface/McCommonInterface.py +0 -0
- {sc_common_interface-2.9.2 → sc_common_interface-2.9.4}/sc_common_interface/Platform.py +0 -0
- {sc_common_interface-2.9.2 → sc_common_interface-2.9.4}/sc_common_interface/PostCommonInterface.py +0 -0
- {sc_common_interface-2.9.2 → sc_common_interface-2.9.4}/sc_common_interface/__init__.py +0 -0
- {sc_common_interface-2.9.2 → sc_common_interface-2.9.4}/sc_common_interface.egg-info/SOURCES.txt +0 -0
- {sc_common_interface-2.9.2 → sc_common_interface-2.9.4}/sc_common_interface.egg-info/dependency_links.txt +0 -0
- {sc_common_interface-2.9.2 → sc_common_interface-2.9.4}/sc_common_interface.egg-info/top_level.txt +0 -0
- {sc_common_interface-2.9.2 → sc_common_interface-2.9.4}/setup.cfg +0 -0
|
@@ -54,7 +54,7 @@ class WebSocketClient:
|
|
|
54
54
|
}
|
|
55
55
|
ws.send(json.dumps(subscribe))
|
|
56
56
|
|
|
57
|
-
def on_message(self,
|
|
57
|
+
def on_message(self,ws,message):
|
|
58
58
|
print("收到消息:", message)
|
|
59
59
|
|
|
60
60
|
def on_error(self,ws,error):
|
|
@@ -62,17 +62,16 @@ class WebSocketClient:
|
|
|
62
62
|
|
|
63
63
|
def on_close(self,ws, res1, res2):
|
|
64
64
|
print("连接已关闭", res1, res2)
|
|
65
|
+
self.ws.close()
|
|
65
66
|
|
|
66
67
|
def run(self):
|
|
67
68
|
self.ws.run_forever()
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
print("10秒后主动关闭")
|
|
69
|
+
def close(self):
|
|
70
|
+
print("主动关闭")
|
|
71
71
|
self.ws.close()
|
|
72
72
|
|
|
73
73
|
|
|
74
74
|
|
|
75
|
-
|
|
76
75
|
def get_imtoken(admin_url,sales_id):
|
|
77
76
|
url = "%s/api/posts/live/viewer/unauthorized/post/sales/%d/user/info?appId=SL101-web"%(admin_url,sales_id)
|
|
78
77
|
headers = {"content-type":"application/json"}
|
|
@@ -107,7 +106,6 @@ def load_private_key(pri_key_str):
|
|
|
107
106
|
)
|
|
108
107
|
|
|
109
108
|
|
|
110
|
-
|
|
111
109
|
if __name__=="__main__":
|
|
112
110
|
# admin_url = "https://front-service.shoplinestg.com"
|
|
113
111
|
# url = "ws://service-websocket.myshoplinestg.com/"
|
|
@@ -117,5 +115,6 @@ if __name__=="__main__":
|
|
|
117
115
|
|
|
118
116
|
webSocketClient = WebSocketClient(url,admin_url,561242)
|
|
119
117
|
webSocketClient.run()
|
|
118
|
+
webSocketClient.close()
|
|
120
119
|
|
|
121
120
|
|
|
@@ -2,13 +2,15 @@ from setuptools import setup, find_packages
|
|
|
2
2
|
|
|
3
3
|
setup(
|
|
4
4
|
name='sc_common_interface',
|
|
5
|
-
version='2.9.
|
|
5
|
+
version='2.9.4',
|
|
6
6
|
description='SC贴文销售公用的接口',
|
|
7
7
|
author='river',
|
|
8
8
|
packages=find_packages(),
|
|
9
9
|
install_requires=[
|
|
10
10
|
"requests>=2.0.0",
|
|
11
|
-
"jsonpath>=0.82"
|
|
11
|
+
"jsonpath>=0.82",
|
|
12
|
+
"websocket-client>=1.8.0",
|
|
13
|
+
"cryptography>=44.0.2"
|
|
12
14
|
],
|
|
13
15
|
)
|
|
14
16
|
|
|
File without changes
|
{sc_common_interface-2.9.2 → sc_common_interface-2.9.4}/sc_common_interface/LiveCommonInterface.py
RENAMED
|
File without changes
|
{sc_common_interface-2.9.2 → sc_common_interface-2.9.4}/sc_common_interface/McCommonInterface.py
RENAMED
|
File without changes
|
|
File without changes
|
{sc_common_interface-2.9.2 → sc_common_interface-2.9.4}/sc_common_interface/PostCommonInterface.py
RENAMED
|
File without changes
|
|
File without changes
|
{sc_common_interface-2.9.2 → sc_common_interface-2.9.4}/sc_common_interface.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{sc_common_interface-2.9.2 → sc_common_interface-2.9.4}/sc_common_interface.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|