Skip to content

Commit

Permalink
Updated argparse documentation and descriptions.
Browse files Browse the repository at this point in the history
  • Loading branch information
mwdle committed Aug 17, 2024
1 parent dc9402a commit a62f7ff
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions generatePlaylist.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ def generate_m3u_playlist(playlist_directory, music_directory, output_file, excl

if __name__ == "__main__":
parser = argparse.ArgumentParser(description="This script allows you to generate an m3u playlist given a folder containing music and/or subfolders with music. The following example generates a playlist called Jazz.m3u in /home/user/Media/Music containing all songs in the Jazz folder/subfolders: python3 generatePlaylist.py '/home/user/Media/Music/Jazz' '/home/user/Media/Music' 'Jazz.m3u'")
parser.add_argument('playlist_directory', type=str, help="Path to the folder containing music/subfolders that you want to be added to the playlist.")
parser.add_argument('music_directory', type=str, help="Path to the folder containing audio files and/or subfolders with audio files. This is the location where you want to create the playlist file - the 'root' folder of your music library.")
parser.add_argument('playlist_directory', type=str, help="Path to the folder containing music/subfolders with music to add to the playlist.")
parser.add_argument('music_directory', type=str, help="Path to the folder where you want to create the playlist file - the 'root' folder of your music library.")
parser.add_argument('output_file', type=str, help="Name of m3u file (including .m3u extension). Example: 'Jazz.m3u'")
parser.add_argument('exclusions', type=str, nargs='?', default="", help="(Optional) A regular expression to exclude specific folders and filenames from being added to the playlist. Leaving this empty will not exclude anything. The following example generates a playlist called 'Everything Except Jazz' containing all songs in the music folder except those matching 'Jazz': python3 generatePlaylist.py '/home/user/Media/Music' '/home/user/Media/Music' 'Everything Except Jazz.m3u' 'Jazz'")
parser.add_argument('exclusions', type=str, nargs='?', default="", help="(Optional) A regular expression to exclude specific folders and filenames from being added to the playlist. Leaving this empty will not exclude anything. The following example generates a playlist called 'Everything Except Jazz.m3u' containing all songs in the music library folder except those matching 'Jazz': python3 generatePlaylist.py '/home/user/Media/Music' '/home/user/Media/Music' 'Everything Except Jazz.m3u' 'Jazz'")

args = parser.parse_args()

Expand Down
2 changes: 1 addition & 1 deletion normalizeNames.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def rename_files(root_folder):
rename_item(root, os.path.join(root, filename), new_name)

if __name__ == "__main__":
parser = argparse.ArgumentParser(description="This script allows you to quickly and easily replace or remove 'illegal' characters from filenames and foldernames in a specific a folder and subfolders that break sync compatibility between devices using different filesystem conventions. A practical use of this application is bulk renaming stored music folders/files to enable portability and syncing of a music library across devices without file system compatibility issues. This program does *NOT* modify music metadata, just filenames/foldernames. By default, this application will intelligently replace colons ':' with dashes '-' and proper surrounding spacing, replace quotation marks '\"' with single quotes ', remove trailing periods '.', and remove any other characters defined in the illegal characters list at the top of the normalizeNames.py file. All of the aforementioned behavior can be easily overridden/modified in the repair_illegal_name() method and illegal characters list. All renames will be printed to the console.")
parser = argparse.ArgumentParser(description="This script allows you to quickly and easily replace or remove 'illegal' characters from filenames and foldernames in a given folder and subfolders that break sync compatibility between devices using different filesystem conventions. A practical use of this application is bulk renaming stored music folders/files to enable portability and syncing of a music library across devices. This program does *NOT* modify music metadata, just filenames/foldernames. By default, this application will intelligently replace colons ':' with dashes '-' and proper surrounding spacing, replace quotation marks '\"' with single quotes ', remove trailing periods '.', and remove any other characters defined in the illegal characters list at the top of the normalizeNames.py file. All of the aforementioned behavior can be easily overridden/modified in the repair_illegal_name() method and illegal characters list. All changes are printed to the console.")
parser.add_argument('root_folder', type=str, help="Path to folder containing music/subfolders to repair names in.")
args = parser.parse_args()
rename_files(args.root_folder)
Expand Down

0 comments on commit a62f7ff

Please sign in to comment.