# Path: pysiriproxy/constants.py
# class ClassNames(Enum):
#     '''The ClassNames class contains properties which define the names of the
#     class names of objects sent between the iPhone and Apple's server.
# 
#     '''
#     AnyObject = "AnyObject"
#     '''The AnyObject property defined the AnyObject object class.'''
# 
#     CancelRequest = "CancelRequest"
#     '''The CancelRequest property defined the CancelRequest object class.'''
# 
#     CancelSpeech = "CancelSpeech"
#     '''The CancelSpeech property defined the CancelSpeech object class.'''
# 
#     ClearContext = "ClearContext"
#     '''The ClearContext property defined the ClearContext object class.'''
# 
#     CommandIgnored = "CommandIgnored"
#     '''The CommandIgnored property defined the CommandIgnored object class.'''
# 
#     CommandFailed = "CommandFailed"
#     '''The CommandFailed property defined the CommandFailed object class.'''
# 
#     FinishSpeech = "FinishSpeech"
#     '''The FinishSpeech property defined the FinishSpeech object class.'''
# 
#     LoadAssistant = "LoadAssistant"
#     '''The LoadAssistant property defined the LoadAssistant object class.'''
# 
#     RequestCompleted = "RequestCompleted"
#     '''The RequestCompleted property defined the RequestCompleted object
#     class.
# 
#     '''
# 
#     SetApplicationContext = "SetApplicationContext"
#     '''The SetApplicationContext property defined the SetApplicationContext
#     object class.
# 
#     '''
# 
#     SetRequestOrigin = "SetRequestOrigin"
#     '''The SetRequestOrigin property defined the SetRequestOrigin object
#     class.
# 
#     '''
# 
#     SetRestrictions = "SetRestrictions"
#     '''The SetRestrictions property defined the SetRestrictions object class.
# 
#     '''
# 
#     SpeechPacket = "SpeechPacket"
#     '''The SpeechPacket property defined the SpeechPacket object class.'''
# 
#     SpeechRecognized = "SpeechRecognized"
#     '''The SpeechRecognized property defined the SpeechRecognized object
#     class.
# 
#     '''
# 
#     StartRequest = "StartRequest"
#     '''The StartRequest property defined the StartRequest object class.'''
# 
#     StartSpeechRequest = "StartSpeechRequest"
#     '''The StartSpeechRequest property defined the StartSpeechRequest
#     object class.
# 
#     '''


import sys
from pysiriproxy.constants import ClassNames
from pyamp.patterns import listProperty


def getObjectClasses(function):
    '''Get the list of object classes that this filter function
    supports.

    * function -- The filter function

    '''
    return getattr(function, _CLASSES_PROP, [])


def objectClassesMatch(function, objectClass):
    '''Determine if the given object class is found in the list
    of object classes for this function.

    * function -- The function
    * objectClass -- The given object classes

    '''
    objectClasses = getObjectClasses(function)
    return objectClasses is None or len(objectClasses) == 0 or \
        objectClass in objectClasses


# Grab a reference to the current module object so we can add
# attributes to it
thisModule = sys.modules[__name__]

# Create class filter decorators for all of the known class names

# Path: pysiriproxy/constants.py
# class ClassNames(Enum):
#     '''The ClassNames class contains properties which define the names of the
#     class names of objects sent between the iPhone and Apple's server.
# 
#     '''
#     AnyObject = "AnyObject"
#     '''The AnyObject property defined the AnyObject object class.'''
# 
#     CancelRequest = "CancelRequest"
#     '''The CancelRequest property defined the CancelRequest object class.'''
# 
#     CancelSpeech = "CancelSpeech"
#     '''The CancelSpeech property defined the CancelSpeech object class.'''
# 
#     ClearContext = "ClearContext"
#     '''The ClearContext property defined the ClearContext object class.'''
# 
#     CommandIgnored = "CommandIgnored"
#     '''The CommandIgnored property defined the CommandIgnored object class.'''
# 
#     CommandFailed = "CommandFailed"
#     '''The CommandFailed property defined the CommandFailed object class.'''
# 
#     FinishSpeech = "FinishSpeech"
#     '''The FinishSpeech property defined the FinishSpeech object class.'''
# 
#     LoadAssistant = "LoadAssistant"
#     '''The LoadAssistant property defined the LoadAssistant object class.'''
# 
#     RequestCompleted = "RequestCompleted"
#     '''The RequestCompleted property defined the RequestCompleted object
#     class.
# 
#     '''
# 
#     SetApplicationContext = "SetApplicationContext"
#     '''The SetApplicationContext property defined the SetApplicationContext
#     object class.
# 
#     '''
# 
#     SetRequestOrigin = "SetRequestOrigin"
#     '''The SetRequestOrigin property defined the SetRequestOrigin object
#     class.
# 
#     '''
# 
#     SetRestrictions = "SetRestrictions"
#     '''The SetRestrictions property defined the SetRestrictions object class.
# 
#     '''
# 
#     SpeechPacket = "SpeechPacket"
#     '''The SpeechPacket property defined the SpeechPacket object class.'''
# 
#     SpeechRecognized = "SpeechRecognized"
#     '''The SpeechRecognized property defined the SpeechRecognized object
#     class.
# 
#     '''
# 
#     StartRequest = "StartRequest"
#     '''The StartRequest property defined the StartRequest object class.'''
# 
#     StartSpeechRequest = "StartSpeechRequest"
#     '''The StartSpeechRequest property defined the StartSpeechRequest
#     object class.
# 
#     '''


# Path: pysiriproxy/plugins/objectClasses.py
import sys
from pysiriproxy.constants import ClassNames
from pyamp.patterns import listProperty



def getObjectClasses(function):
    '''Get the list of object classes that this filter function
    supports.

    * function -- The filter function

    '''
    return getattr(function, _CLASSES_PROP, [])


def objectClassesMatch(function, objectClass):
    '''Determine if the given object class is found in the list
    of object classes for this function.

    * function -- The function
    * objectClass -- The given object classes

    '''
    objectClasses = getObjectClasses(function)
    return objectClasses is None or len(objectClasses) == 0 or \
        objectClass in objectClasses


# Grab a reference to the current module object so we can add
# attributes to it
thisModule = sys.modules[__name__]

# Create class filter decorators for all of the known class names

for className in ClassNames.get():