diff options
author | Guido Günther <agx@sigxcpu.org> | 2011-12-27 00:51:25 +0100 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2011-12-27 11:19:47 +0100 |
commit | 98be3a205405a97954cda18926a2a8d366bfb1e3 (patch) | |
tree | 11500de67107dd48a3a20de8cd92d0eb19164844 /src/ppm/providerdb.py | |
parent | 1448c4de0cdebfe68f538da2ea28b81a564e86f5 (diff) |
Fetch length top-up code attribute from providerdb if available
Diffstat (limited to 'src/ppm/providerdb.py')
-rw-r--r-- | src/ppm/providerdb.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/ppm/providerdb.py b/src/ppm/providerdb.py index db2bdc9..e2b097d 100644 --- a/src/ppm/providerdb.py +++ b/src/ppm/providerdb.py @@ -90,7 +90,13 @@ class ProviderDB(object): if t.tag == 'ussd': sequence = t.text replacement = t.attrib['replacement'] - provider.add_top_up_cmd({'ussd': [sequence, replacement]}) + try: + length = int(t.attrib['length']) + except KeyError: + length = 0 + provider.add_top_up_cmd({'ussd': [sequence, + replacement, + length]}) if t.tag == 'sms': number = t.text text = t.attrib['text'] |