File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11from __future__ import division
2- import sys
2+ import sys , re
33from cbook import iterable , flatten
44from transforms import identity_transform
55import matplotlib .units as units
@@ -484,6 +484,7 @@ def get_aliases(self):
484484 aliases [fullname [4 :]] = name [4 :]
485485 return aliases
486486
487+ _get_valid_values_regex = re .compile (r"\n\s*ACCEPTS:\s*(.*)\n" )
487488 def get_valid_values (self , attr ):
488489 """
489490 get the legal arguments for the setter associated with attr
@@ -505,10 +506,10 @@ def get_valid_values(self, attr):
505506
506507 if docstring .startswith ('alias for ' ):
507508 return None
508- for line in docstring . split ( ' \n ' ):
509- line = line . lstrip ( )
510- if not line . startswith ( 'ACCEPTS:' ): continue
511- return line [ 8 :]. strip ( )
509+
510+ match = self . _get_valid_values_regex . search ( docstring )
511+ if match is not None :
512+ return match . group ( 1 )
512513 return 'unknown'
513514
514515 def get_setters (self ):
You can’t perform that action at this time.
0 commit comments