Changeset 28b8f50 in rtems-central for rtemsqual/content.py


Ignore:
Timestamp:
Mar 17, 2020, 2:45:40 PM (15 months ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
9144b6b
Parents:
a400958
git-author:
Sebastian Huber <sebastian.huber@…> (03/17/20 14:45:40)
git-committer:
Sebastian Huber <sebastian.huber@…> (03/17/20 15:27:24)
Message:

content: Add helper to accept a string or a list

File:
1 edited

Legend:

Unmodified
Added
Removed
  • rtemsqual/content.py

    ra400958 r28b8f50  
    125125
    126126
     127def _make_list(value):
     128    if not isinstance(value, list):
     129        return [value]
     130    return value
     131
     132
    127133class SphinxContent(object):
    128134    """ This class builds Sphinx content. """
     
    165171        """ Adds a list of index entries the content. """
    166172        first = True
    167         for entry in entries:
     173        for entry in _make_list(entries):
    168174            if first:
    169175                first = False
Note: See TracChangeset for help on using the changeset viewer.