Skip to content

Latest commit

 

History

History
110 lines (72 loc) · 3.16 KB

consolecmd.rst

File metadata and controls

110 lines (72 loc) · 3.16 KB

consolecmd

Console Command

Python has a cmd module that makes it easy to embed a command line interpreter in an application. BACpypes extends this interpreter with some commands to assist debugging and runs the interpreter in a separate thread so it does not interfere with the BACpypes core.run functionality.

Functions

console_interrupt(*args)

param args

Classes

__init__(prompt="> ", allow_exec=False)

param string prompt

prompt for commands

param boolean allow_exec

allow non-commands to be executed

run()

Begin execution of the application's main event loop. Place this after the the initialization statements.

do_something(args)

param args

commands

Template of a function implementing a console command.

Commands

help

List an application's console commands:

> help
Documented commands (type help <topic>):
========================================
EOF  buggers  bugin  bugout  exit  gc  help  nothing  shell

gc

Print out garbage collection information:

> gc
Module                         Type                            Count dCount   dRef
bacpypes.object                OptionalProperty                  787      0      0
bacpypes.constructeddata       Element                           651      0      0
bacpypes.object                ReadableProperty                  362      0      0
bacpypes.object                WritableProperty                   44      0      0
__future__                     _Feature                            7      0      0
Queue                          Queue                               2      0      0
bacpypes.pdu                   Address                             2      0      0
bacpypes.udp                   UDPActor                            2      1      4
bacpypes.bvllservice           UDPMultiplexer                      1      0      0
bacpypes.app                   DeviceInfoCache                     1      0      0

Module                         Type                            Count dCount   dRef
bacpypes.udp                   UDPActor                            2      1      4

bugin <name>

Attach a debugger.:

> bugin bacpypes.task.OneShotTask
handler to bacpypes.task.OneShotTask added

bugout <name>

Detach a debugger.:

> bugout bacpypes.task.OneShotTask
handler to bacpypes.task.OneShotTask removed

buggers

Get a list of the available buggers.:

> buggers
no handlers
__main__
bacpypes
bacpypes.apdu
bacpypes.apdu.APCI
...
bacpypes.vlan.Network
bacpypes.vlan.Node

exit

Exit a BACpypes Console application.:

> exit
Exiting...