tagrenamer.app package
tagrenamer.app.collection module
Represent the collection of all found file objects within the base path.
-
class tagrenamer.app.collection.Collection(output, settings)[source]
Bases: object
Represent the collection of all found file objects within the base path.
-
callbackInit(node)[source]
Register a reference to any new created file system node in this collection.
-
callbackMkdir(node)[source]
Implementation of the mkdir hook.
-
callbackMove(node, dest)[source]
Implementation of the move hook.
-
callbackMoveIsDestinationUnknown(dest)[source]
Test if the destination or any parents aren’t in our collection.
-
callbackRemove(node)[source]
Implementation of the remove hook - remove the object from our music index.
-
callbackSanitize(node)[source]
Implementation of the sanitize hook.
-
callbackShellCollect(command)[source]
Implementation of the shell_collect hook.
-
callbackTraverseFilter(node, path)[source]
Implementation of the traverse_filter hook.
-
finish()[source]
Cleanup and drop some statistics.
-
initializeDirectories()[source]
Initialize the leftovers and staging directories.
-
moveFilesPermanently()[source]
Move all files and directories from stage to the permanent spot.
-
moveLeftovers()[source]
Move all the non-music files into the leftovers directory..
-
moveMusicToStage()[source]
Rename the music files and move them into the new structure (inside stage).
-
process()[source]
Process the collection.
-
removeEmptyDirectories()[source]
Remove empty directories in the main music tree.
-
removeLeftoversDirectory()[source]
Remove the left-overs directory and object.
-
removeStageDirectory()[source]
Remove the stage directory and object.
-
sanitize()[source]
Sanitize all extracted meta data for file system usage and validate input.
-
traverse()[source]
Traverse the base path where the music resides in and pass our registrar.
tagrenamer.app.output module
Combined output and logging facility with level support.
-
class tagrenamer.app.output.Output[source]
Bases: object
Combined output and logging facility with level support.
-
log(message='', context='', level=0)[source]
Log a string at the given indentation level.
-
runtime_error(message)[source]
Stop the program using a prefixed RuntimeError.
-
set_debuglevel(level)[source]
Set the level of debugging.
-
set_quiet(quiet)[source]
Enable or disable quiet mode.
-
write(message)[source]
Print the given message when not-quiet.
-
tagrenamer.app.output.runtime_error(message)[source]
Stop the program using a prefixed RuntimeError.
tagrenamer.app.safestring module
Represent a string that is absolutely filesystem safe.
-
class tagrenamer.app.safestring.SafeString(old_string)[source]
Bases: object
Represent a string that is absolutely filesystem safe.
-
filter()[source]
Filter out any garbage left..
-
whitelist = ('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '-', ' ', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9')
tagrenamer.app.settings module
Program arguments, defaults and Settings object.
-
class tagrenamer.app.settings.Settings[source]
Bases: object
Settings object.
-
validate()[source]
Validate input options and prevent application bugs.
-
tagrenamer.app.settings.get_application_context()[source]
Define the program’s arguments, options and default settings.