Common Lisp Package: PY-CONFIGPARSER

README:

FUNCTION

Public

ADD-SECTION (CONFIG SECTION-NAME)

Adds a new section to the config. If the section exists, the `duplicate-section-error' is raised.

DEFAULTS (CONFIG)

Returns an alist containing instance wide defaults, where the elements are 2-element dotted lists: the CDR is the value associated with the key.

GET-OPTION (CONFIG SECTION-NAME OPTION-NAME &KEY (EXPAND T) DEFAULTS TYPE)

Returns the value of the specified option in the specified section. If `expand' is `NIL', any options which depend on other options won't be expanded and the raw configuration value is returned. When `defaults' is an alist of which the elements are dotted lists of key/value pairs, these values are used in the expansion of option values. `type' may be one of `:boolean', `:number' or it may remain unspecified.

HAS-OPTION-P (CONFIG SECTION-NAME OPTION-NAME)

Returns a generalised boolean with a value of `NIL' when the specified option does not exist in the specified section and some other value otherwise.

HAS-SECTION-P (CONFIG SECTION-NAME)

Returns `NIL' when the section is not added to the config yet, some other value if it is.

ITEMS (CONFIG SECTION-NAME &KEY (EXPAND T) DEFAULTS)

Returns an alist of which the items are dotted lists of key/value pairs being the option names and values specified in the given section. When `expand' is `NIL', options are returned in raw form. Otherwise option values are expanded. The definition of `defaults' is the same as for `get-option'.

OPTIONS (CONFIG SECTION-NAME)

Returns a list of option names which are defined in the given section.

READ-FILES (CONFIG FILENAMES)

Parses the files given in the list `filenames', if they exist. The list is processed first to last, overwriting any pre-existing values with the last value read. The results are stored in `config' which is modified destructively. Returns as values the configuration and the list of files actually read.

READ-STREAM (CONFIG STREAM &KEY (STREAM-NAME an unknown stream))

Parses the content of `stream' as a configuration file, storing any values in `config' which is modified destructively. This function maps from the python 'readfp()' function.

REMOVE-OPTION (CONFIG SECTION-NAME OPTION-NAME)

Remove the specified option from the given section.

REMOVE-SECTION (CONFIG SECTION-NAME)

Remove the specified section. In case the section name equals the magic name `DEFAULT', an error is raised, since this section can't be removed.

SECTIONS (CONFIG)

Returns a list of names of defined sections.

SET-OPTION (CONFIG SECTION-NAME OPTION-NAME VALUE)

Sets the value of the specified option in the specified section. If the section does not exist, a `no-section-error' is raised. If the option does not exist, it is created.

WRITE-STREAM (CONFIG STREAM)

Writes the configuration file corresponding to the in-memory config state. Reloading the file with `read-stream' or `read-files' will restore config state.

Undocumented

MAKE-CONFIG (&KEY ((DEFAULTS DUM38) (MAKE-SECTION NAME DEFAULT)) ((SECTIONS DUM39) NIL) ((OPTION-NAME-TRANSFORM-FN DUM40) #'STRING-DOWNCASE) ((SECTION-NAME-TRANSFORM-FN DUM41) #'IDENTITY))

Private

CONFIG-DEFAULTS (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

CONFIG-OPTION-NAME-TRANSFORM-FN (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

CONFIG-SECTION-NAME-TRANSFORM-FN (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

CONFIG-SECTIONS (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

SECTION-NAME (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

SECTION-OPTIONS (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

Undocumented

%EXPAND-OPTION-VALUE (CONFIG SECTION OPTION-VALUE DEFAULTS &OPTIONAL DEPENDEES)

%EXTRACT-REPLACEMENT (OPTION-VALUE)

%FORMAT-VALUE (VALUE)

%GET-OPTION (CONFIG SECTION-NAME OPTION-NAME IF-DOES-NOT-EXIST)

%GET-SECTION (CONFIG SECTION-NAME)

%OPTION-VALUE (CONFIG SECTION OPTION-NAME &KEY DEFAULTS)

%READ-CHAR (STREAM)

%VALIDATE-OPTION-NAME (NAME)

%VALIDATE-SECTION-NAME (NAME)

SETFCONFIG-DEFAULTS (NEW-VALUE INSTANCE)

SETFCONFIG-OPTION-NAME-TRANSFORM-FN (NEW-VALUE INSTANCE)

CONFIG-P (OBJECT)

SETFCONFIG-SECTION-NAME-TRANSFORM-FN (NEW-VALUE INSTANCE)

SETFCONFIG-SECTIONS (NEW-VALUE INSTANCE)

COPY-CONFIG (INSTANCE)

COPY-SECTION (INSTANCE)

ENSURE-SECTION (CONFIG SECTION-NAME)

EXPECT-CHAR (S EXPECT &KEY SKIP-WHITESPACE)

EXPECT-ONE-OF (S EXPECT-BAG &KEY SKIP-WHITESPACE)

EXTEND-INPUT (P C)

FINALIZE-INPUT (P)

IS-COMMENT-CHAR (C)

IS-WHITESPACE (C)

MAKE-INPUT-BUFFER (P)

MAKE-SECTION (&KEY ((NAME DUM0) NIL) ((OPTIONS DUM1) NIL))

NORM-OPTION-NAME (CONFIG OPTION-NAME)

NORM-SECTION-NAME (CONFIG SECTION-NAME)

READ-OPTION-NAME (P S)

READ-OPTION-VALUE (P S &KEY (LEADING-WHITE SKIP))

READ-SECTION-NAME (P S)

READING-DRIVER (P S)

SETFSECTION-NAME (NEW-VALUE INSTANCE)

SETFSECTION-OPTIONS (NEW-VALUE INSTANCE)

SECTION-P (OBJECT)

SKIP-EMPTY-LINE (S)

SKIP-TO-EOL (S)

SKIP-WHITESPACE (S)

GENERIC-FUNCTION

Private

Undocumented

FILE (CONDITION)

LINE (CONDITION)

MESSAGE (CONDITION)

SECTION (CONDITION)

CLASS

Public

Undocumented

CONFIG

Private

Undocumented

SECTION (CONDITION)

CONDITION

Public

Undocumented

CONFIGPARSER-ERROR

DUPLICATE-SECTION-ERROR

INTERPOLATION-DEPTH-ERROR

INTERPOLATION-ERROR

INTERPOLATION-MISSING-OPTION-ERROR

INTERPOLATION-SYNTAX-ERROR

MISSING-SECTION-HEADER-ERROR

NO-OPTION-ERROR

NO-SECTION-ERROR

PARSING-ERROR

Private

Undocumented

CONFIG-ERROR