Giter Club home page Giter Club logo

confix's Introduction

My GitHub

Top Langs

confix's People

Contributors

giampaolo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

confix's Issues

Allow config files without sections

...because most of the times this is what we want.
The way I imagine this.
With no section:

@register()
class conf:
    foo = 1

With sections:

@register(section='base')
class conf:
    foo = 1

Since this is still super-beta software as a first step it makes sense to remove the current behavior supporting sections.

enforce thread safety

...since we're dealing with global vars (_conf_map) and we change global class objects at runtime (@register) we better add some locks in order to improve thread safety.

Confix cannot be used without a valid config file

I have an application where I want to use a default config specified using confix. I want to override this config only when a config file exists, otherwise I want the specified defaults to be used. If you call parse without a path to a valid config file it will error out. Furthermore, if the result of parsing the config file is anything other than a dictionary, then default values with schemas are not initialised, so I don't see a way to achieve this with the current API.

I think this could be handled with a minor refactor like so: rmca@b4debf0

That way at least the caller can handle the case of a non-existent config in a sensible way, while still being able to continue the initialisation of confix and use it for specifying a default config. Alternatively, the parse() function could be reworked to handle this case, but that seems like it would probably require an API change if backwards compatibility is to be maintained. Thoughts?

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.