Builders for creating attributes et al.
Added in version 1.3.0.
Creates a builder for attr.bool
.
Creates a builder for attr.int
.
Creates a builder for attr.int_list
.
kwargs
– Same as attr.int_list
.
Creates a builder for attr.label
.
Creates a builder for attr.label_keyed_string_dict
.
kwargs
– Same as attr.label_keyed_string_dict
.
Creates a builder for attr.label_list
.
kwargs
– Same as attr.label_list
.
Creates a builder for attr.output
.
kwargs
– Same as attr.output
.
Creates a builder for attr.output_list
.
kwargs
– Same as attr.output_list
.
Creates a builder for attr.string
.
kwargs
– Same as attr.string
.
Creates a builder for attr.string_dict
.
kwargs
– The same args as for attr.string_dict
.
Creates a builder for attr.string_keyed_label_dict
.
kwargs
– Same as attr.string_keyed_label_dict
.
Creates a builder for attr.string_list
.
kwargs
– Same as attr.string_list
.
Creates a builder for attr.string_list_dict
.
kwargs
– Same as attr.string_list_dict
.
Values returned by AttrCfg.which_cfg
Indicates the target config is set.
Indicates the exec config is set.
Indicates the “none” config is set (see config.none
).
Indicates a custom transition is set.
Builder for cfg
arg of label attributes.
Tells which of the cfg modes is set. Will be one of: target, exec, none, or implementation
Tells the exec group to use if an exec transition is being used.
str
| None
the name of the exec group to use if any, or None
if which_cfg
isn’t exec
Tells the custom transition function, if any and applicable.
callable
| None
the custom transition function to use, if any, or None
if a different config mode is being used.
Creates a builder for the attr.cfg
attribute.
inputs
– (list
[Label
] | None
) (default None)
inputs to use for a transition
outputs
– (list
[Label
] | None
) (default None)
outputs to use for a transition
Three different keyword args are supported. The presence of a keyword arg will mark the respective mode returned by which_cfg
.
cfg
: string of either “target” or “exec”
exec_group
: string of an exec group name to use. None means to use regular exec config (i.e. config.exec()
)
implementation
: callable for a custom transition function.
Tells if none cfg (config.none()
) is set.
bool
True if none cfg is set, False if not.
Sets to use an exec transition.
exec_group
– (str
| None
) (default None)
the exec group name to use, if any.
Sets a custom transition function to use.
Sets to use the “none” transition.
Sets to use the target transition.
Tells if target cfg is set.
bool
True if target cfg is set, False if not.
Builder for attr.bool.
Additional kwargs to use when building. This is to allow manipulations that aren’t directly supported by the builder’s API. The state of this dict may or may not reflect prior API calls, and subsequent API calls may modify this dict. The general contract is that modifications to this will be respected when build()
is called, assuming there were no API calls in between.
Builder for attr.int.
Additional kwargs to use when building. This is to allow manipulations that aren’t directly supported by the builder’s API. The state of this dict may or may not reflect prior API calls, and subsequent API calls may modify this dict. The general contract is that modifications to this will be respected when build()
is called, assuming there were no API calls in between.
The returned value is a mutable reference to the underlying list.
Builder for attr.int_list.
Additional kwargs to use when building. This is to allow manipulations that aren’t directly supported by the builder’s API. The state of this dict may or may not reflect prior API calls, and subsequent API calls may modify this dict. The general contract is that modifications to this will be respected when build()
is called, assuming there were no API calls in between.
Creates a builder for attr.int_list
.
kwargs
– Same as attr.int_list
.
Builder for attr.label
objects.
Note that allow_files
is mutually exclusive with allow_single_file
. Only one of the two can have a value set.
Note that allow_single_file
is mutually exclusive with allow_files
. Only one of the two can have a value set.
The returned list is a mutable reference to the underlying list.
Additional kwargs to use when building. This is to allow manipulations that aren’t directly supported by the builder’s API. The state of this dict may or may not reflect prior API calls, and subsequent API calls may modify this dict. The general contract is that modifications to this will be respected when build()
is called, assuming there were no API calls in between.
The returned list is a mutable reference to the underlying list.
Adds allowed file extensions
NOTE: Add an allowed file extension unsets allow_single_file
Creates a builder for attr.label
.
Set the allow_files arg
NOTE: Setting allow_files
unsets allow_single_file
Builder for attr.label_keyed_string_dict.
The returned list is a mutable reference to the underlying list.
Additional kwargs to use when building. This is to allow manipulations that aren’t directly supported by the builder’s API. The state of this dict may or may not reflect prior API calls, and subsequent API calls may modify this dict. The general contract is that modifications to this will be respected when build()
is called, assuming there were no API calls in between.
Returns a mutable reference to the underlying list.
Adds allowed file extensions
Creates a builder for attr.label_keyed_string_dict
.
kwargs
– Same as attr.label_keyed_string_dict
.
Builder for attr.label_list
Additional kwargs to use when building. This is to allow manipulations that aren’t directly supported by the builder’s API. The state of this dict may or may not reflect prior API calls, and subsequent API calls may modify this dict. The general contract is that modifications to this will be respected when build()
is called, assuming there were no API calls in between.
Creates a builder for attr.label_list
.
kwargs
– Same as attr.label_list
.
Builder for attr.output
Additional kwargs to use when building. This is to allow manipulations that aren’t directly supported by the builder’s API. The state of this dict may or may not reflect prior API calls, and subsequent API calls may modify this dict. The general contract is that modifications to this will be respected when build()
is called, assuming there were no API calls in between.
Creates a builder for attr.output
.
kwargs
– Same as attr.output
.
Builder for attr.output_list
Additional kwargs to use when building. This is to allow manipulations that aren’t directly supported by the builder’s API. The state of this dict may or may not reflect prior API calls, and subsequent API calls may modify this dict. The general contract is that modifications to this will be respected when build()
is called, assuming there were no API calls in between.
Creates a builder for attr.output_list
.
kwargs
– Same as attr.output_list
.
Builder for attr.string
Additional kwargs to use when building. This is to allow manipulations that aren’t directly supported by the builder’s API. The state of this dict may or may not reflect prior API calls, and subsequent API calls may modify this dict. The general contract is that modifications to this will be respected when build()
is called, assuming there were no API calls in between.
Creates a builder for attr.string
.
kwargs
– Same as attr.string
.
Builder for attr.string_dict
Additional kwargs to use when building. This is to allow manipulations that aren’t directly supported by the builder’s API. The state of this dict may or may not reflect prior API calls, and subsequent API calls may modify this dict. The general contract is that modifications to this will be respected when build()
is called, assuming there were no API calls in between.
Creates a builder for attr.string_dict
.
kwargs
– The same args as for attr.string_dict
.
Builder for attr.string_keyed_label_dict.
Additional kwargs to use when building. This is to allow manipulations that aren’t directly supported by the builder’s API. The state of this dict may or may not reflect prior API calls, and subsequent API calls may modify this dict. The general contract is that modifications to this will be respected when build()
is called, assuming there were no API calls in between.
Creates a builder for attr.string_keyed_label_dict
.
kwargs
– Same as attr.string_keyed_label_dict
.
Builder for attr.string_list
Additional kwargs to use when building. This is to allow manipulations that aren’t directly supported by the builder’s API. The state of this dict may or may not reflect prior API calls, and subsequent API calls may modify this dict. The general contract is that modifications to this will be respected when build()
is called, assuming there were no API calls in between.
Creates a builder for attr.string_list
.
kwargs
– Same as attr.string_list
.
Builder for attr.string_list_dict.
Additional kwargs to use when building. This is to allow manipulations that aren’t directly supported by the builder’s API. The state of this dict may or may not reflect prior API calls, and subsequent API calls may modify this dict. The general contract is that modifications to this will be respected when build()
is called, assuming there were no API calls in between.
Creates a builder for attr.string_list_dict
.
kwargs
– Same as attr.string_list_dict
.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4