Skip to content
This repository has been archived by the owner on Sep 24, 2023. It is now read-only.

v1.1.0

Compare
Choose a tag to compare
@MurdoMaclachlan MurdoMaclachlan released this 30 Nov 20:39
· 562 commits to master since this release
9b21ba0

Name:

  • Changed the name of the project from ClaimDoneRemover to OSCR (Open Source Caretaker for Reddit), lovingly nicknamed Oscar.
    • As a part of this, the pip package is now located at https://pypi.org/project/oscr/

Functionality:

  • Added a settings menu from which you can edit config.json and praw.ini (see note 1).
  • Added several arguments that can be passed to oscr console command;
    • --format-cdr renames .cdremover and [cdrcredentials] to .oscr and [oscr], !! ADVISED TO RUN THIS BEFORE ANYTHING ELSE IF UPDATING FROM AN OLD VERSION !!
    • --help displays a list of commands,
    • --no-recur forces the program to run only one cycle regardless of 'recur' configuration,
    • --reset-config resets the config file to defaults (useful if you irreparably break something like I did),
    • --settings runs the settings menu.
  • Added capability to stop attempting to update each statistic after a failure to do so (see note 2).
  • Now defaults non-numeric instances of config["limit"] to None type (see note 3).
  • Switched from .format() to fstrings for more succinct string formatting.
  • Global variables are now contained in gvars class, passed into all necessary functions (see note 4).
  • config is now a global variable.

Cleanup:

  • setup.py now imports version from oscrmodules.gvars, avoiding the need to declare the variable twice.
  • Squashed some code verbosity; unnecessary variable declarations, if statements with longer conditions than neeeded, etc.
  • Removed unnecessary imports.
  • fetch() and update() no longer unnecessarily globalise variables.

Documentation:

  • Replaced the Notes section in README.md with a more informative Additional Help and FAQ section.
  • Corrected minor spelling errors in log output and commenting.
  • Avoided potential double timestamp in log noting failure to decode config.json.
  • createIni() now logs its attempts to create praw.ini

Bug Fixes:

  • #26: New "deleted" lines are appended to stats.txt rather than just updating one line as was intended.
  • #27: Potential error with displaying log message in the format "X/None comments checked successfully".
  • #28: Potential error with displaying log message in the format "X/Y comments checked successfully" where X is greater than Y (see note 5).
  • #29: Incorrect INI Path for Windows (thanks to /u/--B_L_A_N_K--)
  • #31: Program crash on attempting to fetch config.json if the parent directory is missing (see note 6).
  • #32: Potential crash if config['logUpdates'] configuration was set to false.

Notes:

  1. The code for this is god-awful, but it does the job and I won't be touching it for a while since I've already had far too much of it, plus, other hardships mean I haven't the mental capacity to work it out right now. If you like my r/badcode flair you can take a look but expect to be disgusted.
  2. Added new global list failedStats for this purpose.
  3. This was in the changelog for v1.0.0, but apparently I forgot to actually make the commit.
  4. As much as I hated having to do this, sharing the global variables across files doesn't work with a program this complex.
  5. This would have occurred where a limit was set that was not a mulitple of 25.
  6. The new dumpConfig() function aids this.