Next: Introduction, Previous: (dir), Up: (dir) [Contents][Index]
This is the py-configparser Reference Manual, generated automatically by Declt version 4.0 beta 2 "William Riker" on Mon Aug 15 05:39:10 2022 GMT+0.
Next: Systems, Previous: The py-configparser Reference Manual, Up: The py-configparser Reference Manual [Contents][Index]
$URL: https://svn.common-lisp.net/py-configparser/trunk/README $ $Id: README 19 2008-03-14 20:17:12Z ehuelsmann $ py-configparser =============== This package provides the same functionality as the Python configparser module, implemented in pure Common Lisp. Differences between the two =========================== The CL version makes a strong distinction in the parser on one hand and the in-memory storage management on the other hand. Because of it, the CL version doesn't call its objects 'Parser', but 'config' instead. The parser/writer part of the package provides the three functions READ-STREAM, READ-FILES and WRITE-STREAM, which map from the python variants 'readfp', 'read' and 'write'. API mapping =========== The functions provided in the Python module (which are all methods of the ConfigParser class): ConfigParser() -> (make-config) defaults() -> (defaults) sections() -> (sections ) add_section(name) -> (add-section name) has_section(name) -> (has-section-p name) options(section_name) -> (options section-name) has_option(section_name, name) -> (has-option-p section-name name) read(filenames) -> (read-files filenames) readfd(fp) -> (read-stream stream) get(section, option[, raw[, vars]]) -> (get-option section option &key expand defaults type) getint(section, option) -> [folded into get-option using 'type' key] getfloat(section, option) -> [folded into get-option using 'type' key] getboolean(section, option) -> [folded into get-option using 'type' key] items(section_name[, raw[, vars]]) -> (items section-name &key expand defaults) set(section, option, value) -> (set-option section-name option-name value) write(fp) -> (write-stream stream) remove_option(section, option) -> (remove-option section-name option-name) remove_section(section) -> (remove-section section-name) Note that the above is just a simple mapping table, but is all you need to get you started. Documentation from the ConfigParser module should sufficiently document this package. However minor differences in parameter and method naming may occur.
Next: Files, Previous: Introduction, Up: The py-configparser Reference Manual [Contents][Index]
The main system appears first, followed by any subsystem dependency.
Common Lisp implementation of the Python ConfigParser module
Erik Huelsmann
MIT
parse-number (system).
Next: Packages, Previous: Systems, Up: The py-configparser Reference Manual [Contents][Index]
Files are sorted by type and then listed depth-first from the systems components trees.
Next: py-configparser/package.lisp, Previous: Lisp, Up: Lisp [Contents][Index]
py-configparser (system).
Next: py-configparser/config.lisp, Previous: py-configparser/py-configparser.asd, Up: Lisp [Contents][Index]
py-configparser (system).
Next: py-configparser/parser.lisp, Previous: py-configparser/package.lisp, Up: Lisp [Contents][Index]
package.lisp (file).
py-configparser (system).
Previous: py-configparser/config.lisp, Up: Lisp [Contents][Index]
config.lisp (file).
py-configparser (system).
Next: Definitions, Previous: Files, Up: The py-configparser Reference Manual [Contents][Index]
Packages are listed by definition order.
Next: py-configparser, Previous: Packages, Up: Packages [Contents][Index]
Previous: py-configparser-system, Up: Packages [Contents][Index]
common-lisp.
Next: Indexes, Previous: Packages, Up: The py-configparser Reference Manual [Contents][Index]
Definitions are sorted by export status, category, package, and then by lexicographic order.
Next: Internals, Previous: Definitions, Up: Definitions [Contents][Index]
Next: Conditions, Previous: Public Interface, Up: Public Interface [Contents][Index]
Adds a new section to the config.
If the section exists, the ‘duplicate-section-error’ is raised.
Returns an alist containing instance wide defaults, where the elements are 2-element dotted lists: the CDR is the value associated with the key.
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.
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.
Returns ‘NIL’ when the section is not added to the config yet, some other value if it is.
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’.
Returns a list of option names which are defined in the given section.
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.
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 the specified option from the given section.
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.
Returns a list of names of defined sections.
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.
Writes the configuration file corresponding to the
in-memory config state. Reloading the file
with ‘read-stream’ or ‘read-files’ will restore config state.
Next: Structures, Previous: Ordinary functions, Up: Public Interface [Contents][Index]
error.
(quote py-configparser::*line-no*)
:line-no
line.
This slot is read-only.
(quote py-configparser::*file-name*)
:file
file.
This slot is read-only.
(quote py-configparser::*current-section*)
:section
This slot is read-only.
Previous: Conditions, Up: Public Interface [Contents][Index]
structure-object.
(py-configparser::make-section :name "default")
(function string-downcase)
(function identity)
Previous: Public Interface, Up: Definitions [Contents][Index]
Next: Ordinary functions, Previous: Internals, Up: Internals [Contents][Index]
Next: Generic functions, Previous: Special variables, Up: Internals [Contents][Index]
name.
Next: Conditions, Previous: Ordinary functions, Up: Internals [Contents][Index]
file.
Next: Structures, Previous: Generic functions, Up: Internals [Contents][Index]
Previous: Definitions, Up: The py-configparser Reference Manual [Contents][Index]
Jump to: | %
(
A C D E F G H I L M N O R S W |
---|
Jump to: | %
(
A C D E F G H I L M N O R S W |
---|
Next: Data types, Previous: Functions, Up: Indexes [Contents][Index]
Jump to: | *
D F L M N O S |
---|
Jump to: | *
D F L M N O S |
---|
Jump to: | C D F I M N P S |
---|
Jump to: | C D F I M N P S |
---|