From: Stas Shtin Date: Sun, 18 Apr 2010 20:51:47 +0000 (+0400) Subject: Added some comments X-Git-Url: http://git.maemo.org/git/?p=ipypbx;a=commitdiff_plain;h=078fcb9a2c142830faa431f1805a99789d19ee7f Added some comments --- diff --git a/src/ipypbx/http.py b/src/ipypbx/http.py index b470c4b..285c4ec 100644 --- a/src/ipypbx/http.py +++ b/src/ipypbx/http.py @@ -235,6 +235,9 @@ class FreeswitchConfigGenerator(object): database = property(database) def canHandle(self, params): + """ + Check if this generator can handle a request from freeswitch. + """ for key, value in self.param_match.iteritems(): if params.get(key, None) != value: return False @@ -253,6 +256,9 @@ class FreeswitchConfigGenerator(object): @staticmethod def addParams(parent_elt, params): + """ + Create params element based on data passed in a list. + """ for name, value in params: etree.SubElement( parent_elt, 'param', name=name, value=str(value)) @@ -285,6 +291,7 @@ class SofiaConfGenerator(FreeswitchConfigGenerator): from ipypbxweb_sipprofile where connection_id = %i ''' % self.parent.connection_id) while profiles_query.next(): + # Create profile element. profile_id, _ok = profiles_query.value(0).toInt() profile_elt = etree.SubElement( profiles_elt, 'profile', @@ -334,6 +341,7 @@ class SofiaConfGenerator(FreeswitchConfigGenerator): from ipypbxweb_gateway where sip_profile_id = %i ''' % profile_id) while gateways_query.next(): + # Create gateway element. gateway_elt = etree.SubElement( gateways_elt, 'gateway', name=gateways_query.value(0).toString()) retry_seconds, _ok = gateways_query.value(5).toInt()