| |
- Propertied(object)
-
- Interaction
-
- CollectAudio
- CollectDigits
-
- CollectPassword
- Menu
- Option
-
- ExitOn
- SubMenu
- Prompt
-
- AlphaPrompt
- AudioPrompt
- DateTimePrompt
- DigitsPrompt
- NumberPrompt
- TextPrompt
- PromptRunner
- Runner
-
- CollectAudioRunner
- CollectDigitsRunner
-
- CollectPasswordRunner
- MenuRunner
class AlphaPrompt(Prompt) |
|
Prompt that reads alphabetic string as characters |
|
- Method resolution order:
- AlphaPrompt
- Prompt
- Propertied
- object
Methods defined here:
- read(self, agi, escapeDigits)
- Read the audio prompt to the user
Methods inherited from Prompt:
- __init__(self, value, **named)
Data descriptors inherited from Prompt:
- value
- Filename to be read to the user
Methods inherited from Propertied:
- __str__(self)
- Get a friendly representation of the object
- clone(self, **newValues)
- Clone this object, with optional new property values
This method calls the __init__ method of your class with
the current property values of your class. Providing newValues
(a dictionary) overrides property settings with new values.
- getCloneProperties(self)
- Get properties dictionary (key:value) for use in cloning of the instance
By default you get getProperties()' values, with an
attempt made to use the property's name, then the property's
direct "__get__" method.
- toString(self, indentation='', alreadyDone=None, indentString=' ')
- Get a nicely formatted representation of this object
This version assumes that getProperties returns
the list of properties which should be presented,
it recursively calls it's children with greater
indents to get their representations.
indentation -- current string indentation level
alreadyDone -- set of object ids which are already finished
XXX Needs a far better API, likely a stand-alone class
without the automatic inheritance problems here :(
Class methods inherited from Propertied:
- getProperties(cls) from type
- Get the BasicProperty properties for a particular object's class
Data descriptors inherited from Propertied:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
|
class AudioPrompt(Prompt) |
|
Default type of prompt, reads a file |
|
- Method resolution order:
- AudioPrompt
- Prompt
- Propertied
- object
Methods defined here:
- read(self, agi, escapeDigits)
- Read the audio prompt to the user
Methods inherited from Prompt:
- __init__(self, value, **named)
Data descriptors inherited from Prompt:
- value
- Filename to be read to the user
Methods inherited from Propertied:
- __str__(self)
- Get a friendly representation of the object
- clone(self, **newValues)
- Clone this object, with optional new property values
This method calls the __init__ method of your class with
the current property values of your class. Providing newValues
(a dictionary) overrides property settings with new values.
- getCloneProperties(self)
- Get properties dictionary (key:value) for use in cloning of the instance
By default you get getProperties()' values, with an
attempt made to use the property's name, then the property's
direct "__get__" method.
- toString(self, indentation='', alreadyDone=None, indentString=' ')
- Get a nicely formatted representation of this object
This version assumes that getProperties returns
the list of properties which should be presented,
it recursively calls it's children with greater
indents to get their representations.
indentation -- current string indentation level
alreadyDone -- set of object ids which are already finished
XXX Needs a far better API, likely a stand-alone class
without the automatic inheritance problems here :(
Class methods inherited from Propertied:
- getProperties(cls) from type
- Get the BasicProperty properties for a particular object's class
Data descriptors inherited from Propertied:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
|
class CollectAudio(Interaction) |
|
Collects audio file from the user |
|
- Method resolution order:
- CollectAudio
- Interaction
- Propertied
- object
Data descriptors defined here:
- beep
- Whether to play a "beep" sound at beginning of recording
- deleteOnFail
- Whether to delete failed attempts to record a file
- escapeDigits
- Set of digits which escape from recording the file
- filename
- Final filename into which to record the file...
- prompt
- (Set of) prompts to run, can be Prompt instances or filenames
Used by the PromptRunner to produce prompt selections
- silence
- Duration to wait for recording (maximum record time)
- temporaryFile
- Temporary file into which to record the audio before moving to filename
- textPrompt
- Textual prompt describing the option
- timeout
- Duration to wait for recording (maximum record time)
Data and other attributes defined here:
- runnerClass = <class 'starpy.menu.CollectAudioRunner'>
- Audio-collection runner, records user audio to a file on the asterisk server
Methods inherited from Interaction:
- __call__(self, agi, *args, **named)
- Initiate AGI-based interaction with the user
Data descriptors inherited from Interaction:
- maxRepetitions
- Maximum number of times to play before failure
- onFailure
- Optional callback for failure with signature method( result, runner )
- onSuccess
- Optional callback for success with signature method( result, runner )
Data and other attributes inherited from Interaction:
- ALL_DIGITS = '0123456789*#'
Methods inherited from Propertied:
- __init__(self, *arguments, **namedarguments)
- Propertied object initialisation, allows passing in initial values for properties by name
- __str__(self)
- Get a friendly representation of the object
- clone(self, **newValues)
- Clone this object, with optional new property values
This method calls the __init__ method of your class with
the current property values of your class. Providing newValues
(a dictionary) overrides property settings with new values.
- getCloneProperties(self)
- Get properties dictionary (key:value) for use in cloning of the instance
By default you get getProperties()' values, with an
attempt made to use the property's name, then the property's
direct "__get__" method.
- toString(self, indentation='', alreadyDone=None, indentString=' ')
- Get a nicely formatted representation of this object
This version assumes that getProperties returns
the list of properties which should be presented,
it recursively calls it's children with greater
indents to get their representations.
indentation -- current string indentation level
alreadyDone -- set of object ids which are already finished
XXX Needs a far better API, likely a stand-alone class
without the automatic inheritance problems here :(
Class methods inherited from Propertied:
- getProperties(cls) from type
- Get the BasicProperty properties for a particular object's class
Data descriptors inherited from Propertied:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
|
class CollectAudioRunner(Runner) |
|
Audio-collection runner, records user audio to a file on the asterisk server |
|
- Method resolution order:
- CollectAudioRunner
- Runner
- Propertied
- object
Methods defined here:
- __call__(self, *args, **named)
- Begin the AGI processing for the menu
- collectAudio(self)
- We're supposed to record audio from the user with our model's parameters
- moveToFinal(self, result)
- On succesful recording, move temporaryFile to final file
- onAudioCollectFail(self, reason)
- Process failure to record audio
- onAudioCollected(self, result)
- Process the results of collecting the audio
- onReadPrompt(self, result)
- We've finished reading the prompt to the user, check for escape
- readPrompt(self, result=None)
- Begin process of reading audio from the user
Data descriptors defined here:
- escapeDigits
- Set of digits which escape from recording
Methods inherited from Runner:
- promptAsRunner(self, prompt)
- Take set of prompt-compatible objects and produce a PromptRunner for them
- returnError(self, reason)
- Return failure of deferred to our original caller
- returnResult(self, result)
- Return result of deferred to our original caller
Data descriptors inherited from Runner:
- agi
- The AGI instance we use to communicate with the user
- alreadyRepeated
- Number of times we've repeated the message...
- finalDF
- Final deferred we will callback/errback on success/failure
- model
- The data-model that we are presenting to the user (e.g. Menu)
Methods inherited from Propertied:
- __init__(self, *arguments, **namedarguments)
- Propertied object initialisation, allows passing in initial values for properties by name
- __str__(self)
- Get a friendly representation of the object
- clone(self, **newValues)
- Clone this object, with optional new property values
This method calls the __init__ method of your class with
the current property values of your class. Providing newValues
(a dictionary) overrides property settings with new values.
- getCloneProperties(self)
- Get properties dictionary (key:value) for use in cloning of the instance
By default you get getProperties()' values, with an
attempt made to use the property's name, then the property's
direct "__get__" method.
- toString(self, indentation='', alreadyDone=None, indentString=' ')
- Get a nicely formatted representation of this object
This version assumes that getProperties returns
the list of properties which should be presented,
it recursively calls it's children with greater
indents to get their representations.
indentation -- current string indentation level
alreadyDone -- set of object ids which are already finished
XXX Needs a far better API, likely a stand-alone class
without the automatic inheritance problems here :(
Class methods inherited from Propertied:
- getProperties(cls) from type
- Get the BasicProperty properties for a particular object's class
Data descriptors inherited from Propertied:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
|
class CollectDigits(Interaction) |
|
Collects some number of digits (e.g. an extension) from user |
|
- Method resolution order:
- CollectDigits
- Interaction
- Propertied
- object
Data descriptors defined here:
- maxDigits
- Maximum number of digits to collect (only restricted if specified)
- minDigits
- Minimum number of digits to collect (only restricted if specified)
- readBack
- Whether to read the entered value back to the user
- soundFile
- File (name) for the pre-recorded blurb
- tellInvalid
- Whether to tell the user that their selection is unrecognised
- textPrompt
- Textual prompt describing the option
Data and other attributes defined here:
- runnerClass = <class 'starpy.menu.CollectDigitsRunner'>
- User's single interaction to enter a set of digits
Note: Asterisk is hard-coded to use # to exit the entry-mode...
Methods inherited from Interaction:
- __call__(self, agi, *args, **named)
- Initiate AGI-based interaction with the user
Data descriptors inherited from Interaction:
- maxRepetitions
- Maximum number of times to play before failure
- onFailure
- Optional callback for failure with signature method( result, runner )
- onSuccess
- Optional callback for success with signature method( result, runner )
- timeout
- Duration to wait for response before repeating message
Data and other attributes inherited from Interaction:
- ALL_DIGITS = '0123456789*#'
Methods inherited from Propertied:
- __init__(self, *arguments, **namedarguments)
- Propertied object initialisation, allows passing in initial values for properties by name
- __str__(self)
- Get a friendly representation of the object
- clone(self, **newValues)
- Clone this object, with optional new property values
This method calls the __init__ method of your class with
the current property values of your class. Providing newValues
(a dictionary) overrides property settings with new values.
- getCloneProperties(self)
- Get properties dictionary (key:value) for use in cloning of the instance
By default you get getProperties()' values, with an
attempt made to use the property's name, then the property's
direct "__get__" method.
- toString(self, indentation='', alreadyDone=None, indentString=' ')
- Get a nicely formatted representation of this object
This version assumes that getProperties returns
the list of properties which should be presented,
it recursively calls it's children with greater
indents to get their representations.
indentation -- current string indentation level
alreadyDone -- set of object ids which are already finished
XXX Needs a far better API, likely a stand-alone class
without the automatic inheritance problems here :(
Class methods inherited from Propertied:
- getProperties(cls) from type
- Get the BasicProperty properties for a particular object's class
Data descriptors inherited from Propertied:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
|
class CollectDigitsRunner(Runner) |
|
User's single interaction to enter a set of digits
Note: Asterisk is hard-coded to use # to exit the entry-mode... |
|
- Method resolution order:
- CollectDigitsRunner
- Runner
- Propertied
- object
Methods defined here:
- __call__(self, *args, **named)
- Begin the AGI processing for the menu
- onReadDigits(self, (digits, timeout))
- Deal with succesful result from reading digits
- readDigits(self, result=None)
- Begin process of reading digits from the user
- validEntry(self, digits)
- Determine whether given digits are considered a "valid" entry
Methods inherited from Runner:
- promptAsRunner(self, prompt)
- Take set of prompt-compatible objects and produce a PromptRunner for them
- returnError(self, reason)
- Return failure of deferred to our original caller
- returnResult(self, result)
- Return result of deferred to our original caller
Data descriptors inherited from Runner:
- agi
- The AGI instance we use to communicate with the user
- alreadyRepeated
- Number of times we've repeated the message...
- finalDF
- Final deferred we will callback/errback on success/failure
- model
- The data-model that we are presenting to the user (e.g. Menu)
Methods inherited from Propertied:
- __init__(self, *arguments, **namedarguments)
- Propertied object initialisation, allows passing in initial values for properties by name
- __str__(self)
- Get a friendly representation of the object
- clone(self, **newValues)
- Clone this object, with optional new property values
This method calls the __init__ method of your class with
the current property values of your class. Providing newValues
(a dictionary) overrides property settings with new values.
- getCloneProperties(self)
- Get properties dictionary (key:value) for use in cloning of the instance
By default you get getProperties()' values, with an
attempt made to use the property's name, then the property's
direct "__get__" method.
- toString(self, indentation='', alreadyDone=None, indentString=' ')
- Get a nicely formatted representation of this object
This version assumes that getProperties returns
the list of properties which should be presented,
it recursively calls it's children with greater
indents to get their representations.
indentation -- current string indentation level
alreadyDone -- set of object ids which are already finished
XXX Needs a far better API, likely a stand-alone class
without the automatic inheritance problems here :(
Class methods inherited from Propertied:
- getProperties(cls) from type
- Get the BasicProperty properties for a particular object's class
Data descriptors inherited from Propertied:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
|
class CollectPassword(CollectDigits) |
|
Collects some number of password digits from the user |
|
- Method resolution order:
- CollectPassword
- CollectDigits
- Interaction
- Propertied
- object
Data descriptors defined here:
- escapeDigits
- Set of digits which escape from password entry
- soundFile
- File (name) for the pre-recorded blurb
Data and other attributes defined here:
- runnerClass = <class 'starpy.menu.CollectPasswordRunner'>
- Password-runner, checks validity versus expected value
Data descriptors inherited from CollectDigits:
- maxDigits
- Maximum number of digits to collect (only restricted if specified)
- minDigits
- Minimum number of digits to collect (only restricted if specified)
- readBack
- Whether to read the entered value back to the user
- tellInvalid
- Whether to tell the user that their selection is unrecognised
- textPrompt
- Textual prompt describing the option
Methods inherited from Interaction:
- __call__(self, agi, *args, **named)
- Initiate AGI-based interaction with the user
Data descriptors inherited from Interaction:
- maxRepetitions
- Maximum number of times to play before failure
- onFailure
- Optional callback for failure with signature method( result, runner )
- onSuccess
- Optional callback for success with signature method( result, runner )
- timeout
- Duration to wait for response before repeating message
Data and other attributes inherited from Interaction:
- ALL_DIGITS = '0123456789*#'
Methods inherited from Propertied:
- __init__(self, *arguments, **namedarguments)
- Propertied object initialisation, allows passing in initial values for properties by name
- __str__(self)
- Get a friendly representation of the object
- clone(self, **newValues)
- Clone this object, with optional new property values
This method calls the __init__ method of your class with
the current property values of your class. Providing newValues
(a dictionary) overrides property settings with new values.
- getCloneProperties(self)
- Get properties dictionary (key:value) for use in cloning of the instance
By default you get getProperties()' values, with an
attempt made to use the property's name, then the property's
direct "__get__" method.
- toString(self, indentation='', alreadyDone=None, indentString=' ')
- Get a nicely formatted representation of this object
This version assumes that getProperties returns
the list of properties which should be presented,
it recursively calls it's children with greater
indents to get their representations.
indentation -- current string indentation level
alreadyDone -- set of object ids which are already finished
XXX Needs a far better API, likely a stand-alone class
without the automatic inheritance problems here :(
Class methods inherited from Propertied:
- getProperties(cls) from type
- Get the BasicProperty properties for a particular object's class
Data descriptors inherited from Propertied:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
|
class CollectPasswordRunner(CollectDigitsRunner) |
|
Password-runner, checks validity versus expected value |
|
- Method resolution order:
- CollectPasswordRunner
- CollectDigitsRunner
- Runner
- Propertied
- object
Methods defined here:
- __call__(self, expected, *args, **named)
- Begin the AGI processing for the menu
- validEntry(self, digits)
- Determine whether given digits are considered a "valid" entry
Data descriptors defined here:
- expected
- The value expected/required from the user for this run
Methods inherited from CollectDigitsRunner:
- onReadDigits(self, (digits, timeout))
- Deal with succesful result from reading digits
- readDigits(self, result=None)
- Begin process of reading digits from the user
Methods inherited from Runner:
- promptAsRunner(self, prompt)
- Take set of prompt-compatible objects and produce a PromptRunner for them
- returnError(self, reason)
- Return failure of deferred to our original caller
- returnResult(self, result)
- Return result of deferred to our original caller
Data descriptors inherited from Runner:
- agi
- The AGI instance we use to communicate with the user
- alreadyRepeated
- Number of times we've repeated the message...
- finalDF
- Final deferred we will callback/errback on success/failure
- model
- The data-model that we are presenting to the user (e.g. Menu)
Methods inherited from Propertied:
- __init__(self, *arguments, **namedarguments)
- Propertied object initialisation, allows passing in initial values for properties by name
- __str__(self)
- Get a friendly representation of the object
- clone(self, **newValues)
- Clone this object, with optional new property values
This method calls the __init__ method of your class with
the current property values of your class. Providing newValues
(a dictionary) overrides property settings with new values.
- getCloneProperties(self)
- Get properties dictionary (key:value) for use in cloning of the instance
By default you get getProperties()' values, with an
attempt made to use the property's name, then the property's
direct "__get__" method.
- toString(self, indentation='', alreadyDone=None, indentString=' ')
- Get a nicely formatted representation of this object
This version assumes that getProperties returns
the list of properties which should be presented,
it recursively calls it's children with greater
indents to get their representations.
indentation -- current string indentation level
alreadyDone -- set of object ids which are already finished
XXX Needs a far better API, likely a stand-alone class
without the automatic inheritance problems here :(
Class methods inherited from Propertied:
- getProperties(cls) from type
- Get the BasicProperty properties for a particular object's class
Data descriptors inherited from Propertied:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
|
class DateTimePrompt(Prompt) |
|
Prompt that reads a date/time as a date |
|
- Method resolution order:
- DateTimePrompt
- Prompt
- Propertied
- object
Methods defined here:
- read(self, agi, escapeDigits)
- Read the audio prompt to the user
Data descriptors defined here:
- format
- Format in which to read the date to the user
Methods inherited from Prompt:
- __init__(self, value, **named)
Data descriptors inherited from Prompt:
- value
- Filename to be read to the user
Methods inherited from Propertied:
- __str__(self)
- Get a friendly representation of the object
- clone(self, **newValues)
- Clone this object, with optional new property values
This method calls the __init__ method of your class with
the current property values of your class. Providing newValues
(a dictionary) overrides property settings with new values.
- getCloneProperties(self)
- Get properties dictionary (key:value) for use in cloning of the instance
By default you get getProperties()' values, with an
attempt made to use the property's name, then the property's
direct "__get__" method.
- toString(self, indentation='', alreadyDone=None, indentString=' ')
- Get a nicely formatted representation of this object
This version assumes that getProperties returns
the list of properties which should be presented,
it recursively calls it's children with greater
indents to get their representations.
indentation -- current string indentation level
alreadyDone -- set of object ids which are already finished
XXX Needs a far better API, likely a stand-alone class
without the automatic inheritance problems here :(
Class methods inherited from Propertied:
- getProperties(cls) from type
- Get the BasicProperty properties for a particular object's class
Data descriptors inherited from Propertied:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
|
class DigitsPrompt(Prompt) |
|
Prompt that reads a number as digits |
|
- Method resolution order:
- DigitsPrompt
- Prompt
- Propertied
- object
Methods defined here:
- read(self, agi, escapeDigits)
- Read the audio prompt to the user
Methods inherited from Prompt:
- __init__(self, value, **named)
Data descriptors inherited from Prompt:
- value
- Filename to be read to the user
Methods inherited from Propertied:
- __str__(self)
- Get a friendly representation of the object
- clone(self, **newValues)
- Clone this object, with optional new property values
This method calls the __init__ method of your class with
the current property values of your class. Providing newValues
(a dictionary) overrides property settings with new values.
- getCloneProperties(self)
- Get properties dictionary (key:value) for use in cloning of the instance
By default you get getProperties()' values, with an
attempt made to use the property's name, then the property's
direct "__get__" method.
- toString(self, indentation='', alreadyDone=None, indentString=' ')
- Get a nicely formatted representation of this object
This version assumes that getProperties returns
the list of properties which should be presented,
it recursively calls it's children with greater
indents to get their representations.
indentation -- current string indentation level
alreadyDone -- set of object ids which are already finished
XXX Needs a far better API, likely a stand-alone class
without the automatic inheritance problems here :(
Class methods inherited from Propertied:
- getProperties(cls) from type
- Get the BasicProperty properties for a particular object's class
Data descriptors inherited from Propertied:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
|
class ExitOn(Option) |
|
An option which exits from the current menu level |
|
- Method resolution order:
- ExitOn
- Option
- Propertied
- object
Methods defined here:
- __call__(self, pressed, parent)
- Raise a MenuExit error
Data descriptors inherited from Option:
- option
- Keypad values which select this option (list of characters)
Methods inherited from Propertied:
- __init__(self, *arguments, **namedarguments)
- Propertied object initialisation, allows passing in initial values for properties by name
- __str__(self)
- Get a friendly representation of the object
- clone(self, **newValues)
- Clone this object, with optional new property values
This method calls the __init__ method of your class with
the current property values of your class. Providing newValues
(a dictionary) overrides property settings with new values.
- getCloneProperties(self)
- Get properties dictionary (key:value) for use in cloning of the instance
By default you get getProperties()' values, with an
attempt made to use the property's name, then the property's
direct "__get__" method.
- toString(self, indentation='', alreadyDone=None, indentString=' ')
- Get a nicely formatted representation of this object
This version assumes that getProperties returns
the list of properties which should be presented,
it recursively calls it's children with greater
indents to get their representations.
indentation -- current string indentation level
alreadyDone -- set of object ids which are already finished
XXX Needs a far better API, likely a stand-alone class
without the automatic inheritance problems here :(
Class methods inherited from Propertied:
- getProperties(cls) from type
- Get the BasicProperty properties for a particular object's class
Data descriptors inherited from Propertied:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
|
class Interaction(Propertied) |
|
Base class for user-interaction operations |
|
- Method resolution order:
- Interaction
- Propertied
- object
Methods defined here:
- __call__(self, agi, *args, **named)
- Initiate AGI-based interaction with the user
Data descriptors defined here:
- maxRepetitions
- Maximum number of times to play before failure
- onFailure
- Optional callback for failure with signature method( result, runner )
- onSuccess
- Optional callback for success with signature method( result, runner )
- timeout
- Duration to wait for response before repeating message
Data and other attributes defined here:
- ALL_DIGITS = '0123456789*#'
- runnerClass = None
Methods inherited from Propertied:
- __init__(self, *arguments, **namedarguments)
- Propertied object initialisation, allows passing in initial values for properties by name
- __str__(self)
- Get a friendly representation of the object
- clone(self, **newValues)
- Clone this object, with optional new property values
This method calls the __init__ method of your class with
the current property values of your class. Providing newValues
(a dictionary) overrides property settings with new values.
- getCloneProperties(self)
- Get properties dictionary (key:value) for use in cloning of the instance
By default you get getProperties()' values, with an
attempt made to use the property's name, then the property's
direct "__get__" method.
- toString(self, indentation='', alreadyDone=None, indentString=' ')
- Get a nicely formatted representation of this object
This version assumes that getProperties returns
the list of properties which should be presented,
it recursively calls it's children with greater
indents to get their representations.
indentation -- current string indentation level
alreadyDone -- set of object ids which are already finished
XXX Needs a far better API, likely a stand-alone class
without the automatic inheritance problems here :(
Class methods inherited from Propertied:
- getProperties(cls) from type
- Get the BasicProperty properties for a particular object's class
Data descriptors inherited from Propertied:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
|
class Menu(Interaction) |
|
IVR-based menu, returns options selected by the user and keypresses
The Menu holds a collection of Option instances along with a prompt
which presents those options to the user. The menu will attempt to
collect the user's selected option up to maxRepetitions times, playing
the prompt each time.
If tellInvalid is true, will allow any character being pressed to stop
the playback, and will tell the user if the pressed character is not
recognised. Otherwise will simply ignore a pressed character which isn't
part of an Option object's 'option' property.
The menu will chain into callable Options, so that SubMenu and ExitOn can
be used to produce effects such as multi-level menus with options to
return to the parent menu level.
Returns [(option,char(pressedKey))...] for each level of menu explored |
|
- Method resolution order:
- Menu
- Interaction
- Propertied
- object
Data descriptors defined here:
- options
- Set of options the user may select
- prompt
- (Set of) prompts to run, can be Prompt instances or filenames
Used by the PromptRunner to produce prompt selections
- tellInvalid
- Whether to tell the user that their selection is unrecognised
- textPrompt
- Textual prompt describing the option
Data and other attributes defined here:
- INVALID_OPTION_FILE = 'pm-invalid-option'
- runnerClass = <class 'starpy.menu.MenuRunner'>
- User's single interaction with a given menu
Methods inherited from Interaction:
- __call__(self, agi, *args, **named)
- Initiate AGI-based interaction with the user
Data descriptors inherited from Interaction:
- maxRepetitions
- Maximum number of times to play before failure
- onFailure
- Optional callback for failure with signature method( result, runner )
- onSuccess
- Optional callback for success with signature method( result, runner )
- timeout
- Duration to wait for response before repeating message
Data and other attributes inherited from Interaction:
- ALL_DIGITS = '0123456789*#'
Methods inherited from Propertied:
- __init__(self, *arguments, **namedarguments)
- Propertied object initialisation, allows passing in initial values for properties by name
- __str__(self)
- Get a friendly representation of the object
- clone(self, **newValues)
- Clone this object, with optional new property values
This method calls the __init__ method of your class with
the current property values of your class. Providing newValues
(a dictionary) overrides property settings with new values.
- getCloneProperties(self)
- Get properties dictionary (key:value) for use in cloning of the instance
By default you get getProperties()' values, with an
attempt made to use the property's name, then the property's
direct "__get__" method.
- toString(self, indentation='', alreadyDone=None, indentString=' ')
- Get a nicely formatted representation of this object
This version assumes that getProperties returns
the list of properties which should be presented,
it recursively calls it's children with greater
indents to get their representations.
indentation -- current string indentation level
alreadyDone -- set of object ids which are already finished
XXX Needs a far better API, likely a stand-alone class
without the automatic inheritance problems here :(
Class methods inherited from Propertied:
- getProperties(cls) from type
- Get the BasicProperty properties for a particular object's class
Data descriptors inherited from Propertied:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
|
class MenuRunner(Runner) |
|
User's single interaction with a given menu |
|
- Method resolution order:
- MenuRunner
- Runner
- Propertied
- object
Methods defined here:
- __call__(self, *args, **named)
- Begin the AGI processing for the menu
- onReadMenu(self, pressed)
- Deal with succesful result from reading menu
- readMenu(self, result=None)
- Read our menu to the user
Data descriptors defined here:
- escapeDigits
- Set of digits which escape from prompts to choose option
Methods inherited from Runner:
- promptAsRunner(self, prompt)
- Take set of prompt-compatible objects and produce a PromptRunner for them
- returnError(self, reason)
- Return failure of deferred to our original caller
- returnResult(self, result)
- Return result of deferred to our original caller
Data descriptors inherited from Runner:
- agi
- The AGI instance we use to communicate with the user
- alreadyRepeated
- Number of times we've repeated the message...
- finalDF
- Final deferred we will callback/errback on success/failure
- model
- The data-model that we are presenting to the user (e.g. Menu)
Methods inherited from Propertied:
- __init__(self, *arguments, **namedarguments)
- Propertied object initialisation, allows passing in initial values for properties by name
- __str__(self)
- Get a friendly representation of the object
- clone(self, **newValues)
- Clone this object, with optional new property values
This method calls the __init__ method of your class with
the current property values of your class. Providing newValues
(a dictionary) overrides property settings with new values.
- getCloneProperties(self)
- Get properties dictionary (key:value) for use in cloning of the instance
By default you get getProperties()' values, with an
attempt made to use the property's name, then the property's
direct "__get__" method.
- toString(self, indentation='', alreadyDone=None, indentString=' ')
- Get a nicely formatted representation of this object
This version assumes that getProperties returns
the list of properties which should be presented,
it recursively calls it's children with greater
indents to get their representations.
indentation -- current string indentation level
alreadyDone -- set of object ids which are already finished
XXX Needs a far better API, likely a stand-alone class
without the automatic inheritance problems here :(
Class methods inherited from Propertied:
- getProperties(cls) from type
- Get the BasicProperty properties for a particular object's class
Data descriptors inherited from Propertied:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
|
class NumberPrompt(Prompt) |
|
Prompt that reads a number as a number |
|
- Method resolution order:
- NumberPrompt
- Prompt
- Propertied
- object
Methods defined here:
- read(self, agi, escapeDigits)
- Read the audio prompt to the user
Data descriptors defined here:
- value
- Integer numeral to read
Methods inherited from Prompt:
- __init__(self, value, **named)
Methods inherited from Propertied:
- __str__(self)
- Get a friendly representation of the object
- clone(self, **newValues)
- Clone this object, with optional new property values
This method calls the __init__ method of your class with
the current property values of your class. Providing newValues
(a dictionary) overrides property settings with new values.
- getCloneProperties(self)
- Get properties dictionary (key:value) for use in cloning of the instance
By default you get getProperties()' values, with an
attempt made to use the property's name, then the property's
direct "__get__" method.
- toString(self, indentation='', alreadyDone=None, indentString=' ')
- Get a nicely formatted representation of this object
This version assumes that getProperties returns
the list of properties which should be presented,
it recursively calls it's children with greater
indents to get their representations.
indentation -- current string indentation level
alreadyDone -- set of object ids which are already finished
XXX Needs a far better API, likely a stand-alone class
without the automatic inheritance problems here :(
Class methods inherited from Propertied:
- getProperties(cls) from type
- Get the BasicProperty properties for a particular object's class
Data descriptors inherited from Propertied:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
|
class Option(Propertied) |
|
A single menu option that can be chosen by the user |
|
- Method resolution order:
- Option
- Propertied
- object
Data descriptors defined here:
- option
- Keypad values which select this option (list of characters)
Methods inherited from Propertied:
- __init__(self, *arguments, **namedarguments)
- Propertied object initialisation, allows passing in initial values for properties by name
- __str__(self)
- Get a friendly representation of the object
- clone(self, **newValues)
- Clone this object, with optional new property values
This method calls the __init__ method of your class with
the current property values of your class. Providing newValues
(a dictionary) overrides property settings with new values.
- getCloneProperties(self)
- Get properties dictionary (key:value) for use in cloning of the instance
By default you get getProperties()' values, with an
attempt made to use the property's name, then the property's
direct "__get__" method.
- toString(self, indentation='', alreadyDone=None, indentString=' ')
- Get a nicely formatted representation of this object
This version assumes that getProperties returns
the list of properties which should be presented,
it recursively calls it's children with greater
indents to get their representations.
indentation -- current string indentation level
alreadyDone -- set of object ids which are already finished
XXX Needs a far better API, likely a stand-alone class
without the automatic inheritance problems here :(
Class methods inherited from Propertied:
- getProperties(cls) from type
- Get the BasicProperty properties for a particular object's class
Data descriptors inherited from Propertied:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
|
class Prompt(Propertied) |
|
A Prompt to be read to the user |
|
- Method resolution order:
- Prompt
- Propertied
- object
Methods defined here:
- __init__(self, value, **named)
Data descriptors defined here:
- value
- Filename to be read to the user
Methods inherited from Propertied:
- __str__(self)
- Get a friendly representation of the object
- clone(self, **newValues)
- Clone this object, with optional new property values
This method calls the __init__ method of your class with
the current property values of your class. Providing newValues
(a dictionary) overrides property settings with new values.
- getCloneProperties(self)
- Get properties dictionary (key:value) for use in cloning of the instance
By default you get getProperties()' values, with an
attempt made to use the property's name, then the property's
direct "__get__" method.
- toString(self, indentation='', alreadyDone=None, indentString=' ')
- Get a nicely formatted representation of this object
This version assumes that getProperties returns
the list of properties which should be presented,
it recursively calls it's children with greater
indents to get their representations.
indentation -- current string indentation level
alreadyDone -- set of object ids which are already finished
XXX Needs a far better API, likely a stand-alone class
without the automatic inheritance problems here :(
Class methods inherited from Propertied:
- getProperties(cls) from type
- Get the BasicProperty properties for a particular object's class
Data descriptors inherited from Propertied:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
|
class PromptRunner(Propertied) |
|
Prompt formed from list of sub-prompts |
|
- Method resolution order:
- PromptRunner
- Propertied
- object
Methods defined here:
- __call__(self)
- Return a deferred that chains all of the sub-prompts in order
Returns from the first of the sub-prompts that recevies a selection
returns str(digit) for the key the user pressed
- onNext(self, result, index=0)
- Process the next operation
- processKey(self, result)
- Does the pressed key belong to escapeDigits?
- processLast(self, result)
Data descriptors defined here:
- agi
- The FastAGI instance we're controlling
- elements
- Sub-elements of the prompt to be presented
- escapeDigits
- Set of digits which escape from playing the prompt
- timeout
- Timeout on data-entry after completed reading
Methods inherited from Propertied:
- __init__(self, *arguments, **namedarguments)
- Propertied object initialisation, allows passing in initial values for properties by name
- __str__(self)
- Get a friendly representation of the object
- clone(self, **newValues)
- Clone this object, with optional new property values
This method calls the __init__ method of your class with
the current property values of your class. Providing newValues
(a dictionary) overrides property settings with new values.
- getCloneProperties(self)
- Get properties dictionary (key:value) for use in cloning of the instance
By default you get getProperties()' values, with an
attempt made to use the property's name, then the property's
direct "__get__" method.
- toString(self, indentation='', alreadyDone=None, indentString=' ')
- Get a nicely formatted representation of this object
This version assumes that getProperties returns
the list of properties which should be presented,
it recursively calls it's children with greater
indents to get their representations.
indentation -- current string indentation level
alreadyDone -- set of object ids which are already finished
XXX Needs a far better API, likely a stand-alone class
without the automatic inheritance problems here :(
Class methods inherited from Propertied:
- getProperties(cls) from type
- Get the BasicProperty properties for a particular object's class
Data descriptors inherited from Propertied:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
|
class Runner(Propertied) |
|
User's interaction with a given Interaction-type |
|
- Method resolution order:
- Runner
- Propertied
- object
Methods defined here:
- promptAsRunner(self, prompt)
- Take set of prompt-compatible objects and produce a PromptRunner for them
- returnError(self, reason)
- Return failure of deferred to our original caller
- returnResult(self, result)
- Return result of deferred to our original caller
Data descriptors defined here:
- agi
- The AGI instance we use to communicate with the user
- alreadyRepeated
- Number of times we've repeated the message...
- finalDF
- Final deferred we will callback/errback on success/failure
- model
- The data-model that we are presenting to the user (e.g. Menu)
Methods inherited from Propertied:
- __init__(self, *arguments, **namedarguments)
- Propertied object initialisation, allows passing in initial values for properties by name
- __str__(self)
- Get a friendly representation of the object
- clone(self, **newValues)
- Clone this object, with optional new property values
This method calls the __init__ method of your class with
the current property values of your class. Providing newValues
(a dictionary) overrides property settings with new values.
- getCloneProperties(self)
- Get properties dictionary (key:value) for use in cloning of the instance
By default you get getProperties()' values, with an
attempt made to use the property's name, then the property's
direct "__get__" method.
- toString(self, indentation='', alreadyDone=None, indentString=' ')
- Get a nicely formatted representation of this object
This version assumes that getProperties returns
the list of properties which should be presented,
it recursively calls it's children with greater
indents to get their representations.
indentation -- current string indentation level
alreadyDone -- set of object ids which are already finished
XXX Needs a far better API, likely a stand-alone class
without the automatic inheritance problems here :(
Class methods inherited from Propertied:
- getProperties(cls) from type
- Get the BasicProperty properties for a particular object's class
Data descriptors inherited from Propertied:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
|
class SubMenu(Option) |
|
A menu-holding option, just forwards call to the held menu |
|
- Method resolution order:
- SubMenu
- Option
- Propertied
- object
Methods defined here:
- __call__(self, pressed, parent)
- Get result from the sub-menu, add ourselves into the result
Data descriptors defined here:
- menu
- The sub-menu we are presenting to the user
Data descriptors inherited from Option:
- option
- Keypad values which select this option (list of characters)
Methods inherited from Propertied:
- __init__(self, *arguments, **namedarguments)
- Propertied object initialisation, allows passing in initial values for properties by name
- __str__(self)
- Get a friendly representation of the object
- clone(self, **newValues)
- Clone this object, with optional new property values
This method calls the __init__ method of your class with
the current property values of your class. Providing newValues
(a dictionary) overrides property settings with new values.
- getCloneProperties(self)
- Get properties dictionary (key:value) for use in cloning of the instance
By default you get getProperties()' values, with an
attempt made to use the property's name, then the property's
direct "__get__" method.
- toString(self, indentation='', alreadyDone=None, indentString=' ')
- Get a nicely formatted representation of this object
This version assumes that getProperties returns
the list of properties which should be presented,
it recursively calls it's children with greater
indents to get their representations.
indentation -- current string indentation level
alreadyDone -- set of object ids which are already finished
XXX Needs a far better API, likely a stand-alone class
without the automatic inheritance problems here :(
Class methods inherited from Propertied:
- getProperties(cls) from type
- Get the BasicProperty properties for a particular object's class
Data descriptors inherited from Propertied:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
|
class TextPrompt(Prompt) |
|
Prompt produced via festival text-to-speech reader (built-in command) |
|
- Method resolution order:
- TextPrompt
- Prompt
- Propertied
- object
Methods defined here:
- read(self, agi, escapeDigits)
Methods inherited from Prompt:
- __init__(self, value, **named)
Data descriptors inherited from Prompt:
- value
- Filename to be read to the user
Methods inherited from Propertied:
- __str__(self)
- Get a friendly representation of the object
- clone(self, **newValues)
- Clone this object, with optional new property values
This method calls the __init__ method of your class with
the current property values of your class. Providing newValues
(a dictionary) overrides property settings with new values.
- getCloneProperties(self)
- Get properties dictionary (key:value) for use in cloning of the instance
By default you get getProperties()' values, with an
attempt made to use the property's name, then the property's
direct "__get__" method.
- toString(self, indentation='', alreadyDone=None, indentString=' ')
- Get a nicely formatted representation of this object
This version assumes that getProperties returns
the list of properties which should be presented,
it recursively calls it's children with greater
indents to get their representations.
indentation -- current string indentation level
alreadyDone -- set of object ids which are already finished
XXX Needs a far better API, likely a stand-alone class
without the automatic inheritance problems here :(
Class methods inherited from Propertied:
- getProperties(cls) from type
- Get the BasicProperty properties for a particular object's class
Data descriptors inherited from Propertied:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
| |