-
Notifications
You must be signed in to change notification settings - Fork 129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactored and added an undo feature #79
Conversation
…fig() Added category 'Plain Text' and moved some formats to it from Documents
Added Programmng category (contains output and source); Added Plain Text category; Consolidated packages into a single category; Added Ringtones category; Added Webpages category; Changed category Music to Audio; Added many file formats
Classifier: Fixed syntax error
Changed options in readme to output of `classifier -h`; Changed tabs to spaces, reduced line lengths; Classifier: Added try/catch to import module 'arrow'; Added command-line interface (if __name__==__main__); Changed default behavior - if directory not specified, show help; Changed default behavior - if output not specified, use input; Changed all calls of sys.exit() to quit(); Removed uncalled function main(); Changed options to be more in line with coreutils style; Made default config a global constant.
I know this is a ton of changes. I don't mind if you only accept the minor ones (although I don't know how to make Github show only some commits). My reasoning behind changing the default was that I kept accidentally moving my own directory around while I was working on the project. Previously, it would organize your directory every time it was called unless specifically told not to with -d, -ed, or -v. I wanted to go with the principle of least surprise. |
Updated usage section to match changed behavior; Updated options list; Minor edits; Classifier: Made `directory` a required argument in `argparse`; Greatly restructured flow control in classify(); Removed unused help message; Removed redundant _format_arg function; Removed redundant IGNORE sections; Added verbose option - default is now quiet; Changed variable name back to 'directory'; Made try/catch loops noisy on failure; Changed many 'return False' statements to quit(); Minor formatting edits; Minor edits
Imported entire sys module; Made arguments optional to allow -v, -h, etc; Re-added help message (for when called without an argument); Removed troublesome new-line in DEFAULT, will need to be fixed at some point; Fixed NameError; Enabled date formatting without arrow installed; Made config option more consistant; Added error message if given directory does not exist; More flow control (custom, date, and default)
added options function; made directory a class variable; save function now creates its own git branch; used git.Repo.iter_commits to simplify; removed some error shadowing; added more checks for output directory; undo now checks if git repo is bare; removed some exclamation marks; misc whitespace and commenting
changed conf location to .local (on linux); added various checks for git; undo now removes empty folders it created; used argparse's builtin version command; added class variables git_imported, has_commits; main uses class variables instead of arguments (mostly); fixed syntax errors (date_no_arrow and options); warned about semantic error with -F and -T (bugfix pending)
Major changes:
When run without arguments, give a help message
Never organize current directory unless prompted to
Change short form of options to be one character (in most cases)
Changed option -d (formerly directory) to mean date.
Directory is now a mandatory positional argument
Added an undo feature using gitpython
Minor changes:
Arrow is now imported only when the -d (date) option is used
If arrow is not installed,
datetime
is used insteadAdded CLI interface to replace unused function main()
Made default config a constant
Config:
Added many, many different file extensions
Made Packages one category (previously DEBPackages and RPMPackges)
Changed 'Music' to 'Audio'
Added new extension categories:
Programming
Plain Text
Webpages
Ringtones
Added to sources a wikipedia page with new extensions
Readme:
Updated options to match parser help
Pasted literals of classifier in use
Formatting:
Converted tabs to spaces
Added a shebang
Reduced line lengths across the board
Removed some whitespace