eclean was an all in one python script that contained a number of unwieldy methods and functions which made it difficult to modify and nearly impossible to create test functions for. One of the primary reasons I started on it was to split the back-end functioning code from the output printing code similar to most of the newly redone equery modules. That way the code can be used by other applications. So, I began by separating the script into a python package containing 5 files and a nearly empty script that just loads and calls the main() .
Those 5 files being:
- cli.py to handle all command line interface argument parsing and start the requested action.
- search.py with all the search related methods and functions which determine the files to be cleaned.
- exclude.py containing the exclusion file parsing and handling code.
- output.py for the screen output and user interaction.
- clean.py to handle the actual cleaning process.
It will also then be possible for the code to be used in other apps such as a planned plug-in module for porthole. :)