Merge "Add argument to support-matrix sphinx extension"

This commit is contained in:
Jenkins 2016-02-01 14:36:08 +00:00 committed by Gerrit Code Review
commit e5256c32a7
2 changed files with 4 additions and 6 deletions

View File

@ -115,9 +115,8 @@ class SupportMatrixTarget(object):
class SupportMatrixDirective(rst.Directive):
option_spec = {
'support-matrix': six.text_type,
}
# The argument is the filename, e.g. support-matrix.ini
required_arguments = 1
def run(self):
matrix = self._load_support_matrix()
@ -132,8 +131,7 @@ class SupportMatrixDirective(rst.Directive):
cfg = configparser.SafeConfigParser()
env = self.state.document.settings.env
fname = self.options.get("support-matrix",
"support-matrix.ini")
fname = self.arguments[0]
rel_fpath, fpath = env.relfn2path(fname)
with open(fpath) as fp:
cfg.readfp(fp)

View File

@ -39,4 +39,4 @@ following general guiding principles were applied
optional feature becoming mandatory at a later date, based on other
principles above.
.. support_matrix::
.. support_matrix:: support-matrix.ini