Rebagliati Loris
Rebagliati Loris

Reputation: 579

Configspec in string ConfigObj

I have read that you can pass the configspec as a string and not as a file for the ConfigObj module. The question more than anything is how is the right way? Because I made several attempts, but they are wrong, for sure because I did not understand. More than anything else I need the configspec to check when the data is loaded.

My configspec is this at the moment:

cfs = """
    set default = boolean()
    width = integer(min=800, max=1920)
    height = integer(min=600, max=1080)
    fullscreen = boolean()
    music = integer(min=0, max=100)
    sound = integer(min=0, max=100)
    voice = integer(min=0, max=100)
    ambient = integer(min=0, max=100)
    other audio = integer(min=0, max=100)
    """

In case you do need more information, I shall change my question, adding that information.

Upvotes: 1

Views: 159

Answers (0)

Related Questions