mirror of
https://gitlab.com/jeancf/twoot.git
synced 2024-11-27 14:01:13 +00:00
Less stupid
This commit is contained in:
parent
ffdce1ad12
commit
2b21a626d4
12
twoot.py
12
twoot.py
|
@ -201,12 +201,6 @@ def is_time_valid(timestamp, max_age, min_delay):
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
def login(instance, account, password):
|
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
|
# Create Mastodon application if it does not exist yet
|
||||||
if not os.path.isfile(instance + '.secret'):
|
if not os.path.isfile(instance + '.secret'):
|
||||||
try:
|
try:
|
||||||
|
@ -240,6 +234,12 @@ def login(instance, account, password):
|
||||||
logging.fatal(me)
|
logging.fatal(me)
|
||||||
sys.exit(-1)
|
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
|
return mastodon
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user