m-s-abeer / vjudge-to-oj

Import your vJudge solutions to actual online judges. Currently supports UVa, CodeForces, SPOJ, and CodeForces GYM.
MIT License
59 stars 10 forks source link

Use .env for credential inputs instead of main.py #12

Closed m-s-abeer closed 1 year ago

m-s-abeer commented 2 years ago

In the current solution, we're updating main.py directly to insert raw credentials. Not good! It requires you to clean it up before taking the latest pull and the credentials shouldn't be put into an actual source code file.

The next approach is going to be:-

  1. There will be an env.example file containing credential format and if the profile will be used actively for the next run.
  2. The user will copy the env.example to .env file and insert their credentials there.
  3. Running the main function will use .env to determine which profiles to use and collect credentials from .env for submission.

This can also be improved in the future, depending on the demand. Leave a comment if you think we should take a different path.