Skip to content

Commit 5650de5

Browse files
committed
Cleanup documentation based on automated Gemini CLI review
1 parent 54b9388 commit 5650de5

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

docs/mixins/mixin_template.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@ reasons:
7878
- The `cmd.Cmd.__init__()` method in the python standard library does not call `super().__init__()`.
7979
Because of this oversight, if you don't inherit from `MyMixin` first, the `MyMixin.__init__()`
8080
method will never be called.
81-
- You may want your mixin to be able to override methods from `cmd2.Cmd`. If you mixin the plugin
82-
after `cmd2.Cmd`, the python method resolution order will call `cmd2.Cmd` methods before it calls
83-
those in your plugin.
81+
- You may want your mixin to be able to override methods from `cmd2.Cmd`. If you mixin the mixin
82+
class after `cmd2.Cmd`, the python method resolution order will call `cmd2.Cmd` methods before it
83+
calls those in your mixin.
8484

8585
### Add commands
8686

@@ -95,7 +95,7 @@ class MyMixin:
9595
self.poutput(statement)
9696
```
9797

98-
You have all the same capabilities within the plugin that you do inside a `cmd2.Cmd` app, including
98+
You have all the same capabilities within the mixin that you do inside a `cmd2.Cmd` app, including
9999
argument parsing via decorators and custom help methods.
100100

101101
### Add (or hide) settings
@@ -123,8 +123,8 @@ their own commands.
123123

124124
Your mixin can override core `cmd2.Cmd` methods, changing their behavior. This approach should be
125125
used sparingly, because it is very brittle. If a developer chooses to use multiple mixins in their
126-
application, and several of the mixins override the same method, only the first plugin to be mixed
127-
in will have the overridden method called.
126+
application, and several of the mixins override the same method, only the first mixin to be mixed in
127+
will have the overridden method called.
128128

129129
Hooks are a much better approach.
130130

@@ -148,7 +148,7 @@ class MyMixin:
148148
super().__init__(*args, **kwargs)
149149
# code placed here runs after cmd2 initializes
150150
# this is where you register any hook functions
151-
self.register_postparsing_hook(self.cmd2_myplugin_postparsing_hook)
151+
self.register_postparsing_hook(self.cmd2_mymixin_postparsing_hook)
152152

153153
def cmd2_mymixin_postparsing_hook(self, data: cmd2.plugin.PostparsingData) -> cmd2.plugin.PostparsingData:
154154
"""Method to be called after parsing user input, but before running the command"""

0 commit comments

Comments
 (0)