v0.99pre8 - Gamelist generation crashes when control type is keyboard

Bug #581711 reported by Wayne Moulden
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Wah!Cade
Fix Committed
Undecided
Unassigned

Bug Description

Game list generation crashes in both windows and linux when control type is 'keyboard' for ~0.137 mame builds. Tested with 0.137u4 in windows and 0.137u3 in mythbuntu 9.10.

Traceback (most recent call last):
  File "/usr/local/share/games/wahcade/win_main.py", line 643, in on_winMain_key_press
    self.options.menu_selected()
  File "/usr/local/share/games/wahcade/win_options.py", line 346, in menu_selected
    self.set_menu(menu_item, menu_desc)
  File "/usr/local/share/games/wahcade/win_options.py", line 243, in set_menu
    self.WinMain.emu_ini)
  File "/usr/local/share/games/wahcade/filters.py", line 369, in create_initial_filter
    gd = mi.next()
  File "/usr/local/share/games/wahcade/filters.py", line 271, in get_xml_game_item
    d['controller_type'] = _controllers[ctrl.attrib['type']]
KeyError: 'keyboard'

This can be fixed by forcing keyboard as a string into d['controller_type'] at line 271 of filter.py replace

                       d['controller_type'] = _controllers[ctrl.attrib['type']]

with

   if ctrl.attrib['type'] == 'keyboard':
                         d['controller_type'] = 'Keyboard'
   else:
                         d['controller_type'] = _controllers[ctrl.attrib['type']]

*** fix tested in linux

Related branches

Wayne Moulden (waynemou)
description: updated
Revision history for this message
Wayne Moulden (waynemou) wrote :

With additional time to look at this issue, the last mentioned 'fix' was a workaround. The required fix is to add 'keyboard': u'Keyboard', into the controllers array starting at line 74, ie

this,

_controllers = {
    'joy2way': u'2-Way Joystick',
    'vjoy2way': u'Vertical 2-Way Joystick',
    'joy4way': u'4-Way Joystick',
    'joy8way': u'8-Way Joystick',
    'stick': u'Analogue Joystick (or ~270\xb0 Wheel)',
    'doublejoy2way': u'Double 2-Way Joysticks',
    'vdoublejoy2way': u'Double Vertical 2-Way Joysticks',
    'doublejoy4way': u'Double 4-Way Joysticks',
    'doublejoy8way': u'Double 8-Way Joysticks',
    'lightgun': u'Light-Gun',
    'paddle': u'Paddle (or ~270\xb0 Wheel)',
    'dial': u'Spinner (or 360\xb0 Wheel)',
    'trackball': u'Trackball',
    'pedal': u'Pedal',
    '': u'None'}

becomes,

_controllers = {
    'joy2way': u'2-Way Joystick',
    'vjoy2way': u'Vertical 2-Way Joystick',
    'joy4way': u'4-Way Joystick',
    'joy8way': u'8-Way Joystick',
    'stick': u'Analogue Joystick (or ~270\xb0 Wheel)',
    'doublejoy2way': u'Double 2-Way Joysticks',
    'vdoublejoy2way': u'Double Vertical 2-Way Joysticks',
    'doublejoy4way': u'Double 4-Way Joysticks',
    'doublejoy8way': u'Double 8-Way Joysticks',
    'lightgun': u'Light-Gun',
    'paddle': u'Paddle (or ~270\xb0 Wheel)',
    'dial': u'Spinner (or 360\xb0 Wheel)',
    'trackball': u'Trackball',
    'pedal': u'Pedal',
    'keyboard': u'Keyboard',
    '': u'None'}

The gamelist will build completely using listxml as list_generation_method on mame137 and above builds

Revision history for this message
Wayne Moulden (waynemou) wrote :

note: fixed in v0.99pre9 commit 23

Wayne Moulden (waynemou)
Changed in wahcade:
status: New → Fix Committed
Revision history for this message
Andy Balcombe (andy-balcombe) wrote :

Thanks for raising the bug Wayne.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.