| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- import sites as sites
- from helper.settings import Settings
- from helper import console as console
- import os.path
- import command
- def main():
- Settings.read()
- Settings.initialize()
- os.makedirs(Settings.tmpDir.get(), exist_ok=True)
- console.unlock()
- console.output('Music downloader by Deben Oldert')
- console.output()
- console.output('Download directory: {0}'.format(Settings.SaveDir.get()))
- console.output()
- help()
- console.output()
- console.output('Available sites: {0}'.format(', '.join(list(map(lambda x: x.url, sites.available)))))
- console.output('Selected site is: {0}'.format(sites.available[selected_site].url))
- console.output()
- while True:
- if not idle():
- break
- console.output('Quitting...')
- exit(0)
- def idle():
- _command = console.ask_input('Type command')
- for comm in command.commands:
- if comm[0] == _command.lower():
- return comm[1]()
- console.output('Command \'{0}\' not found. Type help to see a list of possible commands'.format(_command))
- return True
- def quit():
- return False
- selected_site = 0
- search_cache = None
- if __name__ == '__main__':
- main()
|