aboutsummaryrefslogtreecommitdiff
path: root/src/ppm/provider.py
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2011-12-27 00:51:25 +0100
committerGuido Günther <agx@sigxcpu.org>2011-12-27 11:19:47 +0100
commit98be3a205405a97954cda18926a2a8d366bfb1e3 (patch)
tree11500de67107dd48a3a20de8cd92d0eb19164844 /src/ppm/provider.py
parent1448c4de0cdebfe68f538da2ea28b81a564e86f5 (diff)
Fetch length top-up code attribute from providerdb if available
Diffstat (limited to 'src/ppm/provider.py')
-rw-r--r--src/ppm/provider.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/ppm/provider.py b/src/ppm/provider.py
index fbbd911..54bc0fe 100644
--- a/src/ppm/provider.py
+++ b/src/ppm/provider.py
@@ -62,6 +62,17 @@ class Provider(object):
else:
return False
+ def get_top_up_code_length(self):
+ """The length of the topup code"""
+ if self.has_top_up_cmd():
+ return self.top_up_cmds['ussd'][2]
+ else:
+ return 0
+
+ @property
+ def top_up_code_length(self):
+ return self.get_top_up_code_length()
+
def fetch_balance(self, mm, reply_func=None, error_func=None):
if self.has_fetch_balance_cmd():
mm.ussd_initiate (self.fetch_balance_cmds['ussd'],