@@ -143,7 +143,6 @@ def write_cache(local_fn, data):
143143
144144# matplotlib build options, which can be altered using setup.cfg
145145options = {
146- 'display_status' : True ,
147146 'backend' : None ,
148147 }
149148
@@ -153,9 +152,6 @@ def write_cache(local_fn, data):
153152 config = configparser .ConfigParser ()
154153 config .read (setup_cfg )
155154
156- if config .has_option ('status' , 'suppress' ):
157- options ['display_status' ] = not config .getboolean ("status" , "suppress" )
158-
159155 if config .has_option ('rc_options' , 'backend' ):
160156 options ['backend' ] = config .get ("rc_options" , "backend" )
161157
@@ -168,31 +164,30 @@ def write_cache(local_fn, data):
168164options ['local_freetype' ] = lft or options .get ('local_freetype' , False )
169165
170166
171- # Define the display functions only if display_status is True.
172- if options ['display_status' ]:
173- def print_line (char = '=' ):
174- print (char * 80 )
167+ if '-q' in sys .argv or '--quiet' in sys .argv :
168+ def print_raw (* args , ** kwargs ): pass # Suppress our own output.
169+ else :
170+ print_raw = print
171+
172+
173+ def print_line (char = '=' ):
174+ print_raw (char * 80 )
175+
175176
176- def print_status (package , status ):
177- initial_indent = "%12s: " % package
178- indent = ' ' * 18
179- print (textwrap .fill (str (status ), width = 80 ,
177+ def print_status (package , status ):
178+ initial_indent = "%12s: " % package
179+ indent = ' ' * 18
180+ print_raw (textwrap .fill (str (status ), width = 80 ,
180181 initial_indent = initial_indent ,
181182 subsequent_indent = indent ))
182183
183- def print_message (message ):
184- indent = ' ' * 18 + "* "
185- print (textwrap .fill (str (message ), width = 80 ,
184+
185+ def print_message (message ):
186+ indent = ' ' * 18 + "* "
187+ print_raw (textwrap .fill (str (message ), width = 80 ,
186188 initial_indent = indent ,
187189 subsequent_indent = indent ))
188190
189- def print_raw (section ):
190- print (section )
191- else :
192- def print_line (* args , ** kwargs ):
193- pass
194- print_status = print_message = print_raw = print_line
195-
196191
197192def get_buffer_hash (fd ):
198193 BLOCKSIZE = 1 << 16
0 commit comments