Documentation: added a README, more docstrings; +x'd

This commit is contained in:
Kat 2013-04-05 17:06:30 +02:00
parent a7185c6c72
commit a8ee6bb97b
3 changed files with 39 additions and 0 deletions

README Normal file
View File

@ -0,0 +1,27 @@
sudo python install
If you prefer to have it cleanly removable, install checkinstall and run
sudo checkinstall python install
There are currently 3 scripts in this package: - dump documentation (the VTY's "show online-help"). - test that apps start/write with example configs - test vty operations (currently, tests very few)
Each of these scripts imports a project-specific,
which provides information about the available apps, configs, vty ports, etc.
Run the scripts with in the current directory (preferred)
or with -p <the directory containing>.
Remember that may contain relative paths.
After install osmodumpdoc for openbsc's apps can be run by:
cd <your_source_dir>/openbsc/openbsc &&
osmopy/ - connect to a vty, run commands on it, see the result
osmopy/ - code that's shared between the scripts may be of general use. probably isn't.

View File

@ -18,8 +18,19 @@
import socket
"""VTYInteract: interact with an osmocom vty
Specify a VTY to connect to, and run commands on it.
Connections will be reestablished as necessary.
Methods: __init__, command, enabled_command, verify, w_verify"""
class VTYInteract(object):
"""__init__(self, name, host, port):
name is the name the vty prints for commands, ie OpenBSC
host is the hostname to connect to
port is the port to connect on"""
def __init__(self, name, host, port): = name = host
@ -72,6 +83,7 @@ class VTYInteract(object):
"""Run a command on the vty"""
def command(self, request, close=False):
return self._common_command(request, close)

0 Normal file → Executable file
View File