Skip to content

Commit

Permalink
UnicornFy.get_version()
Browse files Browse the repository at this point in the history
  • Loading branch information
oliver-zehentleitner committed May 12, 2024
1 parent d8d93c3 commit 134c941
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
[How to upgrade to the latest version!](https://unicorn-fy.docs.lucit.tech/readme.html#installation-and-upgrade)

## 0.14.2.dev (development stage/unreleased/unstable)
### Added
- `__version__` and made use of it.
### Removed
- `binance_je_websocket()`
- `jex_com_websocket()`
Expand Down
18 changes: 9 additions & 9 deletions unicorn_fy/unicorn_fy.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,12 +273,12 @@ def binance_websocket(stream_data_json, exchange="binance", show_deprecated_warn

try:
if stream_data['result'] is None:
unicorn_fied_version = [exchange, UnicornFy.VERSION]
unicorn_fied_version = [exchange, UnicornFy.get_version()]
stream_data['unicorn_fied'] = unicorn_fied_version
logger.debug(f"UnicornFy->binance_websocket({str(stream_data)}, {str(exchange)}")
return stream_data
else:
unicorn_fied_version = [exchange, UnicornFy.VERSION]
unicorn_fied_version = [exchange, UnicornFy.get_version]
stream_data['unicorn_fied'] = unicorn_fied_version
logger.debug(f"UnicornFy->binance_websocket({str(stream_data)}, {str(exchange)}")
return stream_data
Expand All @@ -287,7 +287,7 @@ def binance_websocket(stream_data_json, exchange="binance", show_deprecated_warn

try:
if stream_data['error']:
unicorn_fied_version = [exchange, UnicornFy.VERSION]
unicorn_fied_version = [exchange, UnicornFy.get_version()]
stream_data['unicorn_fied'] = unicorn_fied_version
logger.debug(f"UnicornFy->binance_websocket({str(stream_data)}, {str(exchange)}")
return stream_data
Expand Down Expand Up @@ -558,7 +558,7 @@ def binance_websocket(stream_data_json, exchange="binance", show_deprecated_warn
'order_creation_time': stream_data['data']['O'],
'cumulative_quote_asset_transacted_quantity': stream_data['data']['Z'],
'last_quote_asset_transacted_quantity': stream_data['data']['Y']}
unicorn_fied_version = [exchange, UnicornFy.VERSION]
unicorn_fied_version = [exchange, UnicornFy.get_version()]
unicorn_fied_data['unicorn_fied'] = unicorn_fied_version
logger.debug("UnicornFy->binance_com_futures_websocket(" + str(unicorn_fied_data) + ")")
return unicorn_fied_data
Expand Down Expand Up @@ -644,12 +644,12 @@ def binance_futures_websocket(stream_data_json, exchange="binance.com-futures",

try:
if stream_data['result'] is None:
unicorn_fied_version = [exchange, UnicornFy.VERSION]
unicorn_fied_version = [exchange, UnicornFy.get_version()]
stream_data['unicorn_fied'] = unicorn_fied_version
logger.debug(f"UnicornFy->binance_futures_websocket({str(stream_data)}, {str(exchange)}")
return stream_data
else:
unicorn_fied_version = [exchange, UnicornFy.VERSION]
unicorn_fied_version = [exchange, UnicornFy.get_version()]
stream_data['unicorn_fied'] = unicorn_fied_version
logger.debug(f"UnicornFy->binance_futures_websocket({str(stream_data)}, {str(exchange)}")
return stream_data
Expand All @@ -658,7 +658,7 @@ def binance_futures_websocket(stream_data_json, exchange="binance.com-futures",

try:
if stream_data['error']:
unicorn_fied_version = [exchange, UnicornFy.VERSION]
unicorn_fied_version = [exchange, UnicornFy.get_version()]
stream_data['unicorn_fied'] = unicorn_fied_version
logger.debug(f"UnicornFy->binance_futures_websocket({str(stream_data)}, {str(exchange)}")
return stream_data
Expand Down Expand Up @@ -1243,7 +1243,7 @@ def binance_futures_websocket(stream_data_json, exchange="binance.com-futures",
except KeyError as error_msg:
logger.critical(f"UnicornFy->binance_futures_websocket({str(unicorn_fied_data)}) - "
f"error: {str(error_msg)} - Variable: {stream_data['data']}")
unicorn_fied_version = [exchange, UnicornFy.VERSION]
unicorn_fied_version = [exchange, UnicornFy.get_version()]
try:
unicorn_fied_data['unicorn_fied'] = unicorn_fied_version
except TypeError as error_msg:
Expand Down Expand Up @@ -1290,7 +1290,7 @@ def get_version():
:return: str
"""
return UnicornFy.VERSION
return __version__

@staticmethod
def is_json(data):
Expand Down

0 comments on commit 134c941

Please sign in to comment.