Skip to content

Commit

Permalink
fix get_finance_info value mismatch
Browse files Browse the repository at this point in the history
  • Loading branch information
rainx committed Oct 9, 2017
1 parent cd8bf00 commit f043cfe
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
4 changes: 4 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
1.47
------
* 修复 版本1.45 修改时引发的其它数据无法匹配问题

1.46
------
* 将parser基类中的base.py里面的异常从继承BaseException改为集成Exception, 对应修复问题:https://github.com/rainx/pytdx/issues/68
Expand Down
11 changes: 9 additions & 2 deletions pytdx/parser/get_finance_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def parseResponse(self, body_buf):
weifenlirun,
baoliu1,
baoliu2
) = struct.unpack("<IHHfIIIIfffffffffffffffffffffffffff", body_buf[pos:])
) = struct.unpack("<fHHIIffffffffffffffffffffffffffffff", body_buf[pos:])

def _get_v(v):
return v
Expand Down Expand Up @@ -125,4 +125,11 @@ def _get_v(v):
("baoliu1", _get_v(baoliu1)),
("baoliu2", _get_v(baoliu2))
]
)
)

if __name__ == '__main__':
import pprint
from pytdx.hq import TdxHq_API
api = TdxHq_API()
with api.connect():
pprint.pprint(api.get_finance_info(0, "000166"))
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

setup(
name='pytdx',
version='1.46',
version='1.47',
description='A Python Interface to TDX protocol',
long_description=long_description,
author='RainX<Jing Xu>',
Expand Down

0 comments on commit f043cfe

Please sign in to comment.