def _loadSettings(self): try: for consoleentry in settings.consoles(): if settings.consoles()[consoleentry]['emulator'] != '': emulator = settings.consoles()[consoleentry]['emulator'] if consoleentry == 'Nintendo Entertainment System': self.ui.pathNES.setText(settings.emulators()[emulator]['location']) self.ui.cmdNES.setText(settings.emulators()[emulator]['command']) elif consoleentry == 'Super Nintendo': self.ui.pathSNES.setText(settings.emulators()[emulator]['location']) self.ui.cmdSNES.setText(settings.emulators()[emulator]['command']) elif consoleentry == 'Nintendo 64': self.ui.pathN64.setText(settings.emulators()[emulator]['location']) self.ui.cmdN64.setText(settings.emulators()[emulator]['command']) elif consoleentry == 'Nintendo Gamecube': self.ui.pathGameCube.setText(settings.emulators()[emulator]['location']) self.ui.cmdGameCube.setText(settings.emulators()[emulator]['command']) elif consoleentry == 'Nintendo Wii': self.ui.pathWii.setText(settings.emulators()[emulator]['location']) self.ui.cmdWii.setText(settings.emulators()[emulator]['command']) elif consoleentry == 'Playstation 1': self.ui.pathPS1.setText(settings.emulators()[emulator]['location']) self.ui.cmdPS1.setText(settings.emulators()[emulator]['command']) elif consoleentry == 'Playstation 2': self.ui.pathPS2.setText(settings.emulators()[emulator]['location']) self.ui.cmdPS2.setText(settings.emulators()[emulator]['command']) elif consoleentry == 'Sega Genesis': self.ui.pathGenesis.setText(settings.emulators()[emulator]['location']) self.ui.cmdGenesis.setText(settings.emulators()[emulator]['command']) elif consoleentry == 'Sega Dreamcast': self.ui.pathDreamcast.setText(settings.emulators()[emulator]['location']) self.ui.cmdDreamcast.setText(settings.emulators()[emulator]['command']) elif consoleentry == 'Nintendo Gameboy': self.ui.pathGameBoy.setText(settings.emulators()[emulator]['location']) self.ui.cmdGameBoy.setText(settings.emulators()[emulator]['command']) elif consoleentry == 'Gameboy Advance': self.ui.pathGBA.setText(settings.emulators()[emulator]['location']) self.ui.cmdGBA.setText(settings.emulators()[emulator]['command']) elif consoleentry == 'Nintendo DS': self.ui.pathNDS.setText(settings.emulators()[emulator]['location']) self.ui.cmdNDS.setText(settings.emulators()[emulator]['command']) except: print 'An error occured while loading configs' return
def settings_consoles(): consoles = [] consoles_dict = settings.consoles() for name in consoles_dict.keys(): console_data = consoles_dict[name] console = Console(name, console_data) consoles.append(console) return consoles
def lookup_emulator(console): try: emulator_name = settings.consoles()[console.fullname]['emulator'] except KeyError as e: log_file("No emulator supplied for %s" % (console.shortname)) return None if emulator_name not in custom_emulators(): log_file("Emulator '%s' not found for %s. Ignoring" % (emulator_name, console.fullname)) return None return custom_emulators()[emulator_name]
def settings_consoles(self): consoles = [] consoles_dict = settings.consoles() for name in consoles_dict.keys(): console_data = consoles_dict[name] nickname = name if 'nickname' in console_data: nickname = console_data['nickname'] console = Console(nickname, name) consoles.append(console) return consoles