def install_fonts(self): xml_path = os.path.join(self.script_path, "resources", "skins", "Default", "720p", "font.xml") font_dir = os.path.join(self.script_path, "resources", "skins", "Default", "fonts") self.install_file(xml_path, font_dir) reload_skin()
xbmc.translatePath('special://profile/addon_data'), __addon_id__ ) #Auto-create profile dir if it does not exist if not os.path.exists(addon_data_dir): os.makedirs(addon_data_dir) #Add the libraries libs_dir = os.path.join(__addon_path__, "resources/libs") sys.path.insert(0, libs_dir) #Add the skinutils module sys.path.insert(0, os.path.join(libs_dir, "XbmcSkinUtils.egg")) from skinutils import reload_skin from skinutils.includes import IncludeManager #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() #Load & start the actual gui, no init code beyond this point from docugui.application import Application from docugui import main app = Application(addon_cfg) app.setParam('host', 'docu.im') main(__addon_path__, app)
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()
def cleanup(self): self.remove_installed_names() #Reload skin so font files are no longer in use, and then delete them reload_skin() self.remove_installed_fonts()
addon_data_dir = os.path.join( xbmc.translatePath('special://profile/addon_data'), __addon_id__) #Auto-create profile dir if it does not exist if not os.path.exists(addon_data_dir): os.makedirs(addon_data_dir) #Add the libraries libs_dir = os.path.join(__addon_path__, "resources/libs") sys.path.insert(0, libs_dir) #Add the skinutils module sys.path.insert(0, os.path.join(libs_dir, "XbmcSkinUtils.egg")) from skinutils import reload_skin from skinutils.includes import IncludeManager #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() #Load & start the actual gui, no init code beyond this point from docugui.application import Application from docugui import main app = Application(addon_cfg) app.setParam('host', 'docu.im') main(__addon_path__, app)
def cleanup(self): self.remove_installed_names() # Reload skin so font files are no longer in use, and then delete them reload_skin() self.remove_installed_fonts()