diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2021-09-13 15:58:16 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2021-09-14 16:00:54 +0200 |
commit | 51213a3b4db577a92f24b53f72cbfeb27c3ccbbe (patch) | |
tree | 22452fdab0130679405ff44e84a02dcdf955b776 | |
parent | spec: Specify register block specification (diff) | |
download | rtems-central-51213a3b4db577a92f24b53f72cbfeb27c3ccbbe.tar.bz2 |
content: Add default for optional parameters
-rw-r--r-- | rtemsspec/content.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/rtemsspec/content.py b/rtemsspec/content.py index 98cb5ebe..5d6711ce 100644 --- a/rtemsspec/content.py +++ b/rtemsspec/content.py @@ -920,28 +920,31 @@ class CContent(Content): self.add("}") @contextmanager - def condition(self, expression: Optional[str]) -> Iterator[None]: + def condition(self, expression: Optional[str] = None) -> Iterator[None]: """ Opens a condition context. """ self.open_condition(expression) yield self.close_condition() @contextmanager - def first_condition(self, expression: Optional[str]) -> Iterator[None]: + def first_condition(self, + expression: Optional[str] = None) -> Iterator[None]: """ Opens the first condition context. """ self.open_condition(expression, False) yield self.pop_indent() @contextmanager - def next_condition(self, expression: Optional[str]) -> Iterator[None]: + def next_condition(self, + expression: Optional[str] = None) -> Iterator[None]: """ Opens the next condition context. """ self.open_condition(expression, True) yield self.pop_indent() @contextmanager - def final_condition(self, expression: Optional[str]) -> Iterator[None]: + def final_condition(self, + expression: Optional[str] = None) -> Iterator[None]: """ Opens the final condition context. """ self.open_condition(expression, True) yield |