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.

64 lines
1.2 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
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
  1. #!/usr/bin/env python2
  2. """Youtubedlg __init__ file.
  3. Responsible on how the package looks from the outside.
  4. Example:
  5. In order to load the GUI from a python script.
  6. import youtube_dl_gui
  7. youtube_dl_gui.main()
  8. """
  9. import sys
  10. import os.path
  11. try:
  12. import wx
  13. except ImportError as error:
  14. print error
  15. sys.exit(1)
  16. # For package use
  17. from .version import __version__
  18. from .info import (
  19. __author__,
  20. __appname__,
  21. __contact__,
  22. __license__,
  23. __projecturl__,
  24. __licensefull__,
  25. __description__,
  26. __descriptionfull__,
  27. )
  28. from .mainframe import MainFrame
  29. from .logmanager import LogManager
  30. from .optionsmanager import OptionsManager
  31. from .utils import get_config_path
  32. def main():
  33. """The real main.
  34. Sets configuration path, enables the managers like OptionsManager,
  35. LogManager, etc.. and creates the main app window.
  36. """
  37. config_path = os.path.join(get_config_path(), __appname__.lower())
  38. opt_manager = OptionsManager(config_path)
  39. log_manager = None
  40. if opt_manager.options['enable_log']:
  41. log_manager = LogManager(config_path, opt_manager.options['log_time'])
  42. app = wx.App()
  43. frame = MainFrame(opt_manager, log_manager)
  44. frame.Centre()
  45. frame.Show()
  46. app.MainLoop()