Giter Site home page Giter Site logo

petrockblog / esconfigedit Goto Github PK

View Code? Open in Web Editor NEW
8.0 2.0 9.0 153 KB

Sets or removes system information from system configuration files of Sets or removes system information from system configuration files of Sets or removes system information from system configuration files of EmulationStation.

License: GNU General Public License v2.0

Python 100.00%

esconfigedit's Introduction

ESConfigEdit

This program provides the functions for setting or removing system configurations of EmulationStation, a graphical front-end.

Installation

To install this tool, you can download the current release directly from the repository with the command

git clone https://github.com/petrockblog/ESConfigEdit.git

This downloads the current repository into the folder ESConfigEdit. You can make the program executable with the command chmod +x esconfig.edit.py.

Usage

Here is the generic usage information that is also provided from command line:

usage: esconfedit.py [-h] [-f FULLNAME] [-n NAME] [-d DIRECTORY]
                     [-e EXTENSION] [-c COMMAND] [-p PLATFORM] [-t THEME]
                     {set,remove} inputfile outputfile

Sets or removes system information from system configuration files of
EmulationStation (see emulationstation.org).

positional arguments:
  {set,remove}          Sets the mode
  inputfile             path and name of input XML file
  outputfile            path and name of output XML file

optional arguments:
  -h, --help            show this help message and exit

optional arguments, system-specific::
  -f FULLNAME, --fullname FULLNAME
                        full name of the system
  -n NAME, --name NAME  name of the system
  -d DIRECTORY, --directory DIRECTORY
                        path of the ROMs of the system
  -e EXTENSION, --extension EXTENSION
                        Extensions of the ROMs
  -c COMMAND, --command COMMAND
                        Command to start the emulator with a ROM
  -p PLATFORM, --platform PLATFORM
                        Platform name for EmulationStation
  -t THEME, --theme THEME
                        Theme name for EmulationStation

The program can run in various modes:

  1. Set mode: In this mode the program reads sourcefile, adds the given system information to it and writes the result to outputfile. If a system with the same name already exists, the existing system information are changed.
  2. Remove mode: In this mode the program reads sourcefile, removes the system with the given name, and writes the result to outputfile. If the system does not exist, outputfile will have the same content as inputfile.

Example

Setting System Configurations

Here is an exemplary function call to add/edit a system. Please note that the backslashes:

python esconfedit.py -f "Super Nintendo" \
-n "snes2" \
-d "~/RetroPie/roms/snes" \
-e ".smc .sfc .fig .swc .SMC .SFC .FIG .SWC" \
-c "/opt/retropie/supplementary/runcommand/runcommand.sh 4 \"/opt/retropie/emulators/RetroArch/installdir/bin/retroarch -L /opt/retropie/emulatorcores/pocketsnes-libretro/libretro.so --config /opt/retropie/configs/all/retroarch.cfg --appendconfig /opt/retropie/configs/snes/retroarch.cfg %ROM%\"" \
-p "snes" \
-t "snes" \
set es_systems.xml new_es_systems.xml

Removing System Configurations

Here is an exemplary function call to remove a system:

python esconfedit.py -n "snes2" remove es_systems.xml new_es_systems.xml

If you have any comments or ideas ofr enhancements feel free to post a comment or issue at https://github.com/petrockblog/ESConfigEdit.

esconfigedit's People

Contributors

petrockblog avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

esconfigedit's Issues

remove function problem

am I calling the remove function wrong ?

/opt/retropie/supplementary/ESConfigEdit/esconfedit.py -n snes remove /etc/emulationstation/es_systems.cfg /etc/emulationstation/es_systems.cfg
Traceback (most recent call last):
  File "/opt/retropie/supplementary/ESConfigEdit/esconfedit.py", line 318, in <module>
    systemlist.loadSystems(args.inputfile)
TypeError: loadSystems() takes exactly 3 arguments (2 given)

I'm currently using xmlstarlet to remove systems as a workaround - I'm also considering whether using xmlstarlet might be worth using for adding systems too, as it would have the advantage of not having to maintain code in two places. I also wanted to implement sorting too which xmlstarlet can do. Thoughts ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.