iro/offer/smstrade.py
branchdevel
changeset 255 507f6f4186d8
parent 253 e8d56537c9cc
child 256 530d6283c0e3
equal deleted inserted replaced
254:de301b8c58d9 255:507f6f4186d8
    78 
    78 
    79     smstrade API documentation:  http://kundencenter.smstrade.de/sites/smstrade.de.kundencenter/__pdf/SMS-Gateway_HTTP_API_v2.pdf
    79     smstrade API documentation:  http://kundencenter.smstrade.de/sites/smstrade.de.kundencenter/__pdf/SMS-Gateway_HTTP_API_v2.pdf
    80 
    80 
    81     The smstrade API supports a debug mode, that can be set  with :attr:`~iro.offer.provider.Provider.testmode`.
    81     The smstrade API supports a debug mode, that can be set  with :attr:`~iro.offer.provider.Provider.testmode`.
    82     """
    82     """
    83     params= {"debug":("boolean",False),
    83     _params= {"debug":("boolean",False),
    84             "concat_sms":('boolean',False),
    84             "concat_sms":('boolean',False),
    85             "message_id":('boolean',False),
    85             "message_id":('boolean',False),
    86             "count":('boolean',False),
    86             "count":('boolean',False),
    87             "cost":('boolean',False),
    87             "cost":('boolean',False),
    88            }
    88            }
   154             length += sms.content.count(s)
   154             length += sms.content.count(s)
   155         parameters["concat_sms"] = True if length > 160 else False
   155         parameters["concat_sms"] = True if length > 160 else False
   156 
   156 
   157         ps={}
   157         ps={}
   158         for p in parameters:
   158         for p in parameters:
   159             if p in self.params.keys():
   159             if p in self._params.keys():
   160                 if self.params[p][0] == "boolean":
   160                 if self._params[p][0] == "boolean":
   161                     if parameters[p] != self.params[p][1]:
   161                     if parameters[p] != self._params[p][1]:
   162                         ps[p]=int(bool(parameters[p]))
   162                         ps[p]=int(bool(parameters[p]))
   163             else:
   163             else:
   164                 ps[p] = parameters[p]
   164                 ps[p] = parameters[p]
   165 
   165 
   166         params = urllib.urlencode(ps)
   166         params = urllib.urlencode(ps)