fixes for runner installation

This commit is contained in:
Mathieu Comandon 2012-11-10 03:40:03 +01:00
parent 5062984957
commit 2521f82a34
6 changed files with 9 additions and 14 deletions

View file

@ -16,7 +16,7 @@ class RunnerConfigVBox(ConfigVBox):
ConfigVBox.__init__(self, runner_classname, caller)
runner = import_runner(runner_classname)()
logger.debug("Building configvbox for runner %s", runner.machine)
if hasattr(runner, "runner_options"):
if "runner_options" is not None:
self.options = runner.runner_options
self.lutris_config = lutris_config
logger.debug("Building widgets for runner %s", runner.machine)

View file

@ -93,9 +93,7 @@ class RunnersDialog(Gtk.Dialog):
self.set_size_request(570, 400)
label = Gtk.Label()
label.set_markup("""
<b>Install and configure the game runners</b>
""")
label.set_markup("<b>Install and configure the game runners</b>")
scrolled_window = Gtk.ScrolledWindow()
scrolled_window.set_policy(Gtk.PolicyType.AUTOMATIC,

View file

@ -42,6 +42,7 @@ class dolphin(Runner):
self.description = "Emulator for Nintendo Gamecube and Wii games"
self.is_installable = False
self.game_options = []
self.runner_options = []
def install(self):
NoticeDialog('Please activate the PlayDeb reposiories in order to ' + \

View file

@ -36,6 +36,7 @@ class frotz(Runner):
self.package = "frotz"
self.executable = "frotz"
self.machine = "Z-Code"
self.is_installable = True
self.description = "Z Code interpreter (Infocom interactive fictions)"
self.game_options = [{
"option": "story",

View file

@ -95,16 +95,6 @@ class Runner(object):
is_installed = True
return is_installed
# pylint: disable=R0201
def get_game_options(self):
"""Not even sure that's used (well, let's see)"""
raise DeprecationWarning("WTF is this shit ?")
# pylint: disable=R0201
def get_runner_options(self):
"""Not even sure that's used (well, let's see)"""
raise DeprecationWarning("WTF is this shit ?")
def get_game_path(self):
"""Seems suspicious, but still useful"""
logger.warning("get_game_path called, I'm 12 and what is this ?")
@ -148,6 +138,10 @@ class Runner(object):
logger.error("The distribution you're running is not supported.")
logger.error("Edit runners/runner.py to add support for it")
return False
if self.package is None:
logger.error("The requested runner %s can't be installed",
self.__class__.__name__)
return
subprocess.Popen("%s %s %s" % (package_manager, install_args,
self.package),

View file

@ -28,6 +28,7 @@ class ImportRunnerTest(TestCase):
runner = runner_class()
self.assertTrue(hasattr(runner, 'game_options'),
"%s doesn't have game options" % runner_name)
self.assertTrue(hasattr(runner, 'runner_options'))
for option in runner.game_options:
self.assertIn('type', option)
self.assertFalse(option['type'] == 'single')