Skip to content
This repository was archived by the owner on Feb 5, 2018. It is now read-only.
This repository was archived by the owner on Feb 5, 2018. It is now read-only.

setup configobj valid ranges for config settings #4

Description

@binary1230

discussion from #1

ConfigObj (the library we use for our config files which provides that handy specfile concept) already has a way to indicate a valid range for integers. You can just drop this unit test and instead modify your configspec to read something like:

barcode_salt = integer(default=0, min=0, max=1000000)
barcode_event_id = integer(default=0, min=0, max=255)
barcode_key = string(min=10, max=10)  # min and max refer to length for strings

The length restrictions are strings are from memory, so that might actually have a different syntax. Relatedly, if those config options are required for the plugin to function, you probably don't want default values, since you probably want an exception to be raised if they're not provided.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions