-
Notifications
You must be signed in to change notification settings - Fork 212
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #353 from kellyjonbrazil/dev
Dev v1.22.5
- Loading branch information
Showing
61 changed files
with
7,959 additions
and
434 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,13 +3,15 @@ | |
|
||
# jc.parsers.ini | ||
|
||
jc - JSON Convert `INI` file parser | ||
jc - JSON Convert INI file parser | ||
|
||
Parses standard `INI` files and files containing simple key/value pairs. | ||
Parses standard INI files. | ||
|
||
- Delimiter can be `=` or `:`. Missing values are supported. | ||
- Comment prefix can be `#` or `;`. Comments must be on their own line. | ||
- If duplicate keys are found, only the last value will be used. | ||
- If any section names have the same name as a top-level key, the top-level | ||
key will be overwritten by the section data. | ||
|
||
> Note: Values starting and ending with double or single quotation marks | ||
> will have the marks removed. If you would like to keep the quotation | ||
|
@@ -27,45 +29,47 @@ Usage (module): | |
|
||
Schema: | ||
|
||
ini or key/value document converted to a dictionary - see the configparser | ||
INI document converted to a dictionary - see the python configparser | ||
standard library documentation for more details. | ||
|
||
{ | ||
"key1": string, | ||
"key2": string | ||
"<key1>": string, | ||
"<key2>": string, | ||
"<section1>": { | ||
"<key1>": string, | ||
"<key2>": string | ||
}, | ||
"<section2>": { | ||
"<key1>": string, | ||
"<key2>": string | ||
} | ||
} | ||
|
||
Examples: | ||
|
||
$ cat example.ini | ||
[DEFAULT] | ||
ServerAliveInterval = 45 | ||
Compression = yes | ||
CompressionLevel = 9 | ||
ForwardX11 = yes | ||
foo = fiz | ||
bar = buz | ||
|
||
[bitbucket.org] | ||
User = hg | ||
[section1] | ||
fruit = apple | ||
color = blue | ||
|
||
[topsecret.server.com] | ||
Port = 50022 | ||
ForwardX11 = no | ||
[section2] | ||
fruit = pear | ||
color = green | ||
|
||
$ cat example.ini | jc --ini -p | ||
{ | ||
"bitbucket.org": { | ||
"ServerAliveInterval": "45", | ||
"Compression": "yes", | ||
"CompressionLevel": "9", | ||
"ForwardX11": "yes", | ||
"User": "hg" | ||
"foo": "fiz", | ||
"bar": "buz", | ||
"section1": { | ||
"fruit": "apple", | ||
"color": "blue" | ||
}, | ||
"topsecret.server.com": { | ||
"ServerAliveInterval": "45", | ||
"Compression": "yes", | ||
"CompressionLevel": "9", | ||
"ForwardX11": "no", | ||
"Port": "50022" | ||
"section2": { | ||
"fruit": "pear", | ||
"color": "green" | ||
} | ||
} | ||
|
||
|
@@ -87,9 +91,9 @@ Parameters: | |
|
||
Returns: | ||
|
||
Dictionary representing the ini file | ||
Dictionary representing the INI file. | ||
|
||
### Parser Information | ||
Compatibility: linux, darwin, cygwin, win32, aix, freebsd | ||
|
||
Version 1.8 by Kelly Brazil ([email protected]) | ||
Version 2.0 by Kelly Brazil ([email protected]) |
Oops, something went wrong.