Robot Framework Integrated Development Environment (RIDE)
robotide.preferences.configobj Namespace Reference

Classes

class  Builder
 
class  ConfigObj
 An object to read, create, and write config files. More...
 
class  ConfigObjError
 This is the base class for all errors that ConfigObj raises. More...
 
class  ConfigParserInterpolation
 Behaves like ConfigParser. More...
 
class  ConfigspecError
 Base class for the two interpolation errors. More...
 
class  DuplicateError
 The keyword or section specified already exists. More...
 
class  InterpolationEngine
 
class  InterpolationError
 Maximum interpolation depth exceeded in string interpolation. More...
 
class  InterpolationLoopError
 
class  MissingInterpolationOption
 
class  NestingError
 This error indicates a level of nesting that doesn't match. More...
 
class  ParseError
 A 'reload' operation failed. More...
 
class  ReloadError
 
class  RepeatSectionError
 This error indicates additional sections in a section with a __many__ (repeated) section. More...
 
class  Section
 A dictionary-like object that represents a section in a config file. More...
 
class  SimpleVal
 A simple validator. More...
 
class  TemplateInterpolation
 Behaves like string.Template. More...
 
class  UnknownType
 
class  UnreprError
 An error parsing in unrepr mode. More...
 

Functions

def __newobj__ (cls, *args)
 
def flatten_errors (cfg, res, levels=None, results=None)
 An example function that will turn a nested dictionary of results (as returned by ConfigObj.validate) into a flat list. More...
 
def get_extra_values (conf, _prepend=())
 Find all the values and sections not in the configspec from a validated ConfigObj. More...
 
def getObj (s)
 
def match_utf8 (encoding)
 
def unrepr (s)
 

Variables

tuple __all__
 
 _builder
 
dictionary BOM_LIST
 
dictionary BOM_SET
 
dictionary BOMS
 
 compiler = None
 
string DEFAULT_INDENT_TYPE = ' '
 
string DEFAULT_INTERPOLATION = 'configparser'
 
string dquot = '"%s"'
 
dictionary interpolation_engines
 
int MAX_INTERPOL_DEPTH = 10
 
 MISSING = object()
 
string noquot = "%s"
 
dictionary OPTION_DEFAULTS
 
string squot = "'%s'"
 
string tdquot = "'''%s'''"
 
string tsquot = '"""%s"""'
 
string wspace_plus = ' \r\n\v\t\'"'
 

Function Documentation

◆ __newobj__()

def robotide.preferences.configobj.__newobj__ (   cls,
args 
)

Definition at line 479 of file configobj.py.

◆ flatten_errors()

def robotide.preferences.configobj.flatten_errors (   cfg,
  res,
  levels = None,
  results = None 
)

An example function that will turn a nested dictionary of results (as returned by ConfigObj.validate) into a flat list.

cfg is the ConfigObj instance being checked, res is the results dictionary returned by validate.

(This is a recursive function, so you shouldn't use the levels or results arguments - they are used by the function.)

Returns a list of keys that failed. Each member of the list is a tuple::

([list of sections...], key, result)

If validate was called with preserve_errors=False (the default) then result will always be False.

list of sections is a flattened list of sections that the key was found in.

If the section was missing (or a section was expected and a scalar provided

  • or vice-versa) then key will be None.

If the value (or section) was missing then result will be False.

If validate was called with preserve_errors=True and a value was present, but failed the check, then result will be the exception object returned. You can use this as a string that describes the failure.

For example The value "3" is of the wrong type.

Definition at line 2524 of file configobj.py.

◆ get_extra_values()

def robotide.preferences.configobj.get_extra_values (   conf,
  _prepend = () 
)

Find all the values and sections not in the configspec from a validated ConfigObj.

get_extra_values returns a list of tuples where each tuple represents either an extra section, or an extra value.

The tuples contain two values, a tuple representing the section the value is in and the name of the extra values. For extra values in the top level section the first member will be an empty tuple. For values in the 'foo' section the first member will be ('foo',). For members in the 'bar' subsection of the 'foo' section the first member will be ('foo', 'bar').

NOTE: If you call get_extra_values on a ConfigObj instance that hasn't been validated it will return an empty list.

Definition at line 2569 of file configobj.py.

◆ getObj()

def robotide.preferences.configobj.getObj (   s)

Definition at line 126 of file configobj.py.

◆ match_utf8()

def robotide.preferences.configobj.match_utf8 (   encoding)

Definition at line 66 of file configobj.py.

◆ unrepr()

def robotide.preferences.configobj.unrepr (   s)

Definition at line 200 of file configobj.py.

Variable Documentation

◆ __all__

tuple robotide.preferences.configobj.__all__
private
Initial value:
1 = (
2  'DEFAULT_INDENT_TYPE',
3  'DEFAULT_INTERPOLATION',
4  'ConfigObjError',
5  'NestingError',
6  'ParseError',
7  'DuplicateError',
8  'ConfigspecError',
9  'ConfigObj',
10  'SimpleVal',
11  'InterpolationError',
12  'InterpolationLoopError',
13  'MissingInterpolationOption',
14  'RepeatSectionError',
15  'ReloadError',
16  'UnreprError',
17  'UnknownType',
18  'flatten_errors',
19  'get_extra_values'
20 )

Definition at line 81 of file configobj.py.

◆ _builder

robotide.preferences.configobj._builder
private

Definition at line 197 of file configobj.py.

◆ BOM_LIST

dictionary robotide.preferences.configobj.BOM_LIST
Initial value:
1 = {
2  'utf_16': 'utf_16',
3  'u16': 'utf_16',
4  'utf16': 'utf_16',
5  'utf-16': 'utf_16',
6  'utf16_be': 'utf16_be',
7  'utf_16_be': 'utf16_be',
8  'utf-16be': 'utf16_be',
9  'utf16_le': 'utf16_le',
10  'utf_16_le': 'utf16_le',
11  'utf-16le': 'utf16_le',
12  'utf_8': 'utf_8',
13  'u8': 'utf_8',
14  'utf': 'utf_8',
15  'utf8': 'utf_8',
16  'utf-8': 'utf_8',
17  }

Definition at line 38 of file configobj.py.

◆ BOM_SET

dictionary robotide.preferences.configobj.BOM_SET
Initial value:
1 = {
2  'utf_8': BOM_UTF8,
3  'utf_16': BOM_UTF16,
4  'utf16_be': BOM_UTF16_BE,
5  'utf16_le': BOM_UTF16_LE,
6  None: BOM_UTF8
7  }

Definition at line 57 of file configobj.py.

◆ BOMS

dictionary robotide.preferences.configobj.BOMS
Initial value:
1 = {
2  BOM_UTF8: ('utf_8', None),
3  BOM_UTF16_BE: ('utf16_be', 'utf_16'),
4  BOM_UTF16_LE: ('utf16_le', 'utf_16'),
5  BOM_UTF16: ('utf_16', 'utf_16'),
6  }

Definition at line 29 of file configobj.py.

◆ compiler

robotide.preferences.configobj.compiler = None

Definition at line 24 of file configobj.py.

◆ DEFAULT_INDENT_TYPE

string robotide.preferences.configobj.DEFAULT_INDENT_TYPE = ' '

Definition at line 103 of file configobj.py.

◆ DEFAULT_INTERPOLATION

string robotide.preferences.configobj.DEFAULT_INTERPOLATION = 'configparser'

Definition at line 102 of file configobj.py.

◆ dquot

string robotide.preferences.configobj.dquot = '"%s"'

Definition at line 72 of file configobj.py.

◆ interpolation_engines

dictionary robotide.preferences.configobj.interpolation_engines
Initial value:
1 = {
2  'configparser': ConfigParserInterpolation,
3  'template': TemplateInterpolation,
4 }

Definition at line 473 of file configobj.py.

◆ MAX_INTERPOL_DEPTH

int robotide.preferences.configobj.MAX_INTERPOL_DEPTH = 10

Definition at line 104 of file configobj.py.

◆ MISSING

robotide.preferences.configobj.MISSING = object()

Definition at line 79 of file configobj.py.

◆ noquot

string robotide.preferences.configobj.noquot = "%s"

Definition at line 73 of file configobj.py.

◆ OPTION_DEFAULTS

dictionary robotide.preferences.configobj.OPTION_DEFAULTS
Initial value:
1 = {
2  'interpolation': True,
3  'raise_errors': False,
4  'list_values': True,
5  'create_empty': False,
6  'file_error': False,
7  'configspec': None,
8  'stringify': True,
9  # option may be set to one of ('', ' ', '\t')
10  'indent_type': None,
11  'encoding': None,
12  'default_encoding': None,
13  'unrepr': False,
14  'write_empty_values': False,
15 }

Definition at line 106 of file configobj.py.

◆ squot

string robotide.preferences.configobj.squot = "'%s'"

Definition at line 71 of file configobj.py.

◆ tdquot

string robotide.preferences.configobj.tdquot = "'''%s'''"

Definition at line 76 of file configobj.py.

◆ tsquot

string robotide.preferences.configobj.tsquot = '"""%s"""'

Definition at line 75 of file configobj.py.

◆ wspace_plus

string robotide.preferences.configobj.wspace_plus = ' \r\n\v\t\'"'

Definition at line 74 of file configobj.py.