def help_version(self):
self._report_new_message("Prints the version (hint: %s-%s)" % (constants.__version__, constants.__build__))
+
+ def do_get_polling(self, args):
+ if args:
+ self._report_new_message("No arguments supported")
+ return
+ self._report_new_message("\n".join((
+ "Contacts:", repr(self._conn.session.addressbookStateMachine)
+ )))
+ self._report_new_message("\n".join((
+ "Voicemail:", repr(self._conn.session.voicemailsStateMachine)
+ )))
+ self._report_new_message("\n".join((
+ "Texts:", repr(self._conn.session.textsStateMachine)
+ )))
+
+ def help_get_polling(self):
+ self._report_new_message("Prints the frequency each of the state machines updates")
def timeout(self):
return UpdateStateMachine.INFINITE_PERIOD
+ def __repr__(self):
+ return "NopStateStrategy()"
+
class ConstantStateStrategy(object):
def timeout(self):
return self._timeout
+ def __repr__(self):
+ return "ConstantStateStrategy(timeout=%r)" % self._timeout
+
class GeometricStateStrategy(object):
timeout = self._init + self._current
return timeout
+ def __repr__(self):
+ return "GeometricStateStrategy(init=%r, min=%r, max=%r)" % (
+ self._init, self._min, self._max
+ )
+
class StateMachine(object):
)
)
+ def __repr__(self):
+ return """UpdateStateMachine(
+ name=%r,
+ strategie=%r,
+)""" % (self._name, self._strategies)
+
def set_state_strategy(self, state, strategy):
self._strategies[state] = strategy