Skip to content

Commit b555341

Browse files
author
Kai Su
committed
modified: setup.py
modified: tigeropen/quote/response/quote_order_book_response.py
1 parent 9471275 commit b555341

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

setup.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
from os import path
88
from setuptools import find_packages, setup
99

10-
here = path.abspath(path.dirname(__file__))
11-
with open(path.join(here, 'requirements.txt'), encoding='utf-8') as f:
10+
with open(path.join(path.abspath(path.dirname(__file__)), 'requirements.txt'), encoding='utf-8') as f:
1211
install_requires = f.read()
1312

1413
setup(

tigeropen/quote/response/quote_order_book_response.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ def parse_response_content(self, response_content):
1616

1717
if self.data and isinstance(self.data, list):
1818
if len(self.data) == 1:
19-
for item in self.data:
20-
symbol = get_string(item.get('symbol'))
21-
asks = [(v['price'], v['volume'], v['count']) for v in item.get('asks', [])]
22-
bids = [(v['price'], v['volume'], v['count']) for v in item.get('bids', [])]
23-
self.order_book = {'symbol': symbol, 'asks': asks, 'bids': bids}
19+
item = self.data[0]
20+
symbol = get_string(item.get('symbol'))
21+
asks = [(v['price'], v['volume'], v['count']) for v in item.get('asks', [])]
22+
bids = [(v['price'], v['volume'], v['count']) for v in item.get('bids', [])]
23+
self.order_book = {'symbol': symbol, 'asks': asks, 'bids': bids}
2424
else:
2525
for item in self.data:
2626
symbol = get_string(item.get('symbol'))

0 commit comments

Comments
 (0)