RestOC.Conf module

Conf Module

Used to set and get conf (json) files

RestOC.Conf.get(key=None, default=None, conf='_')

Get

Gets a single value from a conf, returns default if not found

Parameters
  • key (string|tuple) – A tuple to find a child key, or a string to find a parent key

  • default (mixed) – What to return if the key isn’t found

  • conf (string) – The conf to fetch from

Returns

mixed

RestOC.Conf.load(file, conf='_')

Load

Loads a conf into the specified conf, or ‘default’, if not set

Argurments:

file (str): A file to be loaded into the conf conf (string): The conf to store in

Returns

None

RestOC.Conf.load_merge(file, conf='_')

Load Merge

Loads a conf and merges it into whatever already exists

Parameters
  • file (str) – A file to be loaded

  • conf (string) – The conf to update

Returns

None

RestOC.Conf.set(key, val, conf='_')

Set

Sets a key in the given conf, returns the previous value

Parameters
  • key (string|tuple) – A tuple to set a child key, or a string to set a parent key

  • val (mixed) – The value to set for the key

  • conf (str) – The conf to set the key for

Returns

mixed