Exemplo n.º 1
0
def main():

    setup_logging()

    #Look busy while everything gets initialized
    show_busy_dialog()

    #Surround the rest of the init process
    try:

        #Set font & include manager vars
        fm = None
        im = None

        #And perform the rest of the import statements
        from utils.environment import set_dll_paths
        from skinutils import reload_skin
        from skinutils.fonts import FontManager
        from skinutils.includes import IncludeManager
        from _spotify import unload_library

        #Add the system specific library path
        set_dll_paths('resources/dlls')

        #Install custom fonts
        fm = FontManager()
        skin_dir = os.path.join(__addon_path__, "resources/skins/DefaultSkin")
        xml_path = os.path.join(skin_dir, "720p/font.xml")
        font_dir = os.path.join(skin_dir, "fonts")
        fm.install_file(xml_path, font_dir)

        #Install custom includes
        im = IncludeManager()
        include_path = os.path.join(skin_dir, "720p/includes.xml")
        im.install_file(include_path)
        reload_skin()

        #Show the busy dialog again after reload_skin(), as it may go away
        show_busy_dialog()

        #Load & start the actual gui, no init code beyond this point
        gui_main(__addon_path__)

        show_busy_dialog()

        #Do a final garbage collection after main
        gc.collect()

        #from _spotify.utils.moduletracker import _tracked_modules
        #print "tracked modules after: %d" % len(_tracked_modules)

        #import objgraph
        #objgraph.show_backrefs(_tracked_modules, max_depth=5)

    except (SystemExit, Exception) as ex:
        if str(ex) != '':
            dlg = xbmcgui.Dialog()
            dlg.ok(ex.__class__.__name__, str(ex))
            traceback.print_exc()

    finally:

        unload_library("libspotify")

        #Cleanup includes and fonts
        if im is not None:
            del im

        if fm is not None:
            del fm

        #Close the background loading window
        #loadingwin.close()
        hide_busy_dialog()
Exemplo n.º 2
0
def main():

    setup_logging()

    #Look busy while everything gets initialized
    show_busy_dialog()

    #Surround the rest of the init process
    try:

        #Set font & include manager vars
        fm = None
        im = None

        #And perform the rest of the import statements
        from utils.environment import set_dll_paths
        from skinutils import reload_skin
        from skinutils.fonts import FontManager
        from skinutils.includes import IncludeManager
        from _spotify import unload_library

        #Add the system specific library path
        set_dll_paths('resources/dlls')

        #Install custom fonts
        fm = FontManager()
        skin_dir = os.path.join(__addon_path__, "resources/skins/DefaultSkin")
        xml_path = os.path.join(skin_dir, "720p/font.xml")
        font_dir = os.path.join(skin_dir, "fonts")
        fm.install_file(xml_path, font_dir)

        #Install custom includes
        im = IncludeManager()
        include_path = os.path.join(skin_dir, "720p/includes.xml")
        im.install_file(include_path)
        reload_skin()

        #Show the busy dialog again after reload_skin(), as it may go away
        show_busy_dialog()

        #Load & start the actual gui, no init code beyond this point
        gui_main(__addon_path__)

        show_busy_dialog()

        #Do a final garbage collection after main
        gc.collect()

        #from _spotify.utils.moduletracker import _tracked_modules
        #print "tracked modules after: %d" % len(_tracked_modules)

        #import objgraph
        #objgraph.show_backrefs(_tracked_modules, max_depth=5)

    except (SystemExit, Exception) as ex:
        if str(ex) != '':
            dlg = xbmcgui.Dialog()
            dlg.ok(ex.__class__.__name__, str(ex))
            traceback.print_exc()

    finally:

        unload_library("libspotify")

        #Cleanup includes and fonts
        if im is not None:
            del im

        if fm is not None:
            del fm

        #Close the background loading window
        #loadingwin.close()
        hide_busy_dialog()
Exemplo n.º 3
0
#Add the skinutils module
sys.path.append(os.path.join(libs_dir, "XbmcSkinUtils.egg"))

#Load font & include stuff
from skinutils import reload_skin
from skinutils.fonts import FontManager
from skinutils.includes import IncludeManager

try:
    #Set font & include manager vars
    fm = None
    im = None
    
    #Install custom fonts
    fm = FontManager()
    skin_dir = os.path.join(__addon_path__, "resources/skins/DefaultSkin")
    xml_path = os.path.join(skin_dir, "720p/font.xml")
    font_dir = os.path.join(skin_dir, "fonts")
    fm.install_file(xml_path, font_dir)
    
    #Install custom includes
    im = IncludeManager()
    include_path = os.path.join(__addon_path__, "resources/skins/DefaultSkin/720p/includes.xml")
    im.install_file(include_path)
    reload_skin()
    
    #Import spotify & friends
    sys.path.append(os.path.join(libs_dir, "CherryPy.egg"))
    sys.path.append(os.path.join(libs_dir, "PyspotifyCtypes.egg"))
    sys.path.append(os.path.join(libs_dir, "PyspotifyCtypesProxy.egg"))
Exemplo n.º 4
0
#Add the skinutils module
sys.path.insert(0, os.path.join(libs_dir, "XbmcSkinUtils.egg"))

#Load font & include stuff
from skinutils import reload_skin
from skinutils.fonts import FontManager
from skinutils.includes import IncludeManager

try:
    #Set font & include manager vars
    fm = None
    im = None

    #Install custom fonts
    fm = FontManager()
    skin_dir = os.path.join(__addon_path__, "resources/skins/DefaultSkin")
    xml_path = os.path.join(skin_dir, "720p/font.xml")
    font_dir = os.path.join(skin_dir, "fonts")
    fm.install_file(xml_path, font_dir)

    #Install custom includes
    im = IncludeManager()
    include_path = os.path.join(
        __addon_path__, "resources/skins/DefaultSkin/720p/includes.xml")
    im.install_file(include_path)
    reload_skin()

    #Import spotify & friends
    sys.path.insert(0, os.path.join(libs_dir, "CherryPy.egg"))
    sys.path.insert(0, os.path.join(libs_dir, "PyspotifyCtypes.egg"))