Skip to content

Commit 941c7a5

Browse files
committed
Bug 1996759 - Register NullableBooleanType as a regular TYPE_CLASSES r=ahochheiden
Differential Revision: https://phabricator.services.mozilla.com/D270476 UltraBlame original commit: 4c66f5321dfa1848a2b2ace06c2c5fd5b0a5fc35
1 parent 3607176 commit 941c7a5

File tree

2 files changed

+185
-0
lines changed

2 files changed

+185
-0
lines changed

python/mach/mach/config.py

Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,140 @@
441441
)
442442
:
443443

444+
return
445+
"
446+
true
447+
"
448+
if
449+
value
450+
else
451+
"
452+
false
453+
"
454+
class
455+
NullableBooleanType
456+
(
457+
ConfigType
458+
)
459+
:
460+
461+
"
462+
"
463+
"
464+
ConfigType
465+
for
466+
nullable
467+
boolean
468+
:
469+
True
470+
False
471+
or
472+
None
473+
.
474+
"
475+
"
476+
"
477+
478+
staticmethod
479+
480+
def
481+
validate
482+
(
483+
value
484+
)
485+
:
486+
487+
if
488+
value
489+
is
490+
not
491+
None
492+
and
493+
not
494+
isinstance
495+
(
496+
value
497+
bool
498+
)
499+
:
500+
501+
raise
502+
TypeError
503+
(
504+
)
505+
506+
staticmethod
507+
508+
def
509+
from_config
510+
(
511+
config
512+
section
513+
option
514+
)
515+
:
516+
517+
value
518+
=
519+
config
520+
.
521+
get
522+
(
523+
section
524+
option
525+
)
526+
.
527+
lower
528+
(
529+
)
530+
531+
if
532+
value
533+
=
534+
=
535+
"
536+
true
537+
"
538+
:
539+
540+
return
541+
True
542+
543+
elif
544+
value
545+
=
546+
=
547+
"
548+
false
549+
"
550+
:
551+
552+
return
553+
False
554+
555+
return
556+
None
557+
558+
staticmethod
559+
560+
def
561+
to_config
562+
(
563+
value
564+
)
565+
:
566+
567+
if
568+
value
569+
is
570+
None
571+
:
572+
573+
return
574+
"
575+
unknown
576+
"
577+
444578
return
445579
"
446580
true
@@ -605,6 +739,12 @@
605739
:
606740
BooleanType
607741

742+
"
743+
nullable_boolean
744+
"
745+
:
746+
NullableBooleanType
747+
608748
"
609749
int
610750
"

python/mach/mach/settings.py

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,51 @@
184184

185185
False
186186

187+
)
188+
189+
(
190+
191+
"
192+
mach_telemetry
193+
.
194+
is_employee
195+
"
196+
197+
"
198+
nullable_boolean
199+
"
200+
201+
"
202+
Cached
203+
value
204+
for
205+
whether
206+
the
207+
user
208+
is
209+
a
210+
Mozilla
211+
employee
212+
"
213+
214+
"
215+
(
216+
None
217+
=
218+
unknown
219+
True
220+
=
221+
employee
222+
False
223+
=
224+
not
225+
an
226+
employee
227+
)
228+
"
229+
230+
None
231+
187232
)
188233

189234
]

0 commit comments

Comments
 (0)