use user's music directory rather than hardcoding

This commit is contained in:
Lynne Megido 2023-03-19 11:08:19 +10:00
parent 6b0ca13cd8
commit 59d90794cc
Signed by: lynnesbian
GPG key ID: F0A184B5213D9F90
4 changed files with 28 additions and 26 deletions

View file

@ -7,7 +7,7 @@
<excludeFolder url="file://$MODULE_DIR$/test" /> <excludeFolder url="file://$MODULE_DIR$/test" />
<excludeFolder url="file://$MODULE_DIR$/venv" /> <excludeFolder url="file://$MODULE_DIR$/venv" />
</content> </content>
<orderEntry type="jdk" jdkName="Python 3.9 (bcao)" jdkType="Python SDK" /> <orderEntry type="jdk" jdkName="Poetry (bcao)" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="sourceFolder" forTests="false" />
</component> </component>
</module> </module>

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.9 (bcao)" project-jdk-type="Python SDK" /> <component name="ProjectRootManager" version="2" project-jdk-name="Poetry (bcao)" project-jdk-type="Python SDK" />
<component name="PythonCompatibilityInspectionAdvertiser"> <component name="PythonCompatibilityInspectionAdvertiser">
<option name="version" value="3" /> <option name="version" value="3" />
</component> </component>

View file

@ -20,10 +20,10 @@
</component> </component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="f581197a-f26b-4fde-b746-e72c0ed1bb2a" name="Default Changelist" comment="my py dot ini"> <list default="true" id="f581197a-f26b-4fde-b746-e72c0ed1bb2a" name="Default Changelist" comment="my py dot ini">
<change beforePath="$PROJECT_DIR$/.idea/bcao.iml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/bcao.iml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/misc.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/misc.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/misc.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/misc.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/bcao.pex" beforeDir="false" afterPath="$PROJECT_DIR$/bcao.pex" afterDir="false" /> <change beforePath="$PROJECT_DIR$/bcao/__main__.py" beforeDir="false" afterPath="$PROJECT_DIR$/bcao/__main__.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/build.sh" beforeDir="false" afterPath="$PROJECT_DIR$/build.sh" afterDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -61,6 +61,9 @@
</file-type-list> </file-type-list>
</component> </component>
<component name="JupyterTrust" id="c9c24a84-69f9-4c1e-bffb-78383de38689" /> <component name="JupyterTrust" id="c9c24a84-69f9-4c1e-bffb-78383de38689" />
<component name="MarkdownSettingsMigration">
<option name="stateVersion" value="1" />
</component>
<component name="ProjectId" id="1iwv1rbtMpCLK7D695td98N37pr" /> <component name="ProjectId" id="1iwv1rbtMpCLK7D695td98N37pr" />
<component name="ProjectLevelVcsManager" settingsEditedManually="true"> <component name="ProjectLevelVcsManager" settingsEditedManually="true">
<ConfirmationsSetting value="2" id="Add" /> <ConfirmationsSetting value="2" id="Add" />
@ -69,21 +72,20 @@
<option name="hideEmptyMiddlePackages" value="true" /> <option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" /> <option name="showLibraryContents" value="true" />
</component> </component>
<component name="PropertiesComponent"> <component name="PropertiesComponent"><![CDATA[{
<property name="ASKED_ADD_EXTERNAL_FILES" value="true" /> "keyToString": {
<property name="ASKED_MARK_IGNORED_FILES_AS_EXCLUDED" value="true" /> "RunOnceActivity.OpenProjectViewOnStart": "true",
<property name="RunOnceActivity.OpenProjectViewOnStart" value="true" /> "RunOnceActivity.ShowReadmeOnStart": "true",
<property name="WebServerToolWindowFactoryState" value="false" /> "WebServerToolWindowFactoryState": "false",
<property name="com.intellij.ide.scratch.LRUPopupBuilder$1/New Scratch File" value="TEXT" /> "node.js.detected.package.eslint": "true",
<property name="last_opened_file_path" value="$PROJECT_DIR$/../sillybasic" /> "node.js.detected.package.tslint": "true",
<property name="node.js.detected.package.eslint" value="true" /> "node.js.selected.package.eslint": "(autodetect)",
<property name="node.js.detected.package.tslint" value="true" /> "node.js.selected.package.tslint": "(autodetect)",
<property name="node.js.path.for.package.eslint" value="project" /> "nodejs_package_manager_path": "npm",
<property name="node.js.path.for.package.tslint" value="project" /> "settings.editor.selected.configurable": "editor.preferences.fonts.default",
<property name="node.js.selected.package.eslint" value="(autodetect)" /> "vue.rearranger.settings.migration": "true"
<property name="node.js.selected.package.tslint" value="(autodetect)" /> }
<property name="settings.editor.selected.configurable" value="editor.preferences.fonts.default" /> }]]></component>
</component>
<component name="PyConsoleOptionsProvider"> <component name="PyConsoleOptionsProvider">
<option name="myPythonConsoleState"> <option name="myPythonConsoleState">
<console-settings module-name="bcao" is-module-sdk="true"> <console-settings module-name="bcao" is-module-sdk="true">
@ -92,16 +94,13 @@
</console-settings> </console-settings>
</option> </option>
</component> </component>
<component name="ReaderModeSettings">
<option name="showLigatures" value="true" />
</component>
<component name="RecentsManager"> <component name="RecentsManager">
<key name="MoveFile.RECENT_KEYS"> <key name="MoveFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$/test" /> <recent name="$PROJECT_DIR$/test" />
<recent name="$PROJECT_DIR$/bcao" /> <recent name="$PROJECT_DIR$/bcao" />
</key> </key>
</component> </component>
<component name="RunManager"> <component name="RunManager" selected="Python.bcao (io)">
<configuration default="true" type="PythonConfigurationType" factoryName="Python"> <configuration default="true" type="PythonConfigurationType" factoryName="Python">
<module name="bcao" /> <module name="bcao" />
<option name="INTERPRETER_OPTIONS" value="" /> <option name="INTERPRETER_OPTIONS" value="" />
@ -146,6 +145,8 @@
<workItem from="1618788269888" duration="5049000" /> <workItem from="1618788269888" duration="5049000" />
<workItem from="1619508843397" duration="16000" /> <workItem from="1619508843397" duration="16000" />
<workItem from="1620488550972" duration="1067000" /> <workItem from="1620488550972" duration="1067000" />
<workItem from="1679187531461" duration="18000" />
<workItem from="1679187557538" duration="367000" />
</task> </task>
<task id="LOCAL-00001" summary="mp3 support! more helpful interface! better code! yahoo!!"> <task id="LOCAL-00001" summary="mp3 support! more helpful interface! better code! yahoo!!">
<created>1602927759343</created> <created>1602927759343</created>
@ -247,7 +248,6 @@
</entry> </entry>
</map> </map>
</option> </option>
<option name="oldMeFiltersMigrated" value="true" />
</component> </component>
<component name="VcsManagerConfiguration"> <component name="VcsManagerConfiguration">
<option name="ADD_EXTERNAL_FILES_SILENTLY" value="true" /> <option name="ADD_EXTERNAL_FILES_SILENTLY" value="true" />
@ -266,8 +266,8 @@
<option name="LAST_COMMIT_MESSAGE" value="check against tag format type instead of file extension&#10;&#10;sorta like, &quot;if tag_format == 'id3'&quot; rather than &quot;if song_format == ['mp3', 'wav', 'aiff']&quot;" /> <option name="LAST_COMMIT_MESSAGE" value="check against tag format type instead of file extension&#10;&#10;sorta like, &quot;if tag_format == 'id3'&quot; rather than &quot;if song_format == ['mp3', 'wav', 'aiff']&quot;" />
</component> </component>
<component name="com.intellij.coverage.CoverageDataManagerImpl"> <component name="com.intellij.coverage.CoverageDataManagerImpl">
<SUITE FILE_PATH="coverage/bcao$bcao__ceres_.coverage" NAME="bcao (ceres) Coverage Results" MODIFIED="1618790587601" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
<SUITE FILE_PATH="coverage/bcao$mypy.coverage" NAME="mypy Coverage Results" MODIFIED="1610962969226" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" /> <SUITE FILE_PATH="coverage/bcao$mypy.coverage" NAME="mypy Coverage Results" MODIFIED="1610962969226" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
<SUITE FILE_PATH="coverage/bcao$bcao.coverage" NAME="bcao Coverage Results" MODIFIED="1603719196915" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" /> <SUITE FILE_PATH="coverage/bcao$bcao.coverage" NAME="bcao Coverage Results" MODIFIED="1603719196915" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
<SUITE FILE_PATH="coverage/bcao$bcao__ceres_.coverage" NAME="bcao (ceres) Coverage Results" MODIFIED="1618790587601" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
</component> </component>
</project> </project>

View file

@ -50,6 +50,8 @@ def sanitise(in_str: str) -> str:
def main() -> None: def main() -> None:
global args, tmp_dir global args, tmp_dir
music_dir = os.path.join(Path.home(), "Music")
parser = argparse.ArgumentParser(usage='%(prog)s zip [options]', parser = argparse.ArgumentParser(usage='%(prog)s zip [options]',
formatter_class=argparse.RawTextHelpFormatter, formatter_class=argparse.RawTextHelpFormatter,
description="Extracts the given zip file downloaded from Bandcamp and organises it.", 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('zip', help='The zip file to use.')
parser.add_argument('-c', '--add-cover-images', dest='process_cover', default='w', choices=['n', 'a', 'w'], 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") 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") help="The directory to organise the music into.\nDefault: %(default)s")
parser.add_argument('-q', '--quiet', dest='quiet', action='store_true', parser.add_argument('-q', '--quiet', dest='quiet', action='store_true',
help='Disable non-error output and assume default artist name.') help='Disable non-error output and assume default artist name.')