iro.view: adding docstrings devel
authorSandro Knauß <knauss@netzguerilla.net>
Thu, 29 Mar 2012 18:44:28 +0200
branchdevel
changeset 265 f6c906b40cce
parent 264 584b9c97ecfd
child 266 a0adcb788fec
iro.view: adding docstrings
iro/view/xmlrpc.py
iro/view/xmlrpc_old.py
--- a/iro/view/xmlrpc.py	Thu Mar 29 18:31:53 2012 +0200
+++ b/iro/view/xmlrpc.py	Thu Mar 29 18:44:28 2012 +0200
@@ -17,6 +17,7 @@
 from ..error import InterfaceException, ValidateException
 
 class TwistedInterface(Interface):
+    """Class that addes needed function for XML-RPC/SOAP"""
     def __init__(self):
         Interface.__init__(self)
 
@@ -28,13 +29,12 @@
   
 
     def listProcedures(self):
-        """Since we override lookupProcedure, its suggested to override
-        listProcedures too.
-        """
+        """returns a list of all functions that are allowed to call via XML-RPC."""
         return ['listMethods','status','sms','fax','mail','routes','defaultRoute','bill','telnumber','email']
 
 
 class XMLRPCInterface(TwistedInterface,xmlrpc.XMLRPC): 
+    """XML-RPC interface"""
     def __init__(self):
         xmlrpc.XMLRPC.__init__(self) 
         TwistedInterface.__init__(self)
@@ -58,19 +58,12 @@
 
 
 class SOAPInterface(TwistedInterface,soap.SOAPPublisher): 
+    """SOAP interface"""
     def __init__(self):
         soap.SOAPPublisher.__init__(self) 
         TwistedInterface.__init__(self)
         
     def lookupFunction(self, functionName):
-        """Lookup published SOAP function.
-
-        Override in subclasses. Default behaviour - publish methods
-        starting with soap_, if they have true attribute useKeywords
-        they are expected to accept keywords.
-        
-        @return: tuple (callable, useKeywords), or (None, None) if not found.
-        """
         if functionName in self.listProcedures():
             function = getattr(self, functionName, None)
             if function:
@@ -80,6 +73,7 @@
             return None
 
 def appendResource(root):
+    """adding XML-RPC and SOAP to root."""
     root.putChild('RPC2', XMLRPCInterface())
     root.putChild('SOAP', SOAPInterface())
     return root
--- a/iro/view/xmlrpc_old.py	Thu Mar 29 18:31:53 2012 +0200
+++ b/iro/view/xmlrpc_old.py	Thu Mar 29 18:44:28 2012 +0200
@@ -10,6 +10,9 @@
 
 #You should have received a copy of the GNU General Public License
 #along with this program; if not, see <http://www.gnu.org/licenses/>.
+
+""".. deprecated:: 1.0a"""
+
 import logging
 logger=logging.getLogger("iro.user")
 class NotSupportedFeature (Exception):