mewlo.mpacks.core.setting.msettings module

settings.py This file contains classes to support hierarchical settings.

We really don’t do anything fancy here – in fact some of it is a bit ugly and could use rewriting.

Essentially we are just maintaining a hierarchical dictionary with some support functions to ease access.

class mewlo.mpacks.core.setting.msettings.MewloSettings(mewlosite, debugmode)[source]

Bases: mewlo.mpacks.core.manager.manager.MewloManager

The MewloSettings class stores a hierarchical dictionary of settings

description = 'A collection of settings that can be read/written'
dumps(indent=0)[source]

Return a string (with newlines and indents) that displays some debugging useful information about the object.

get()[source]

Get all.

get_subsubvalue(keyname, keysubname, keysubsubname, defaultval=None)[source]

Lookup value from our settings dictionary at a certain root section, and return it or default if not found.

get_subvalue(keyname, keysubname, defaultval=None)[source]

Lookup value from our settings dictionary at a certain root section, and return it or default if not found.

get_subvalue_required(keyname, keysubname)[source]

Lookup value from our settings dictionary at a certain root section, and return it or raise exception.

get_value(keyname, defaultval=None)[source]

Lookup value from our settings dictionary and return it or default if not found.

merge_settings(settingstoadd)[source]

Just merge in a new dicitonary into our main dictionary.

merge_settings_key(keyname, settingstoadd)[source]

Merge in a new dicitonary into our main dictionary at a specific root section (creating root section if needed).

merge_settings_subkey(keyname, subkeyname, settingstoadd)[source]

Merge in a new dicitonary into our main dictionary at a specific root section (creating root section if needed).

remove_all()[source]

Clear contents of settings.

remove_key(keyname)[source]

Clear contents of one key.

remove_subkey(keyname, keysubname)[source]

Clear contents of one key.

set(newsettings)[source]

Overwrite all.

set_key(keyname, value)[source]

Set and overwrite a value at a section, replacing whatever was there.

set_subsubvalue(keyname, keysubname, keysubsubname, val)[source]

Set propery sub value.

set_subvalue(keyname, keysubname, val)[source]

Set propery sub value.

typestr = 'core'
update(newsettings)[source]

Overwrite all.

value_exists(keyname, keysubname=None)[source]

Return true if the item existing in our settings dictionary (at specific root section if specified).