You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
1.0 KiB

10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
  1. #!/usr/bin/env python2
  2. ''' Youtube-dlg __init__ file. '''
  3. import sys
  4. import os.path
  5. try:
  6. import wx
  7. except ImportError as error:
  8. print error
  9. sys.exit(1)
  10. # For package use
  11. from .version import __version__
  12. from .data import (
  13. __author__,
  14. __appname__,
  15. __contact__,
  16. __license__,
  17. __projecturl__,
  18. __licensefull__,
  19. __description__,
  20. __descriptionfull__,
  21. )
  22. from .MainFrame import MainFrame
  23. from .LogManager import LogManager
  24. from .OptionsManager import OptionsManager
  25. from .utils import get_config_path
  26. def main():
  27. '''
  28. Real main. Set configuration path,
  29. enable managers and call main app window.
  30. '''
  31. config_path = os.path.join(get_config_path(), __appname__.lower())
  32. opt_manager = OptionsManager(config_path)
  33. log_manager = None
  34. if opt_manager.options['enable_log']:
  35. log_manager = LogManager(config_path, opt_manager.options['log_time'])
  36. app = wx.App()
  37. frame = MainFrame(opt_manager, log_manager)
  38. frame.Centre()
  39. frame.Show()
  40. app.MainLoop()