Skip to content

Fix for Emulation Station 2.x (es_systems.cfg in XML format) #51

@ultimoistante

Description

@ultimoistante

Hi, I've just written a new readConfig function to correctly parse the es_systems.cfg file, now in XML format.
Just replace the function readConfig with this:

def readConfig(file):
    systems=[]
    config = ET.parse(file)
    configroot = config.getroot()
    for child in configroot:
        name = child.find('name').text
        path = child.find('path').text
        ext = child.find('extension').text
        pid = child.find('platformid').text
        if not pid:
            continue
        else:
            system=(name,path,ext,pid)
            systems.append(system)
            print name, path, ext, pid
    return systems

Note: you need to add the subnode in all the nodes, like this:

    <system>
        <fullname>Nintendo Entertainment System</fullname>
        <name>nes</name>
        <path>/media/usb/roms/nes</path>
        <extension>.nes .NES</extension>
        <command>..... </command>
        <platform>nes</platform>
        <platformid>7</platformid>
        <theme>nes</theme>
    </system>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions