aboutsummaryrefslogtreecommitdiffstats
path: root/bot/utils/persist.py (follow)
Commit message (Collapse)AuthorAgeLines
* Use mkdir exists kwarg instead of checking existing ahead of time.Gravatar scragly2019-09-23-4/+2
|
* Improve func name, example, directory managementGravatar scragly2019-09-23-9/+37
| | | | | | | | | | | | | | | | | | | | Function name has been changed to `make_persistent` after prompt by @lemonsaurus asking for a more descriptive name. Thanks @MarkKoz for providing the alternate name. During local testing, the `data` directory doesn't exist yet. In prod, this isn't an issue as the persistent volume is mounted at that location. To make local testing more convenient, the directory is checked and made if not found. Persistent data files will be placed in a seasonal subdirectory so long as they have a valid season name somewhere in their path, otherwise they will be placed directly in the data directory. Added a note to docstring to avoid same-named files in the same seasons or it will conflict with each other in the persistent data directory. The example was extended a little bit to make it both actually valid if tested and hopefully make it easier to understand what's going on.
* Check explicitly if file exists rather than any existing path.Gravatar scragly2019-09-23-1/+1
| | | Co-Authored-By: Mark <[email protected]>
* Add better explanatory docstring and example for persist.datafile.Gravatar scragly2019-09-20-1/+17
|
* Add persistent datafile utils.Gravatar scragly2019-09-19-0/+24