Changeset 99c6449 in rtems-central


Ignore:
Timestamp:
May 9, 2020, 3:45:46 PM (6 months ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
0ee8226
Parents:
2f39499
git-author:
Sebastian Huber <sebastian.huber@…> (05/09/20 15:45:46)
git-committer:
Sebastian Huber <sebastian.huber@…> (05/28/20 08:38:22)
Message:

content: Change gap after indent

Location:
rtemsqual
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • rtemsqual/content.py

    r2f39499 r99c6449  
    154154
    155155    # pylint: disable=too-many-instance-attributes
    156     def __init__(self, the_license):
     156    def __init__(self, the_license: str, pop_indent_gap: bool):
    157157        self._lines = []  # type: List[str]
    158158        self._license = the_license
     
    164164        self._empty_line_indents = [""]
    165165        self._empty_line_indent = ""
     166        self._pop_indent_gap = pop_indent_gap
    166167
    167168    def __str__(self):
     
    236237            empty_line_indent if empty_line_indent else self._tab)
    237238        self._update_indent()
     239        self.gap = False
    238240
    239241    def pop_indent(self) -> None:
     
    242244        self._empty_line_indents.pop()
    243245        self._update_indent()
     246        self.gap = self._pop_indent_gap
    244247
    245248    @contextmanager
     
    289292    """ This class builds Sphinx content. """
    290293    def __init__(self):
    291         super().__init__("CC-BY-SA-4.0")
     294        super().__init__("CC-BY-SA-4.0", True)
    292295        self._tab = "    "
    293296
     
    370373    # pylint: disable=too-many-public-methods
    371374    def __init__(self):
    372         super().__init__("BSD-2-Clause")
     375        super().__init__("BSD-2-Clause", False)
    373376
    374377    def add_spdx_license_identifier(self):
     
    431434        self.add(begin)
    432435        self.push_indent(" * ", " *")
    433         self.gap = False
    434436
    435437    def open_comment_block(self) -> None:
  • rtemsqual/glossary.py

    r2f39499 r99c6449  
    5454    content.add(".. glossary::")
    5555    with content.indent():
    56         content.append(":sorted:")
    57     for item in sorted(terms.values(),
    58                        key=lambda x: x["glossary-term"].lower()):
    59         content.register_license_and_copyrights_of_item(item)
    60         with content.indent():
     56        content.add(":sorted:")
     57        for item in sorted(terms.values(),
     58                           key=lambda x: x["glossary-term"].lower()):
     59            content.register_license_and_copyrights_of_item(item)
    6160            text = SphinxMapper(item).substitute(item["text"])
    6261            content.add_definition_item(item["glossary-term"], text)
  • rtemsqual/tests/test_content.py

    r2f39499 r99c6449  
    3333
    3434def test_append():
    35     content = Content("BSD-2-Clause")
     35    content = Content("BSD-2-Clause", True)
    3636    content.append("")
    3737    assert str(content) == """
     
    5353
    5454def test_prepend():
    55     content = Content("BSD-2-Clause")
     55    content = Content("BSD-2-Clause", True)
    5656    content.prepend("")
    5757    assert str(content) == """
     
    7373
    7474def test_add():
    75     content = Content("BSD-2-Clause")
     75    content = Content("BSD-2-Clause", True)
    7676    content.add("")
    7777    assert str(content) == ""
     
    8888
    8989def test_add_blank_line():
    90     content = Content("BSD-2-Clause")
     90    content = Content("BSD-2-Clause", True)
    9191    content.add_blank_line()
    9292    assert str(content) == """
     
    9595
    9696def test_indent():
    97     content = Content("BSD-2-Clause")
     97    content = Content("BSD-2-Clause", True)
    9898    content.add_blank_line()
    9999    content.append("x")
     
    105105
    106106def test_write(tmpdir):
    107     content = Content("BSD-2-Clause")
     107    content = Content("BSD-2-Clause", True)
    108108    content.append("x")
    109109    path = os.path.join(tmpdir, "x", "y")
  • rtemsqual/validation.py

    r2f39499 r99c6449  
    123123        content.add(action_content)
    124124        content.add(item["test-case-epilogue"])
    125     content.append(["}", "", "/** @} */"])
     125    content.add(["}", "", "/** @} */"])
    126126
    127127
Note: See TracChangeset for help on using the changeset viewer.