music-dl/src/main.py

33 lines
996 B
Python
Raw Normal View History

2018-01-24 17:43:35 -06:00
# -*- coding: utf-8 -*-
from __future__ import unicode_literals # at top of module
2018-03-12 10:02:18 -06:00
import os
import logging
import storage
storage.setup()
logging.basicConfig(filename=os.path.join(storage.data_directory, "info.log"), level=logging.DEBUG, filemode="w")
log = logging.getLogger("main")
log.debug("Logger initialized. Saving debug to {0}".format(storage.data_directory,))
log.debug("Starting music-dl %s" % (application.version,))
log.debug("Application path is %s" % (paths.app_path(),))
import sys
2018-03-12 10:02:18 -06:00
log.debug("Using Python version {0}".format(sys.version,))
if sys.version[0] == "2":
if hasattr(sys, "frozen"):
2018-03-12 10:02:18 -06:00
log.debug("Applying fixes for Python 2 frozen executables.")
import fixes
fixes.setup()
2018-01-24 17:43:35 -06:00
import i18n
2018-02-28 13:50:31 -06:00
i18n.setup()
2018-01-24 17:43:35 -06:00
import widgetUtils
import application
from platform_utils import paths
def setup():
from controller import mainController
app = widgetUtils.mainLoopObject()
log.debug("Created Application mainloop object")
r = mainController.Controller()
app.run()
setup()