File: Flag.md

package info (click to toggle)
freeipa 4.12.4-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 100,668 kB
  • sloc: python: 298,952; javascript: 71,606; ansic: 49,369; sh: 6,547; makefile: 2,553; xml: 343; sed: 16
file content (37 lines) | stat: -rw-r--r-- 962 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
[//]: # (THE CONTENT BELOW IS GENERATED. DO NOT EDIT.)
.. _Flag:

# Flag
[//]: # (ADD YOUR NOTES BELOW. THESE WILL BE PICKED EVERY TIME THE DOCS ARE REGENERATED. //end)

A boolean parameter that always gets filled in with a default value.

This `Bool` subclass forces ``autofill=True`` in `Flag.__init__()`.  If no
default is provided, it also fills in a default value of ``False``.
Lastly, unlike the `Bool` class, the default must be either ``True`` or
``False`` and cannot be ``None``.

For example:
```
>>> flag = Flag('my_flag')
>>> (flag.autofill, flag.default)
(True, False)
```

To have a default value of ``True``, create your `Flag` intance with
``default=True``.  For example:

```
>>> flag = Flag('my_flag', default=True)
>>> (flag.autofill, flag.default)
(True, True)
```

Also note that creating a `Flag` instance with ``autofill=False`` will have
no effect.  For example:

```
>>> flag = Flag('my_flag', autofill=False)
>>> flag.autofill
True
```