batocera-ES-onArch

Emulationstation from batocera with configs and scripts for integration as Arch-Linux package

This project is maintained by GB609

/opt/batocera-emulationstation/node_modules/effective-values.js

Overview

This module contains functions related to merging of multiple property source files to one target.
How the merge happens, and what it includes, depends on the intended purpose of the target file. The functions declared in this module are available for use via btc-config as command actions of the same name.

Index

runEffectiveCalculationProcess

This function provides a generic flow for all ‘effective…’ procedures to encapsulate commonly used arguments and options.
It does the following:

  1. Call config-imports:mergePropertyFiles(sourceFiles, filePreProcessing)
  2. Call mergedPostProcessing(mergeResult)
  3. Handle output writing, including any options related to writer or format.

The processing functions do nothing by default - they just return the input.
This function has to actively be called from the actual calculation method. The calculated property dict will be written by from this function already, so it is NOT required and not advisable to propagate the function’s return value back to btc-config - it would be printed twice. This would only make sense when the dictionary shall be written to a file AND to stdout.

Generic command line options:
Some of the options which are just passed to the writer might not be supported by all writers.

  1. --declare-fn <string> - passed to writer as options.declareCommand
  2. --strip-prefix <int> - passed to writer as options.stripPrefix
  3. --include-source - passed to writer as options.printSource
  4. --output-file <path> - handled in this function, determines what is passed as target argument to writer.
    This option implies a check or modification times to see if parsing, merging and writing the target file is necessary at all.
  5. --force - handled in this function, only applies when --output-file is given. Write file regardless of mod times.

[@returns the merged dictionary]

effectiveUserSettings

This is a slight variation of effectiveGlobals. It is used to maintain the user-specific es_settings.cfg file.
Differences:

  1. Properties are not filtered based on keys - anything from system.conf is taken
  2. Instead, any property with the value ‘auto’ is stripped, as that is the default.
  3. Intended usage: Add OR remove (unchanged) system properties to/from es_settings.cfg.

Has 2 modes of operation:

  1. ‘full’: Merge system.conf and es_settings.cfg
  2. ‘diff’: Only print those properties in es_settings.cfg, which are NOT contained in system.conf with identical value

Generated with shdoc from /opt/batocera-emulationstation/node_modules/effective-values.js