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.
Files changed (16) hide show
  1. {sc_common_interface-2.9.2 → sc_common_interface-2.9.4}/PKG-INFO +1 -1
  2. {sc_common_interface-2.9.2 → sc_common_interface-2.9.4}/sc_common_interface/ScWebsocket.py +5 -6
  3. {sc_common_interface-2.9.2 → sc_common_interface-2.9.4}/sc_common_interface.egg-info/PKG-INFO +1 -1
  4. sc_common_interface-2.9.4/sc_common_interface.egg-info/requires.txt +4 -0
  5. {sc_common_interface-2.9.2 → sc_common_interface-2.9.4}/setup.py +4 -2
  6. sc_common_interface-2.9.2/sc_common_interface.egg-info/requires.txt +0 -2
  7. {sc_common_interface-2.9.2 → sc_common_interface-2.9.4}/sc_common_interface/CommonOa.py +0 -0
  8. {sc_common_interface-2.9.2 → sc_common_interface-2.9.4}/sc_common_interface/LiveCommonInterface.py +0 -0
  9. {sc_common_interface-2.9.2 → sc_common_interface-2.9.4}/sc_common_interface/McCommonInterface.py +0 -0
  10. {sc_common_interface-2.9.2 → sc_common_interface-2.9.4}/sc_common_interface/Platform.py +0 -0
  11. {sc_common_interface-2.9.2 → sc_common_interface-2.9.4}/sc_common_interface/PostCommonInterface.py +0 -0
  12. {sc_common_interface-2.9.2 → sc_common_interface-2.9.4}/sc_common_interface/__init__.py +0 -0
  13. {sc_common_interface-2.9.2 → sc_common_interface-2.9.4}/sc_common_interface.egg-info/SOURCES.txt +0 -0
  14. {sc_common_interface-2.9.2 → sc_common_interface-2.9.4}/sc_common_interface.egg-info/dependency_links.txt +0 -0
  15. {sc_common_interface-2.9.2 → sc_common_interface-2.9.4}/sc_common_interface.egg-info/top_level.txt +0 -0
  16. {sc_common_interface-2.9.2 → sc_common_interface-2.9.4}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sc_common_interface
3
- Version: 2.9.2
3
+ Version: 2.9.4
4
4
  Summary: SC贴文销售公用的接口
5
5
  Home-page: UNKNOWN
6
6
  Author: river
@@ -54,7 +54,7 @@ class WebSocketClient:
54
54
  }
55
55
  ws.send(json.dumps(subscribe))
56
56
 
57
- def on_message(self, ws,message):
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
- #20秒后关闭
69
- time.sleep(10)
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
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sc-common-interface
3
- Version: 2.9.2
3
+ Version: 2.9.4
4
4
  Summary: SC贴文销售公用的接口
5
5
  Home-page: UNKNOWN
6
6
  Author: river
@@ -0,0 +1,4 @@
1
+ requests>=2.0.0
2
+ jsonpath>=0.82
3
+ websocket-client>=1.8.0
4
+ cryptography>=44.0.2
@@ -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.2',
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
 
@@ -1,2 +0,0 @@
1
- requests>=2.0.0
2
- jsonpath>=0.82