Updated docstring to use rst format

master
GaboFDC 2016-03-08 10:33:39 -05:00
parent a974c479d2
commit 26ac52644c
5 changed files with 62 additions and 22 deletions

View File

@ -1,8 +1,9 @@
#!/usr/bin/env python2
# vim: set et sw=4:
"""agi
"""
.. module:: agi
:synopsis: This module contains functions and classes to implment AGI scripts in python.
This module contains functions and classes to implment AGI scripts in python.
pyvr
{'agi_callerid' : 'mars.putland.int',
@ -17,6 +18,8 @@ pyvr
'agi_request' : 'pyst',
'agi_type' : 'IAX'}
Specification
-------------
"""
import sys

View File

@ -1,7 +1,14 @@
"""More comprehensive traceback formatting for Python scripts.
"""
.. module:: agitb
:synopsis: More comprehensive traceback formatting for Python scripts.
Example
-------
To enable this module, do:
.. code-block:: python
import asterisk.agitb, asterisk.agi
asterisk.agitb.enable(display = False, logdir = '/var/log/asterisk/')
@ -10,11 +17,11 @@ To enable this module, do:
at the top of your script. The optional arguments to enable() are:
agi - the agi handle to write verbose messages to
display - if true, tracebacks are displayed on the asterisk console
* agi - the agi handle to write verbose messages to
* display - if true, tracebacks are displayed on the asterisk console
(used with the agi option)
logdir - if set, tracebacks are written to files in this directory
context - number of lines of source code to show for each stack frame
* logdir - if set, tracebacks are written to files in this directory
* context - number of lines of source code to show for each stack frame
By default, tracebacks are displayed but not saved, and the context is 5 lines.
@ -27,6 +34,9 @@ for you, call agitb.handler(). The optional argument to handler() is a
If you do not pass anything to handler() it will use sys.exc_info().
This script was adapted from Ka-Ping Yee's cgitb.
Specification
-------------
"""
__author__ = 'Matthew Nicholson'

View File

@ -1,10 +1,16 @@
#!/usr/bin/env python
# vim: set expandtab:
"""
Parse Asterisk configuration files.
.. module:: config
:synopsis: Parse Asterisk configuration files.
This module provides parsing functionality for asterisk config files.
Example
----------
.. code-block:: python
import asterisk.config
import sys
@ -24,6 +30,10 @@ This module provides parsing functionality for asterisk config files.
for item in category.items:
print ' %s = %s' % (item.name, item.value)
Specification
-------------
"""
import sys

View File

@ -1,9 +1,17 @@
#!/usr/bin/env python
# FastAGI service for Asterisk
# Requires modified pyst2 to support reading stdin/out/err
#
# Copyright 2011 VOICE1, LLC
# By: Ben Davis <ben@voice1-dot-me>
"""
.. module:: fastagi
:synopsis: FastAGI service for Asterisk
Requires modified pyst2 to support reading stdin/out/err
Copyright 2011 VOICE1, LLC
By: Ben Davis <ben@voice1-dot-me>
Specification
-------------
"""
import sys
import SocketServer

View File

@ -2,10 +2,16 @@
# vim: set expandtab shiftwidth=4:
"""
Python Interface for Asterisk Manager
.. module:: manager
:synopsis: Python Interface for Asterisk Manager
This module provides a Python API for interfacing with the asterisk manager.
Example
-------
.. code-block:: python
import asterisk.manager
import sys
@ -50,6 +56,9 @@ Remember all header, response, and event names are case sensitive.
Not all manager actions are implmented as of yet, feel free to add them
and submit patches.
Specification
-------------
"""
import sys