Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Line continuation via indentation #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Line continuation via indentation #11

wants to merge 1 commit into from

Conversation

JustinOhms
Copy link

Not sure if this interest you but I added a small tweak to your iniparser.

Allows long blocks of text or arrays to be cleanly added to an ini file.
If a line begins with empty space (tab, space) it will automatically
be appended to the previous line.

! This assumes that section heads and keys are NOT indented. !

Example ini:

[SectionHead]
key1=value of key 1
my_array=val1,
val2,
val3
long_text=This is some long text
that I need to include
it wraps multiple lines.

The resulting object:

{SectionHead:
{
key1:'value of key 1',
my_array:'val1, val2, val3',
long_text:'This is some long text that I need to include it wraps multiple lines.'
}
}

Allows long blocks of text or arrays to be cleaning added to an ini file.
If a line begins with empty space (tab, space) it will automatically
be appended to the previous line.

! This assumes that section heads and keys are NOT indented. !

Example ini:

[SectionHead]
key1=value of key 1
my_array=val1,
         val2,
	 val3
long_text=This is some long text
          that I need to include
	  it wraps multiple lines.

The resulting object:

{SectionHead:
 {
  key1:'value of key 1',
  my_array:'val1, val2, val3',
  long_text:'This is some long text that I need to include it wraps multiple lines.'
 }
}
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant