lockss-pybasic 0.1.0.dev18__tar.gz → 0.1.0.dev19__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: lockss-pybasic
3
- Version: 0.1.0.dev18
3
+ Version: 0.1.0.dev19
4
4
  Summary: Basic Python utilities
5
5
  License: BSD-3-Clause
6
6
  Author: Thib Guicherd-Callin
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "lockss-pybasic"
3
- version = "0.1.0-dev18"
3
+ version = "0.1.0-dev19"
4
4
  description = "Basic Python utilities"
5
5
  authors = [
6
6
  { name = "Thib Guicherd-Callin", email = "thib@cs.stanford.edu" }
@@ -36,4 +36,4 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36
36
  POSSIBILITY OF SUCH DAMAGE.
37
37
  '''.strip()
38
38
 
39
- __version__ = '0.1.0-dev18'
39
+ __version__ = '0.1.0-dev19'
@@ -134,7 +134,7 @@ class BaseCli(Generic[BaseModelT]):
134
134
  else:
135
135
  self._parser.error(f'unknown command; expected one of {', '.join(field_names)}')
136
136
 
137
- def _initialize_rich_argparse(self):
137
+ def _initialize_rich_argparse(self) -> None:
138
138
  for cls in [RichHelpFormatter]:
139
139
  cls.styles.update({
140
140
  'argparse.args': f'bold {cls.styles["argparse.args"]}',
@@ -142,7 +142,12 @@ class BaseCli(Generic[BaseModelT]):
142
142
  'argparse.metavar': f'bold {cls.styles["argparse.metavar"]}',
143
143
  'argparse.prog': f'bold {cls.styles["argparse.prog"]}',
144
144
  })
145
- self._parser.formatter_class = RichHelpFormatter
145
+ def _add_formatter_class(container):
146
+ container.formatter_class = RichHelpFormatter
147
+ if container._subcommands:
148
+ for subcommand in container._subcommands:
149
+ _add_formatter_class(subcommand)
150
+ _add_formatter_class(self._parser)
146
151
 
147
152
 
148
153
  def at_most_one_from_enum(model_cls, values: Dict[str, Any], enum_cls) -> Dict[str, Any]: