Skip to content

Commit

Permalink
Hide underscore functions as commands (#437)
Browse files Browse the repository at this point in the history
  • Loading branch information
TheBurchLog authored Dec 26, 2023
1 parent 2218ffd commit da172c0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ TBD
- Add support to change the Exchange Type for RabbitMQ. Default is 'topic',
but options like 'fanout' can now be supported
- Better handling of Pika errors
- Updated how AutoBrewtils maps functions, and will skip auto marking commands with annotations

3.22.0
------
Expand Down
10 changes: 6 additions & 4 deletions brewtils/auto_decorator.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,12 @@ def updateClientClass(self, client, name=None, version=None):
def addFunctions(self, client):
for func in dir(client):
if callable(getattr(client, func)):
if not func.startswith("_"):
_wrapped = getattr(client, func)

_wrapped = getattr(client, func)
if not hasattr(_wrapped, "_command") and not func.startswith("__"):
# decorators.py will handle all of the markings
_wrapped._command = Command()
if func.startswith("_"):
_wrapped._command = Command(hidden=True)
else:
_wrapped._command = Command()

return client

0 comments on commit da172c0

Please sign in to comment.