KartikTalwar / Duolingo

Unofficial Duolingo API Written in Python
MIT License
825 stars 128 forks source link

Adding a session_file argument to the Duolingo constructor. #80

Closed SpangleLabs closed 4 years ago

SpangleLabs commented 4 years ago

Which will be read and checked if given, and then the new jwt will be written to.

coveralls commented 4 years ago

Coverage Status

Coverage decreased (-0.9%) to 82.252% when pulling 172baa19b2574a1369aa2719456decb4f022df74 on session_file into 6d356368118cdedb44fdd1c27662c95f417db32f on master.

igorskh commented 4 years ago

Should there be an option to read from a string directly? If a user wants to decide how to store a JWT. Since there is no standard way to do this, you don't have to force storing into a file.

SpangleLabs commented 4 years ago

Hmmm.. good point, could just add an optional jwt=None parameter, then move around some stuff in _login(), does that sound good to you?

igorskh commented 4 years ago

I don't fully get it. Do you want to make a generic jwt argument? How would you distinguish between a file path string and a string with JWT? One option I see is to accept only JWT string and the user is responsible for reading from file. Or doing some string parsing to detect a type.

SpangleLabs commented 4 years ago

How's this looking now?

igorskh commented 4 years ago

Looks good to me