Giter Club home page Giter Club logo

Comments (8)

lipkau avatar lipkau commented on July 21, 2024

Hello.

I like your ideas.
Would gladly incorporate that into the module and release it as a new major version

Unfortunately, I do not have enough time for now.
If you are willing to help, just send me a PR.

from psini.

majkinetor avatar majkinetor commented on July 21, 2024

If this gets incorporated it should be optional, as it will break stuff.

Multiline Values

The INI file format does not support multiline values. This behavior if implemented should be non default as it breaks exiting scripts, for example:

[Multiline Values]
chorus=I'm a lumberjack, and I'm okay
    idented_key=I sleep all night and I work all day

Here, idented key will be taken as a part of above key.

Interpolation of values
Moreover, there is the oppurtunity to use environment variables as values.

Env vars are typically used for this. It makes sence to expand env vars, possibly as an option when getting values. The problem here is writting values back - if I read and imediatelly write values all vars would get expanded and removed. WIth behavior like that its almost useless feature. Module will have to write back those env vars if key values containing them were unchanged.

from psini.

wbrandenburger avatar wbrandenburger commented on July 21, 2024

I totally agree, it has to be optional. The described behavior will be a problem, if set as default. I will consider that.

from psini.

majkinetor avatar majkinetor commented on July 21, 2024

In default behavior, I think that highest possible compatibility with Windows API should be the goal as that behavior is what will be expected by most. Anything else can be added as configurable feature or fun parameter. This could also be tested easily.

I personally started using this one but because it wasn't compatible with WIndows API it changed ini files in ways that are not semantically equal to starting ini file. I finially used custom Ini script that calls Windows API Profile functions.

from psini.

lipkau avatar lipkau commented on July 21, 2024

about the multiline:

chorus=I'm a lumberjack, and I'm okay
    idented_key=I sleep all night and I work all day

I found this note

Following the syntax of the language it is designed to work with (Python), to span a node over multiple lines ConfigParser requires a deeper indentation in the lines that follow, instead of the more common backslash + line break (see: configparser — Configuration file parser)

on https://en.wikipedia.org/wiki/INI_file#cite_note-13

from psini.

lipkau avatar lipkau commented on July 21, 2024

@majkinetor

because it wasn't compatible with WIndows API

What part of this module is currently not compatible? :-o

from psini.

majkinetor avatar majkinetor commented on July 21, 2024

Part #50 :) Also trimming of values.

from psini.

lipkau avatar lipkau commented on July 21, 2024

@majkinetor: How would the Windows API handle the examples I created here?

key=value|
key = value|
 key = value|
key = "value"|
key = value |
key = " value "|
key = "  value  "|
key =   "    value    "    |
key = ""value""|

added | to each line to indicate EOL

from psini.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.