Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a10e0ee

Browse files
committed
FIX: re-instate verbose alias
1 parent ef5d01a commit a10e0ee

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

lib/matplotlib/__init__.py

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -232,13 +232,15 @@ def _is_writable_dir(p):
232232
"""
233233
return os.access(p, os.W_OK) and os.path.isdir(p)
234234

235-
_verbose_msg = """\
235+
_verbose_msg = """
236+
matplotlib.verbose is deprecated;
236237
Command line argument --verbose-LEVEL is deprecated.
237238
This functionality is now provided by the standard
238239
python logging library. To get more (or less) logging output:
239240
import logging
240241
logger = logging.getLogger('matplotlib')
241-
logger.set_level(logging.INFO)"""
242+
logger.set_level(logging.INFO)
243+
"""
242244

243245

244246
def _set_logger_verbose_level(level_str='silent', file_str='sys.stdout'):
@@ -297,7 +299,6 @@ def _parse_commandline():
297299
_parse_commandline()
298300

299301

300-
@cbook.deprecated("2.2", message=_verbose_msg)
301302
class Verbose(object):
302303
"""
303304
A class to handle reporting. Set the fileo attribute to any file
@@ -320,10 +321,12 @@ class Verbose(object):
320321
if level_str in levels:
321322
_commandLineVerbose = level_str
322323

324+
@cbook.deprecated("2.2", message=_verbose_msg)
323325
def __init__(self):
324326
self.set_level('silent')
325327
self.fileo = sys.stdout
326328

329+
@cbook.deprecated("2.2", message=_verbose_msg)
327330
def set_level(self, level):
328331
'set the verbosity to one of the Verbose.levels strings'
329332

@@ -335,6 +338,7 @@ def set_level(self, level):
335338
else:
336339
self.level = level
337340

341+
@cbook.deprecated("2.2", message=_verbose_msg)
338342
def set_fileo(self, fname):
339343
std = {
340344
'sys.stdout': sys.stdout,
@@ -352,6 +356,7 @@ def set_fileo(self, fname):
352356
else:
353357
self.fileo = fileo
354358

359+
@cbook.deprecated("2.2", message=_verbose_msg)
355360
def report(self, s, level='helpful'):
356361
"""
357362
print message s to self.fileo if self.level>=level. Return
@@ -363,6 +368,7 @@ def report(self, s, level='helpful'):
363368
return True
364369
return False
365370

371+
@cbook.deprecated("2.2", message=_verbose_msg)
366372
def wrap(self, fmt, func, level='helpful', always=True):
367373
"""
368374
return a callable function that wraps func and reports it
@@ -386,11 +392,18 @@ def wrapper(*args, **kwargs):
386392
wrapper.__doc__ = func.__doc__
387393
return wrapper
388394

395+
@cbook.deprecated("2.2", message=_verbose_msg)
389396
def ge(self, level):
390397
'return true if self.level is >= level'
391398
return self.vald[self.level] >= self.vald[level]
392399

393400

401+
# define verbose so it can be imported...
402+
with warnings.catch_warnings():
403+
warnings.simplefilter("ignore", mplDeprecation)
404+
verbose = Verbose()
405+
406+
394407
def _wrap(fmt, func, level='DEBUG', always=True):
395408
"""
396409
return a callable function that wraps func and reports its

0 commit comments

Comments
 (0)