Skip to content

Commit

Permalink
small update for unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
markhollingworth-worthit committed Jan 4, 2022
1 parent 7ab424c commit eec1cff
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -151,5 +151,4 @@ pycryptobot.log.*
tests/unit_tests/data/*.json

*.key
config-*.yaml
/telegram_data*
config-*.yaml
8 changes: 4 additions & 4 deletions models/telegram/control.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class TelegramControl():
def __init__(self, datafolder, tg_helper: TelegramHelper) -> None:
self.datafolder = datafolder
self.helper = tg_helper

def _sortInlineButtons(self, buttons: list, callbackTag):
keyboard = []
if len(buttons) > 0:
Expand Down Expand Up @@ -41,7 +41,7 @@ def _askBotList(self, update: Update, callbackTag, status):
buttons = []

for market in self.helper.getActiveBotList(status):
while self.helper.read_data(market) == False:
while self.helper.read_data(market) is False:
sleep(0.2)

if "botcontrol" in self.helper.data:
Expand Down Expand Up @@ -73,7 +73,7 @@ def _actionBotResponse(self, update: Update, callbackTag, state, status: str = "
query.answer()
except:
pass

mode = "Stopping" if callbackTag == "stop" else "Pausing"
if query.data.__contains__("allclose") or query.data.__contains__("all"):
query.edit_message_text(f"<i>{mode} bots</i>", parse_mode="HTML")
Expand Down Expand Up @@ -184,7 +184,7 @@ def restartBotResponse(self, update: Update):

bList = {}
for bot in self.helper.getActiveBotList():
while self.helper.read_data(bot) == False:
while self.helper.read_data(bot) is False:
sleep(0.2)
# self.helper.read_data(bot)
bList.update({bot : {"exchange" : self.helper.data["exchange"], "startmethod" : self.helper.data["botcontrol"]["startmethod"]}})
Expand Down

0 comments on commit eec1cff

Please sign in to comment.