1818from archey .logos import get_logo_width , lazy_load_logo_module
1919
2020
21- class Output :
21+ class Output : # pylint: disable=too-many-instance-attributes
2222 """
2323 This is the object handling output entries populating.
2424 It also handles the logo choice based on some system detections.
@@ -27,12 +27,12 @@ class Output:
2727 __logo_right_padding = " "
2828
2929 def __init__ (self , ** kwargs ):
30- configuration = Configuration ()
30+ self . configuration = Configuration ()
3131
3232 # Fetches passed arguments.
3333 self ._format_to_json = kwargs .get ("format_to_json" )
3434 preferred_logo_style = (
35- kwargs .get ("preferred_logo_style" ) or configuration .get ("logo_style" ) or ""
35+ kwargs .get ("preferred_logo_style" ) or self . configuration .get ("logo_style" ) or ""
3636 ).upper ()
3737
3838 # If logo shouldn't be displayed, don't load any module and reset right padding
@@ -59,11 +59,11 @@ def __init__(self, **kwargs):
5959
6060 # If `os-release`'s `ANSI_COLOR` option is set, honor it.
6161 ansi_color = Distributions .get_ansi_color ()
62- if ansi_color and configuration .get ("honor_ansi_color" ):
62+ if ansi_color and self . configuration .get ("honor_ansi_color" ):
6363 # Replace each Archey integrated colors by `ANSI_COLOR`.
6464 self ._colors = len (self ._colors ) * [Style .escape_code_from_attrs (ansi_color )]
6565
66- entries_color = configuration .get ("entries_color" )
66+ entries_color = self . configuration .get ("entries_color" )
6767 if entries_color :
6868 self ._entries_color = Style .escape_code_from_attrs (entries_color )
6969 elif self ._colors :
@@ -76,9 +76,9 @@ def __init__(self, **kwargs):
7676 # Each class output will be added in the list below afterwards
7777 self ._results = []
7878
79- def add_entry (self , module : Entry ) -> None :
79+ def add_entry (self , entry : Entry ) -> None :
8080 """Append an entry to the list of entries to output"""
81- self ._entries .append (module )
81+ self ._entries .append (entry )
8282
8383 def append (self , key : str , value ) -> None :
8484 """Append a pre-formatted entry to the final output content"""
@@ -95,7 +95,8 @@ def output(self) -> None:
9595 else :
9696 # Iterate through the entries and run their output method to add their content.
9797 for entry in self ._entries :
98- entry .output (self )
98+ if not self .configuration .get ("hide_undetected" ) or entry :
99+ entry .output (self )
99100 self ._output_text ()
100101
101102 def _output_json (self ) -> None :
0 commit comments