|
@@ -4,12 +4,22 @@ import os.path
|
|
|
from settings import Settings
|
|
from settings import Settings
|
|
|
|
|
|
|
|
|
|
|
|
|
-def main():
|
|
|
|
|
- console.output('Music downloader by Deben Oldert')
|
|
|
|
|
- console.output()
|
|
|
|
|
|
|
+def init():
|
|
|
|
|
+ dbg_lvl = os.getenv('MD_LOGGING', 'ERROR')
|
|
|
|
|
+
|
|
|
|
|
+ if dbg_lvl.lower() == 'info':
|
|
|
|
|
+ Settings.Debuglvl = console.DBG_INFO
|
|
|
|
|
+ else:
|
|
|
|
|
+ Settings.Debuglvl = console.DBG_ERROR
|
|
|
|
|
|
|
|
directory(os.getenv('MD_SAVEDIR', '~/Music/iTunes/iTunes Media/Automatically Add to iTunes'))
|
|
directory(os.getenv('MD_SAVEDIR', '~/Music/iTunes/iTunes Media/Automatically Add to iTunes'))
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+def main():
|
|
|
|
|
+ init()
|
|
|
|
|
+
|
|
|
|
|
+ console.output('Music downloader by Deben Oldert')
|
|
|
|
|
+ console.output()
|
|
|
console.output('Download directory: {0}'.format(Settings.SaveDir))
|
|
console.output('Download directory: {0}'.format(Settings.SaveDir))
|
|
|
console.output()
|
|
console.output()
|
|
|
help()
|
|
help()
|
|
@@ -115,6 +125,7 @@ def directory(dir=None):
|
|
|
if dir is None:
|
|
if dir is None:
|
|
|
dir = console.ask_input('Enter new save directory')
|
|
dir = console.ask_input('Enter new save directory')
|
|
|
Settings.SaveDir = os.path.expanduser(dir)
|
|
Settings.SaveDir = os.path.expanduser(dir)
|
|
|
|
|
+ console.output('New save directory: {0}'.format(Settings.SaveDir), level=console.DBG_INFO)
|
|
|
return True
|
|
return True
|
|
|
|
|
|
|
|
|
|
|
|
@@ -145,8 +156,6 @@ commands = [
|
|
|
('quit', quit, 'Quit the program')
|
|
('quit', quit, 'Quit the program')
|
|
|
]
|
|
]
|
|
|
|
|
|
|
|
-# DOWNLOAD_DIR = os.path.expanduser('~/Music/iTunes/iTunes Media/Automatically Add to iTunes')
|
|
|
|
|
-# DOWNLOAD_DIR = os.path.expanduser('~/Downloads')
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
if __name__ == '__main__':
|
|
|
main()
|
|
main()
|