File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -250,7 +250,10 @@ def __init__(self, cmd2_app):
250250 self .cmd_echo = False
251251
252252 def __getattr__ (self , item : str ):
253- """If attribute is a command, return a callable. Otherwise return the attribute."""
253+ """
254+ Provide a way to call application commands via the PyscriptBridge
255+ ex: app.help()
256+ """
254257 func = self ._cmd2_app .cmd_func (item )
255258
256259 if func :
@@ -264,7 +267,8 @@ def wrap_func(args=''):
264267
265268 return wrap_func
266269 else :
267- return getattr (self ._cmd2_app , item )
270+ # item does not refer to a command
271+ raise AttributeError ("'{}' object has no attribute '{}'" .format (self ._cmd2_app .pyscript_name , item ))
268272
269273 def __dir__ (self ):
270274 """Return a custom set of attribute names to match the available commands"""
You can’t perform that action at this time.
0 commit comments