def RunCmd(self, arg=None, menuw=None): popup_string=_("Starting Web Browser...") pop = PopupBox(text=popup_string) pop.show() osd.stopdisplay() os.system('mozilla-firebird') osd.restartdisplay() osd.update() pop.destroy() osd.update()
def get(self, parent, files): """ return a list of items based on the files """ logger.log( 9, 'get(parent=%r, files=%r)', parent, files) items = [] if not hasattr(parent, 'add_args') or type(parent.add_args) is not types.TupleType: pop = PopupBox(text=_('please update GAMES_ITEMS in local_conf.py')) pop.show() time.sleep(2) pop.destroy() return [] file = '' (gtype, cmd, args, imgpath, suffixlist) = parent.add_args[0] try: if gtype == 'MAME': mame_files = util.find_matches(files, [ 'zip' ] ) # This will only add real mame roms to the cache. (rm_files, mame_list) = mame_cache.getMameItemInfoList(mame_files, cmd) for rm_file in rm_files: files.remove(rm_file) for ml in mame_list: items += [ MameItem(ml[0], ml[1], ml[2], cmd, args, imgpath, parent, ml[3]) ] elif gtype == 'SNES': for file in util.find_matches(files, snesromExtensions + [ 'zip' ]): items += [ SnesItem(file, cmd, args, imgpath, parent) ] files.remove(file) elif gtype == 'GENESIS': for file in util.find_matches(files, genesisromExtensions + ['zip']): items += [ GenesisItem(file, cmd, args, imgpath, parent) ] files.remove(file) elif gtype == 'GENERIC': logger.log( 9, 'find_matches=%r files=%r suffixlist=%r', util.find_matches(files, suffixlist), files, suffixlist) for file in util.find_matches(files, suffixlist): items += [ GenericItem(file, cmd, args, imgpath, parent) ] files.remove(file) except UnboundLocalError: logger.warning('Zip file \"%s\" may be corrupt', file) return items
def launch(self,arg,menuw): c=config.APPLICATIONS_NEED_WINDOW_MANAGER if c == 'auto': c = 'XDG_SESSION_DESKTOP' not in os.environ if not c: logger.debug("Not starting window manager in desktop environment") if c and self.parent.window_manager_childapp: logger.debug("Not starting window manager, already running") c=False if c : popup=PopupBox(text=(_("Starting window manager"))) popup.show() logger.debug("Starting window manger.") self.parent.window_manager_childapp=childapp.ChildApp2(config.APPLICATIONS_WINDOW_MANAGER) time.sleep(1) # give it time to settle before starting applications popup.destroy() popup=PopupBox(text=(_("Starting: ")+repr(self.name))) popup.show() logger.debug("Starting: "+repr(self.path)) Application([self.path]+list(self.args)) time.sleep(2) popup.destroy()
def get(self, parent, files): """ return a list of items based on the files """ logger.log(9, 'get(parent=%r, files=%r)', parent, files) items = [] if not hasattr(parent, 'add_args') or type( parent.add_args) is not types.TupleType: pop = PopupBox( text=_('please update GAMES_ITEMS in local_conf.py')) pop.show() time.sleep(2) pop.destroy() return [] file = '' (gtype, cmd, args, imgpath, suffixlist) = parent.add_args[0] try: if gtype == 'MAME': mame_files = util.find_matches(files, ['zip']) # This will only add real mame roms to the cache. (rm_files, mame_list) = mame_cache.getMameItemInfoList(mame_files, cmd) for rm_file in rm_files: files.remove(rm_file) for ml in mame_list: items += [ MameItem(ml[0], ml[1], ml[2], cmd, args, imgpath, parent, ml[3]) ] elif gtype == 'SNES': for file in util.find_matches(files, snesromExtensions + ['zip']): items += [SnesItem(file, cmd, args, imgpath, parent)] files.remove(file) elif gtype == 'GENESIS': for file in util.find_matches(files, genesisromExtensions + ['zip']): items += [GenesisItem(file, cmd, args, imgpath, parent)] files.remove(file) elif gtype == 'GENERIC': logger.log(9, 'find_matches=%r files=%r suffixlist=%r', util.find_matches(files, suffixlist), files, suffixlist) for file in util.find_matches(files, suffixlist): items += [GenericItem(file, cmd, args, imgpath, parent)] files.remove(file) except UnboundLocalError: logger.warning('Zip file \"%s\" may be corrupt', file) return items