tushare 1.4.8__py3-none-any.whl → 1.4.9__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.
- tushare/__init__.py +1 -1
- tushare/subs/ts_subs/subscribe.py +8 -4
- {tushare-1.4.8.dist-info → tushare-1.4.9.dist-info}/METADATA +1 -1
- {tushare-1.4.8.dist-info → tushare-1.4.9.dist-info}/RECORD +7 -7
- {tushare-1.4.8.dist-info → tushare-1.4.9.dist-info}/LICENSE +0 -0
- {tushare-1.4.8.dist-info → tushare-1.4.9.dist-info}/WHEEL +0 -0
- {tushare-1.4.8.dist-info → tushare-1.4.9.dist-info}/top_level.txt +0 -0
tushare/__init__.py
CHANGED
@@ -28,7 +28,7 @@ logger = logging.getLogger(__name__)
|
|
28
28
|
class TsSubscribe(object):
|
29
29
|
|
30
30
|
def __init__(self, token='', callback_mode='multi-thread', debug=False):
|
31
|
-
self.url = '
|
31
|
+
self.url = 'ws://10.255.255.202:8081/listening'
|
32
32
|
self.token = token
|
33
33
|
self.debug = debug
|
34
34
|
|
@@ -58,7 +58,11 @@ class TsSubscribe(object):
|
|
58
58
|
logger.info('application starting...')
|
59
59
|
self.threading_keepalive_ping()
|
60
60
|
|
61
|
-
def on_message(self,
|
61
|
+
def on_message(self, *args, **kwargs):
|
62
|
+
if isinstance(args[0], websocket.WebSocketApp):
|
63
|
+
message = args[1]
|
64
|
+
else:
|
65
|
+
message = args[0]
|
62
66
|
logger.debug(message)
|
63
67
|
if isinstance(message, (str, bytes, bytearray)):
|
64
68
|
resp_data = json.loads(message)
|
@@ -173,10 +177,10 @@ class TsSubscribe(object):
|
|
173
177
|
|
174
178
|
|
175
179
|
def test():
|
176
|
-
app = TsSubscribe(token='')
|
180
|
+
app = TsSubscribe(token='xxx')
|
177
181
|
|
178
182
|
# code 可以包含 * (通配符)
|
179
|
-
@app.register(topic='
|
183
|
+
@app.register(topic='HQ_STK_MIN', codes=["*"])
|
180
184
|
def print_message(record):
|
181
185
|
"""
|
182
186
|
订阅主题topic,并指定codes列表,在接收到topic的推送消息时,符合code条件,就会执行回调
|
@@ -1,4 +1,4 @@
|
|
1
|
-
tushare/__init__.py,sha256=
|
1
|
+
tushare/__init__.py,sha256=rOlJsCMrNKMYvCfqTJobHK-xF8Y6Lk-QZk5ReTtU8ME,4764
|
2
2
|
tushare/bond/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
3
3
|
tushare/bond/bonds.py,sha256=PJM0xDiWZDpOPwDtbEU9PdP0M_Gu0c599YuB1rbZ3r8,232
|
4
4
|
tushare/coins/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -50,7 +50,7 @@ tushare/subs/tgw_subs/convert.py,sha256=VWsDOv_rmz3a9YjQ-ZThXerc1HqcWPlBYAOF6A9S
|
|
50
50
|
tushare/subs/tgw_subs/login.py,sha256=z7laiscTx50LzOB0cM2hypv5E78DvWx-2Ip5kDE7uNk,903
|
51
51
|
tushare/subs/tgw_subs/subscribe.py,sha256=OwLKcSTN2xrge33hBkio_S188viMeGuicDj_x0VaR2A,3336
|
52
52
|
tushare/subs/ts_subs/__init__.py,sha256=AyX957j8DDjdpIYcNR7dyRaMfxusa6d2VeunMEB6RAc,107
|
53
|
-
tushare/subs/ts_subs/subscribe.py,sha256=
|
53
|
+
tushare/subs/ts_subs/subscribe.py,sha256=fCBc4vb1kPawyhEmn_kCVrgEkOw1c61I18wTE7DwVf0,6209
|
54
54
|
tushare/trader/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
55
55
|
tushare/trader/trader.py,sha256=O2WJkIKGuUFK_hiQj83N5j971VW-TNAgKaCE0O4oFwg,11360
|
56
56
|
tushare/trader/utils.py,sha256=CG-TCyeu5WqYjnBARxft2lEnLD3xvhHLU40hPSL_CCw,752
|
@@ -71,8 +71,8 @@ tushare/util/verify_token.py,sha256=cuV3RErWbOC318NANCYL6K1LKZ3wSAL2yMwZHA7tD3s,
|
|
71
71
|
tushare/util/protobuf/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
72
72
|
tushare/util/protobuf/funcs.py,sha256=UCdK8FxTyjPZsNzoEeXqYzqrQXUmRMvW5hua6GPA66A,779
|
73
73
|
tushare/util/protobuf/response_pb2.py,sha256=vJH9ONkDuJlg6y-q1PvuDZoviKrK7hzNtMieQHK45DI,11347
|
74
|
-
tushare-1.4.
|
75
|
-
tushare-1.4.
|
76
|
-
tushare-1.4.
|
77
|
-
tushare-1.4.
|
78
|
-
tushare-1.4.
|
74
|
+
tushare-1.4.9.dist-info/LICENSE,sha256=C2j55UI0Ul-1-wA1-rn7OaY6b3vGl4YukiyvYzHsU9o,1503
|
75
|
+
tushare-1.4.9.dist-info/METADATA,sha256=pnS8Py3RgZVnzdhOIf-MlTv8OYuqhq3cv96Gm_Lj3E4,2838
|
76
|
+
tushare-1.4.9.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
|
77
|
+
tushare-1.4.9.dist-info/top_level.txt,sha256=HHOxMuqc31KuAIcxpE0t5dAPMKbaiRtjsjTMFd7FlXI,8
|
78
|
+
tushare-1.4.9.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|