Skip to content

Instantly share code, notes, and snippets.

@jMyles
Created May 27, 2015 17:25
Show Gist options
  • Save jMyles/53065e3611d7d1b86753 to your computer and use it in GitHub Desktop.
Save jMyles/53065e3611d7d1b86753 to your computer and use it in GitHub Desktop.
theCommApp preview #1
# The API:
class BirthLine(PhoneLine):
greeting = "Thanks for calling Chelsea and Justin's birth information line."
disposition = [ConferenceHoldingPattern()]
features = [BirthCallBlast]
nobody_home = Voicemail
# Some internals:
if not self.call.ended and self.greeting:
self.say(self.greeting)
for d in self.disposition:
try:
result = d.proceed(self)
if result is NOBODY_HOME:
self.nobody_home()
except AttributeError:
if hasattr(d, 'proceed'):
raise
else:
raise TypeError("A Disposition must expose a 'proceed' method.")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment