Skip to content

Commit

Permalink
fix: python binding CMakeLists.txt regression in commands
Browse files Browse the repository at this point in the history
  • Loading branch information
cryptochassis committed Sep 14, 2023
1 parent 1bd72b0 commit 69451f9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
1 change: 1 addition & 0 deletions binding/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ add_custom_target(${PYTHON_PACKAGING_TARGET_NAME} ALL
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/setup.py ${PACKAGING_DIR_FULL}
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/${SWIG_TARGET_NAME}/ccapi.py ${PACKAGING_DIR_FULL}
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:${SWIG_TARGET_NAME}> ${PACKAGING_DIR_FULL}
COMMAND ${Python_EXECUTABLE} -m pip install --upgrade setuptools wheel
COMMAND ${Python_EXECUTABLE} setup.py bdist_wheel
COMMAND ${Python_EXECUTABLE} -m pip install --upgrade .
WORKING_DIRECTORY ${PACKAGING_DIR_FULL}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class MyEventHandler(EventHandler):
def __init__(self):
super().__init__()
def processEvent(self, event: Event, session: Session) -> bool:
if event.getType() == Event.SUBSCRIPTION_STATUS:
if event.getType() == Event.Type_SUBSCRIPTION_STATUS:
print(f'Received an event of type SUBSCRIPTION_STATUS:\n{event.toStringPretty(2, 2)}')
elif event.getType() == Event.Type_SUBSCRIPTION_DATA:
for message in event.getMessageList():
Expand All @@ -21,11 +21,6 @@ def processEvent(self, event: Event, session: Session) -> bool:
session = Session(option, config, eventHandler)
subscription = Subscription('okx', 'BTC-USDT', 'MARKET_DEPTH')
session.subscribe(subscription)
request = Request(Request.Operation_GET_RECENT_TRADES, 'okx', 'BTC-USDT')
request.appendParam({
'LIMIT':'1',
})
session.sendRequest(request)
time.sleep(10)
session.stop()
print('Bye')

0 comments on commit 69451f9

Please sign in to comment.