Announcement!
This project is now a PyPi package!
Find it here: https://pypi.org/project/cdremover/1.0.0/
Install using `pip3 install cdremover` and update with `pip3 install --update cdremover`
Next stop, GUI! (probably during the Christmas holidays, unfortunately; uni is busy)
Functionality:
- Restructured program in preperation for pip package;
- Log and statistics are now found in home/.cdremover/data.
- Config file is now found in home/.cdremover.
- libcdr module is now named cdrmodules, and includes main.py.
- Program is now run through cdremover script (can be used a console command if installed through pip).
- Program now creates praw.ini if it cannot be found (fix for 23s, see note 1 for limitations).
- Optimisation improvements for both increased speed and reduced file size (see note 2 for details).
- Added new cutoffUnit config variable, which is the unit of time the cutoff is measured in in seconds (see note 3 for details).
- Program now resets any search limit value greater than or equal to 1000 to "None", rather than allowing values greater than 1000 to go unchanged, which could have potentially caused issues with Reddit's API.
- Made home, log and version variables global throughout all files and functions (see note 4 for details).
Bug Fixes:
- 23: Crash if praw.ini is missing or exists without "cdrcredentials" section.
- 24: Crash due to getTime() being declared after the import of a function that attempts to import it.
Dependencies:
- Removed requirements.txt, as dependencies are now stated in the new setup.py file and should be auto-installed by pip.
- configparser finally added to requirement list after being a dependency since the config file was changed to .json format.
Documentation:
- Changed/added some log messages;
- Some ambiguities have been clarified.
- Program now logs every time it intentionally exits.
- Now logs output related to praw.ini handling.
- Now logs a check for each 25 comments successfully checked (see note 5 for use).
- misc.py functions now log console output.
- Re-wrote README.md to faciliate new installation instructions and other information..
- Began recording release candidate versions during development (only relevant for contributors or users following development).
- Added/clarified some commenting.
Notes:
1. This functionality currently has limitations due to limitations within PRAW itself. Currently, a restart is required to take into effect any changes to the praw.ini file, and additionally, if your praw.ini "cdrcredentials" section becomes corrupted, or if you enter the wrong information, you will need to fix the issue manually. I'm working on a script to try and fix the second issue, but the first will persist until more flexibility in this area can be added to PRAW.
2. This includes improvements such as doing some one-time calculations on program start rather than performing them each cycle as was previously being done, as well as replacing "if [variable] == True" with simply "if [variable]" and so on.
3. This allows for the user to use their preferred unit of time for the cutoff, rather than being forced to use hours. It is the value of 1 of the unit converted into seconds (e.g. hours would be 3600), and, if left blank or given as a non-numerical variable, will be defaulted to 3600 by the program.
4. This removes the need for function calls with large numbers of variables being passed/returned, which improves the program readibility. The global variables are declared in gvars.py and imported into all the files that make use them.
5. This could be very helpful for diagnosing at what point during the checking an error may have occurred.
6. Technically the current version is 1.0.1 (as can be seen in the files), becuase I uploaded the wrong README.md to PyPi. If there is another patch for 1.0, it will be labelled 1.0.2 to keep version numbers synchronised.