Created
May 27, 2015 17:25
-
-
Save jMyles/53065e3611d7d1b86753 to your computer and use it in GitHub Desktop.
theCommApp preview #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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