@@ -33,49 +33,42 @@ create_exception!(colorsaurus, ColorsaurusError, PyException);
3333
3434/// Detects if the terminal is dark or light.
3535#[ pyfunction]
36- #[ pyo3( signature = ( * , timeout=None , require_terminal_on_stdout=false ) ) ]
37- fn color_scheme (
38- timeout : Option < Timeout > ,
39- require_terminal_on_stdout : bool ,
40- ) -> PyResult < ColorScheme > {
41- imp:: color_scheme ( query_options ( timeout, require_terminal_on_stdout) )
36+ #[ pyo3( signature = ( * , timeout=None ) ) ]
37+ fn color_scheme ( timeout : Option < Timeout > ) -> PyResult < ColorScheme > {
38+ imp:: color_scheme ( query_options ( timeout) )
4239 . map ( ColorScheme :: from)
4340 . map_err ( to_py_error)
4441}
4542
4643/// Queries the terminal for it's foreground and background color.
4744#[ pyfunction]
48- #[ pyo3( signature = ( * , timeout=None , require_terminal_on_stdout=false ) ) ]
49- fn color_palette (
50- timeout : Option < Timeout > ,
51- require_terminal_on_stdout : bool ,
52- ) -> PyResult < ColorPalette > {
53- imp:: color_palette ( query_options ( timeout, require_terminal_on_stdout) )
45+ #[ pyo3( signature = ( * , timeout=None ) ) ]
46+ fn color_palette ( timeout : Option < Timeout > ) -> PyResult < ColorPalette > {
47+ imp:: color_palette ( query_options ( timeout) )
5448 . map ( ColorPalette )
5549 . map_err ( to_py_error)
5650}
5751
5852/// Queries the terminal for it's foreground color.
5953#[ pyfunction]
60- #[ pyo3( signature = ( * , timeout=None , require_terminal_on_stdout= false ) ) ]
61- fn foreground_color ( timeout : Option < Timeout > , require_terminal_on_stdout : bool ) -> PyResult < Color > {
62- imp:: foreground_color ( query_options ( timeout, require_terminal_on_stdout ) )
54+ #[ pyo3( signature = ( * , timeout=None ) ) ]
55+ fn foreground_color ( timeout : Option < Timeout > ) -> PyResult < Color > {
56+ imp:: foreground_color ( query_options ( timeout) )
6357 . map ( Color )
6458 . map_err ( to_py_error)
6559}
6660
6761/// Queries the terminal for it's background color.
6862#[ pyfunction]
69- #[ pyo3( signature = ( * , timeout=None , require_terminal_on_stdout= false ) ) ]
70- fn background_color ( timeout : Option < Timeout > , require_terminal_on_stdout : bool ) -> PyResult < Color > {
71- imp:: background_color ( query_options ( timeout, require_terminal_on_stdout ) )
63+ #[ pyo3( signature = ( * , timeout=None ) ) ]
64+ fn background_color ( timeout : Option < Timeout > ) -> PyResult < Color > {
65+ imp:: background_color ( query_options ( timeout) )
7266 . map ( Color )
7367 . map_err ( to_py_error)
7468}
7569
76- fn query_options ( timeout : Option < Timeout > , require_terminal_on_stdout : bool ) -> imp:: QueryOptions {
77- let mut options =
78- imp:: QueryOptions :: default ( ) . with_require_terminal_on_stdout ( require_terminal_on_stdout) ;
70+ fn query_options ( timeout : Option < Timeout > ) -> imp:: QueryOptions {
71+ let mut options = imp:: QueryOptions :: default ( ) ;
7972 options. timeout = timeout. map ( |t| t. 0 ) . unwrap_or ( options. timeout ) ;
8073 options
8174}
0 commit comments