Less stupid

This commit is contained in:
jeancf 2022-09-08 10:11:37 +02:00
parent ffdce1ad12
commit 2b21a626d4

View File

@ -201,12 +201,6 @@ def is_time_valid(timestamp, max_age, min_delay):
return ret
def login(instance, account, password):
# Check ratelimit status
logging.info('Ratelimit allowed requests: ' + Mastodon.ratelimit_limit)
logging.info('Ratelimit remaining requests: ' + Mastodon.ratelimit_remaining)
logging.info('Ratelimit reset time: ' + time.localtime(Mastodon.ratelimit_reset))
logging.info('Ratelimit last call: ' + time.localtime(Mastodon.ratelimit_lastcall))
# Create Mastodon application if it does not exist yet
if not os.path.isfile(instance + '.secret'):
try:
@ -240,6 +234,12 @@ def login(instance, account, password):
logging.fatal(me)
sys.exit(-1)
# Check ratelimit status
logging.info('Ratelimit allowed requests: ' + mastodon.ratelimit_limit)
logging.info('Ratelimit remaining requests: ' + mastodon.ratelimit_remaining)
logging.info('Ratelimit reset time: ' + time.localtime(mastodon.ratelimit_reset))
logging.info('Ratelimit last call: ' + time.localtime(mastodon.ratelimit_lastcall))
return mastodon