From 59d90794cc2c3ae2441a01293c2dd8f206acc210 Mon Sep 17 00:00:00 2001 From: Lynnesbian Date: Sun, 19 Mar 2023 11:08:19 +1000 Subject: [PATCH] use user's music directory rather than hardcoding --- .idea/bcao.iml | 2 +- .idea/misc.xml | 2 +- .idea/workspace.xml | 46 ++++++++++++++++++++++----------------------- bcao/__main__.py | 4 +++- 4 files changed, 28 insertions(+), 26 deletions(-) diff --git a/.idea/bcao.iml b/.idea/bcao.iml index 87b2034..ac167cb 100644 --- a/.idea/bcao.iml +++ b/.idea/bcao.iml @@ -7,7 +7,7 @@ - + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index e866bcc..af729e9 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,6 +1,6 @@ - + diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 6139072..b224b0d 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -20,10 +20,10 @@ + - - + + + @@ -69,21 +72,20 @@ - - - - - - - - - - - - - - - + - - - + - - + \ No newline at end of file diff --git a/bcao/__main__.py b/bcao/__main__.py index 18c3744..3364132 100755 --- a/bcao/__main__.py +++ b/bcao/__main__.py @@ -50,6 +50,8 @@ def sanitise(in_str: str) -> str: def main() -> None: global args, tmp_dir + music_dir = os.path.join(Path.home(), "Music") + parser = argparse.ArgumentParser(usage='%(prog)s zip [options]', formatter_class=argparse.RawTextHelpFormatter, description="Extracts the given zip file downloaded from Bandcamp and organises it.", @@ -60,7 +62,7 @@ def main() -> None: parser.add_argument('zip', help='The zip file to use.') parser.add_argument('-c', '--add-cover-images', dest='process_cover', default='w', choices=['n', 'a', 'w'], help="When to embed cover art into songs.\nOptions: [n]ever, [a]lways, [w]hen necessary.\nDefault: %(default)s") - parser.add_argument('-d', '--destination', dest='destination', default='/home/lynne/Music/Music/', + parser.add_argument('-d', '--destination', dest='destination', default=music_dir, help="The directory to organise the music into.\nDefault: %(default)s") parser.add_argument('-q', '--quiet', dest='quiet', action='store_true', help='Disable non-error output and assume default artist name.')