Fixable

On this page

Fixable#

class Fixable(trait, default_value=None, unicode=False, range=True, allow_none=True, **kwargs)#

Bases: Union

Fixable parameter, specified in a filename pattern.

A fixable parameter meant to work with filefinder. It can take:

  1. a value of the appropriate type,

  2. a string specifying a range of values, see Range,

  3. a string that will be interpreted as a regular expression to match a filename part,

  4. a list of values (see 1), any of which will be accepted as a valid filename part.

Parameters:
  • trait (TraitType) – Trait instance.

  • default_value (Any) – The default value.

  • unicode (bool) – Allow string values. Default is False as this can be dangerous, any value from command line that cannot be parsed would still be allowed.

  • range (bool) – If trait is Int or Float, allow to transform a string into a range of value using Range.

  • allow_none (bool) – Allow None as a valid value. Default is True.

  • kwargs (Any) – Arguments passed to the Union trait created.

info_text: str = 'a fixable'#