Skip to content

Commit

Permalink
Fixed some pylint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
cyberjunky committed Nov 14, 2021
1 parent e978f91 commit 244a031
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 28 deletions.
30 changes: 16 additions & 14 deletions altrank.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
import sys
import threading
import time
from logging.handlers import TimedRotatingFileHandler as _TimedRotatingFileHandler
from logging.handlers import \
TimedRotatingFileHandler as _TimedRotatingFileHandler
from pathlib import Path

import apprise
Expand Down Expand Up @@ -468,21 +469,10 @@ def find_pairs(thebot):
% (exchange, badpairslist)
)

logger.debug("Current pairs: %s\nNew pairs: %s" % (thebot["pairs"], newpairslist))

# Do we already use these pairs?
if newpairslist == thebot["pairs"]:
logger.info(
"Bot '%s' with id '%s' is already using the best pairs"
% (thebot["name"], thebot["id"]),
True,
)
return

# We have new pairs for our bot update it
if not newpairslist:
logger.info(
"None of the by LunarCrush suggested pairs found on %s exchange!" % exchange
"None of the by LunarCrush suggested pairs have been found on the %s exchange!"
% exchange
)
return

Expand All @@ -491,6 +481,18 @@ def find_pairs(thebot):

def update_bot(thebot, newpairs):
"""Update bot with new pairs."""

# Do we already use these pairs?
if newpairs == thebot["pairs"]:
logger.info(
"Bot '%s' with id '%s' is already using the best pairs"
% (thebot["name"], thebot["id"]),
True,
)
return

logger.debug("Current pairs: %s\nNew pairs: %s" % (thebot["pairs"], newpairs))

error, data = api.request(
entity="bots",
action="update",
Expand Down
30 changes: 16 additions & 14 deletions galaxyscore.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
import sys
import threading
import time
from logging.handlers import TimedRotatingFileHandler as _TimedRotatingFileHandler
from logging.handlers import \
TimedRotatingFileHandler as _TimedRotatingFileHandler
from pathlib import Path

import apprise
Expand Down Expand Up @@ -468,21 +469,10 @@ def find_pairs(thebot):
% (exchange, badpairslist)
)

logger.debug("Current pairs: %s\nNew pairs: %s" % (thebot["pairs"], newpairslist))

# Do we already use these pairs?
if newpairslist == thebot["pairs"]:
logger.info(
"Bot '%s' with id '%s' is already using the best pairs"
% (thebot["name"], thebot["id"]),
True,
)
return

# We have new pairs for our bot update it
if not newpairslist:
logger.info(
"None of the by LunarCrush suggested pairs found on %s exchange!" % exchange
"None of the by LunarCrush suggested pairs have been found on the %s exchange!"
% exchange
)
return

Expand All @@ -491,6 +481,18 @@ def find_pairs(thebot):

def update_bot(thebot, newpairs):
"""Update bot with new pairs."""

# Do we already use these pairs?
if newpairs == thebot["pairs"]:
logger.info(
"Bot '%s' with id '%s' is already using the best pairs"
% (thebot["name"], thebot["id"]),
True,
)
return

logger.debug("Current pairs: %s\nNew pairs: %s" % (thebot["pairs"], newpairs))

error, data = api.request(
entity="bots",
action="update",
Expand Down

0 comments on commit 244a031

Please sign in to comment.