File tree Expand file tree Collapse file tree 3 files changed +43
-6
lines changed
Expand file tree Collapse file tree 3 files changed +43
-6
lines changed Original file line number Diff line number Diff line change 3232 Type ,
3333 cast ,
3434)
35- from colour .utilities import is_string , optional
35+ from colour .utilities import as_bool , is_string , optional
3636
3737__author__ = "Colour Developers"
3838__copyright__ = "Copyright 2013 Colour Developers"
@@ -392,7 +392,38 @@ def filter_warnings(
392392
393393
394394# Defaulting to filter *Colour* runtime warnings.
395- filter_warnings (colour_runtime_warnings = True )
395+ filter_warnings (
396+ colour_runtime_warnings = as_bool (
397+ os .environ .get ("COLOUR_SCIENCE__FILTER_RUNTIME_WARNINGS" , "True" )
398+ )
399+ )
400+
401+ if (
402+ os .environ .get ("COLOUR_SCIENCE__FILTER_USAGE_WARNINGS" ) is not None
403+ ): # pragma: no cover
404+ filter_warnings (
405+ colour_usage_warnings = as_bool (
406+ os .environ ["COLOUR_SCIENCE__FILTER_USAGE_WARNINGS" ]
407+ )
408+ )
409+
410+ if (
411+ os .environ .get ("COLOUR_SCIENCE__FILTER_COLOUR_WARNINGS" ) is not None
412+ ): # pragma: no cover
413+ filter_warnings (
414+ colour_usage_warnings = as_bool (
415+ os .environ ["COLOUR_SCIENCE__FILTER_WARNINGS" ],
416+ )
417+ )
418+
419+ if (
420+ os .environ .get ("COLOUR_SCIENCE__FILTER_PYTHON_WARNINGS" ) is not None
421+ ): # pragma: no cover
422+ filter_warnings (
423+ colour_usage_warnings = as_bool (
424+ os .environ ["COLOUR_SCIENCE__FILTER_PYTHON_WARNINGS" ]
425+ )
426+ )
396427
397428
398429@contextmanager
Original file line number Diff line number Diff line change 1- Advanced Concepts
2- =================
1+ Advanced Usage
2+ ==============
33
44This page describes some advanced usage scenarios of **Colour **.
55
@@ -29,6 +29,12 @@ runtime:
2929 :func: `warnings.showwarning ` definition to be replaced with the
3030 :func: `colour.utilities.show_warning ` definition and thus providing
3131 complete traceback from the point where the warning occurred.
32+ - ``COLOUR_SCIENCE__FILTER_RUNTIME_WARNINGS ``: Filter *Colour * runtime
33+ warnings.
34+ - ``COLOUR_SCIENCE__FILTER_USAGE_WARNINGS ``: Filter *Colour * usage warnings.
35+ - ``COLOUR_SCIENCE__FILTER_COLOUR_WARNINGS ``: Filter *Colour * warnings, this
36+ also filters *Colour * usage and runtime warnings.
37+ - ``COLOUR_SCIENCE__FILTER_PYTHON_WARNINGS ``: Filter *Python * warnings.
3238
3339JEnv File
3440---------
Original file line number Diff line number Diff line change 1- Basic Concepts
2- ==============
1+ Basic Usage
2+ ===========
33
44This page puts an emphasis on basic concepts of **Colour **, those are important
55to understand.
You can’t perform that action at this time.
0 commit comments