Skip to content
This repository has been archived by the owner on Nov 26, 2022. It is now read-only.

Commit

Permalink
Allow users to disable the alpha warning + sleep
Browse files Browse the repository at this point in the history
By setting the `$DISABLE_ALPHA_WARNING` environment variable to
anything else than an empty string, users can now disable
the warning about Catalyst being in alpha, and the associated three
seconds delay.

Fixes #493
  • Loading branch information
samueldg committed Oct 15, 2018
1 parent 90d9e4e commit d300eec
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions catalyst/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@
SUPPORTED_WALLETS = ['metamask', 'ledger', 'trezor', 'bitbox', 'keystore',
'key']

DISABLE_ALPHA_WARNING = bool(os.environ.get('CATALYST_DISABLE_ALPHA_WARNING'))

ALPHA_WARNING_MESSAGE = 'Catalyst is currently in ALPHA. It is going ' \
'through rapid development and it is subject to ' \
'errors. Please use carefully. We encourage you to ' \
Expand Down
7 changes: 4 additions & 3 deletions catalyst/utils/run_algo.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
DataPortalExchangeBacktest
from catalyst.exchange.exchange_asset_finder import ExchangeAssetFinder

from catalyst.constants import LOG_LEVEL, ALPHA_WARNING_MESSAGE
from catalyst.constants import LOG_LEVEL, ALPHA_WARNING_MESSAGE, DISABLE_ALPHA_WARNING

log = Logger('run_algo', level=LOG_LEVEL)

Expand Down Expand Up @@ -146,9 +146,10 @@ def _run(handle_data,
else:
click.echo(algotext)

log.warn(ALPHA_WARNING_MESSAGE)
log.info('Catalyst version {}'.format(catalyst.__version__))
sleep(3)
if not DISABLE_ALPHA_WARNING:
log.warn(ALPHA_WARNING_MESSAGE)
sleep(3)

if live:
if simulate_orders:
Expand Down

0 comments on commit d300eec

Please sign in to comment.