aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKat <katerinab@gmail.com>2013-04-05 17:06:30 +0200
committerKat <katerinab@gmail.com>2013-04-05 17:08:28 +0200
commita8ee6bb97bc0987c93abddcd092d0d4a48bbe5cf (patch)
treea099a14a94b21becb71c30bb4b040194712bd9fb
parenta7185c6c7218e589bc54ddc56fc5aa6bfdb74812 (diff)
Documentation: added a README, more docstrings; +x'd setup.py
-rw-r--r--README27
-rwxr-xr-xosmopy/obscvty.py12
-rwxr-xr-x[-rw-r--r--]setup.py0
3 files changed, 39 insertions, 0 deletions
diff --git a/README b/README
new file mode 100644
index 0000000..c4b7830
--- /dev/null
+++ b/README
@@ -0,0 +1,27 @@
+Building/installation:
+sudo python setup.py install
+If you prefer to have it cleanly removable, install checkinstall and run
+sudo checkinstall python setup.py install
+
+Use
+There are currently 3 scripts in this package:
+osmodumpdoc.py - dump documentation (the VTY's "show online-help").
+osmotestconfig.py - test that apps start/write with example configs
+osmotestvty.py - test vty operations (currently, tests very few)
+
+Each of these scripts imports a project-specific osmoappdesc.py,
+which provides information about the available apps, configs, vty ports, etc.
+
+Run the scripts with osmoappdesc.py in the current directory (preferred)
+or with -p <the directory containing osmoappdesc.py>.
+Remember that osmoappdesc.py may contain relative paths.
+
+Example:
+After install osmodumpdoc for openbsc's apps can be run by:
+cd <your_source_dir>/openbsc/openbsc && osmodumpdoc.py
+
+Libraries:
+osmopy/obscvty.py - connect to a vty, run commands on it, see the result
+osmopy/osmoutil.py - code that's shared between the scripts
+
+obscvty.py may be of general use. osmoutil.py probably isn't.
diff --git a/osmopy/obscvty.py b/osmopy/obscvty.py
index b402cfe..33b9ab1 100755
--- a/osmopy/obscvty.py
+++ b/osmopy/obscvty.py
@@ -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):
self.name = name
self.host = host
@@ -72,6 +83,7 @@ class VTYInteract(object):
self.command("enable")
"""Run a command on the vty"""
+
def command(self, request, close=False):
return self._common_command(request, close)
diff --git a/setup.py b/setup.py
index 44e7fd1..44e7fd1 100644..100755
--- a/setup.py
+++ b/setup.py