How to use the psiturk.psiturk_exceptions.AmtServicesWrapperError function in PsiTurk

To help you get started, we’ve selected a few PsiTurk examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github NYUCCL / psiTurk / psiturk / psiturk_exceptions.py View on Github external
super(BadBonusAmountError, self).__init__(**kwargs)
        self.message = 'Bonus must be a number greater than 0. You gave: {}'.format(
            amount)

class BonusReasonMissingError(DoBonusError):
    pass
    
class NoAutoBonusAmountSetError(DoBonusError):
    pass

class AssignmentIdNotFoundInLocalDBError(AmtServicesWrapperError):
    def __init__(self, assignment_id='', **kwargs):
        super(AssignmentIdNotFoundInLocalDBError, self).__init__(**kwargs)
        self.assignment_id = assignment_id
    
class WorkerIdNotFoundInLocalDBError(AmtServicesWrapperError):
    pass
    
class MissingArgumentsError(AmtServicesWrapperError):
    pass
    
class InvalidPsiturkCredentialsError(AmtServicesWrapperError):
    def __init__(self, *args, **kwargs):
        super(InvalidPsiturkCredentialsError, self).__init__(*args, **kwargs)
        self.message = '\n'.join(['*****************************',
            '  Sorry, your psiTurk Credentials are invalid.\n ',
            '  You cannot create ads and hits until you enter valid credentials in ',
            '  the \'psiTurk Access\' section of ~/.psiturkconfig.  You can obtain your',
            '  credentials or sign up at https://www.psiturk.org/login.\n'])
            
class InvalidAWSCredentialsError(AmtServicesWrapperError):
    def __init__(self, *args, **kwargs):
github NYUCCL / psiTurk / psiturk / psiturk_exceptions.py View on Github external
class NoAutoBonusAmountSetError(DoBonusError):
    pass

class AssignmentIdNotFoundInLocalDBError(AmtServicesWrapperError):
    def __init__(self, assignment_id='', **kwargs):
        super(AssignmentIdNotFoundInLocalDBError, self).__init__(**kwargs)
        self.assignment_id = assignment_id
    
class WorkerIdNotFoundInLocalDBError(AmtServicesWrapperError):
    pass
    
class MissingArgumentsError(AmtServicesWrapperError):
    pass
    
class InvalidPsiturkCredentialsError(AmtServicesWrapperError):
    def __init__(self, *args, **kwargs):
        super(InvalidPsiturkCredentialsError, self).__init__(*args, **kwargs)
        self.message = '\n'.join(['*****************************',
            '  Sorry, your psiTurk Credentials are invalid.\n ',
            '  You cannot create ads and hits until you enter valid credentials in ',
            '  the \'psiTurk Access\' section of ~/.psiturkconfig.  You can obtain your',
            '  credentials or sign up at https://www.psiturk.org/login.\n'])
            
class InvalidAWSCredentialsError(AmtServicesWrapperError):
    def __init__(self, *args, **kwargs):
        super(InvalidAWSCredentialsError, self).__init__(*args, **kwargs)
        self.message = '\n'.join(['*****************************',
            '  Sorry, your AWS Credentials are invalid.\n ',
            '  You cannot create ads and hits until you enter valid credentials in ',
            '  the \'AWS Access\' section of ~/.psiturkconfig.  You can obtain your ',
            '  credentials via the Amazon AMT requester website.\n'])
github NYUCCL / psiTurk / psiturk / psiturk_exceptions.py View on Github external
class WorkerIdNotFoundInLocalDBError(AmtServicesWrapperError):
    pass
    
class MissingArgumentsError(AmtServicesWrapperError):
    pass
    
class InvalidPsiturkCredentialsError(AmtServicesWrapperError):
    def __init__(self, *args, **kwargs):
        super(InvalidPsiturkCredentialsError, self).__init__(*args, **kwargs)
        self.message = '\n'.join(['*****************************',
            '  Sorry, your psiTurk Credentials are invalid.\n ',
            '  You cannot create ads and hits until you enter valid credentials in ',
            '  the \'psiTurk Access\' section of ~/.psiturkconfig.  You can obtain your',
            '  credentials or sign up at https://www.psiturk.org/login.\n'])
            
class InvalidAWSCredentialsError(AmtServicesWrapperError):
    def __init__(self, *args, **kwargs):
        super(InvalidAWSCredentialsError, self).__init__(*args, **kwargs)
        self.message = '\n'.join(['*****************************',
            '  Sorry, your AWS Credentials are invalid.\n ',
            '  You cannot create ads and hits until you enter valid credentials in ',
            '  the \'AWS Access\' section of ~/.psiturkconfig.  You can obtain your ',
            '  credentials via the Amazon AMT requester website.\n'])
            
class AdPsiturkOrgError(AmtServicesWrapperError):
    pass

class AdHtmlNotFoundError(AmtServicesWrapperError):
    def __init__(self, *args, **kwargs):
        super(AdHtmlNotFoundError, self).__init__(*args, **kwargs)
        self.message = '\n'.join(['*****************************',
            '  Sorry, there was an error registering ad.',
github NYUCCL / psiTurk / psiturk / psiturk_exceptions.py View on Github external
pass


class BadBonusAmountError(DoBonusError):
    def __init__(self, amount, **kwargs):
        super(BadBonusAmountError, self).__init__(**kwargs)
        self.message = 'Bonus must be a number greater than 0. You gave: {}'.format(
            amount)

class BonusReasonMissingError(DoBonusError):
    pass
    
class NoAutoBonusAmountSetError(DoBonusError):
    pass

class AssignmentIdNotFoundInLocalDBError(AmtServicesWrapperError):
    def __init__(self, assignment_id='', **kwargs):
        super(AssignmentIdNotFoundInLocalDBError, self).__init__(**kwargs)
        self.assignment_id = assignment_id
    
class WorkerIdNotFoundInLocalDBError(AmtServicesWrapperError):
    pass
    
class MissingArgumentsError(AmtServicesWrapperError):
    pass
    
class InvalidPsiturkCredentialsError(AmtServicesWrapperError):
    def __init__(self, *args, **kwargs):
        super(InvalidPsiturkCredentialsError, self).__init__(*args, **kwargs)
        self.message = '\n'.join(['*****************************',
            '  Sorry, your psiTurk Credentials are invalid.\n ',
            '  You cannot create ads and hits until you enter valid credentials in ',
github NYUCCL / psiTurk / psiturk / psiturk_exceptions.py View on Github external
message = 'AWS access keys not set in ~/.psiturkconfig; please enter valid credentials.'
        super(AWSAccessKeysNotSetError, self).__init__(message=message, **kwargs)

class NoMturkConnectionError(AmtServicesException):
    def __init__(self, **kwargs):
        message = 'Sorry, unable to connect to Amazon Mechanical Turk. AWS credentials invalid.'
        super(NoMturkConnectionError, self).__init__(message=message, **kwargs)

####################################################
# AMT Service Wrapper Exceptions
####################################################

class AmtServicesWrapperError(PsiturkException):
    pass

class DoBonusError(AmtServicesWrapperError):
    def __init__(self, assignment_id='', **kwargs):
        super(DoBonusError, self).__init__(**kwargs)
        self.assignment_id = assignment_id


class AssignmentAlreadyBonusedError(DoBonusError):
    pass


class BadBonusAmountError(DoBonusError):
    def __init__(self, amount, **kwargs):
        super(BadBonusAmountError, self).__init__(**kwargs)
        self.message = 'Bonus must be a number greater than 0. You gave: {}'.format(
            amount)

class BonusReasonMissingError(DoBonusError):
github NYUCCL / psiTurk / psiturk / psiturk_exceptions.py View on Github external
'  You cannot create ads and hits until you enter valid credentials in ',
            '  the \'AWS Access\' section of ~/.psiturkconfig.  You can obtain your ',
            '  credentials via the Amazon AMT requester website.\n'])
            
class AdPsiturkOrgError(AmtServicesWrapperError):
    pass

class AdHtmlNotFoundError(AmtServicesWrapperError):
    def __init__(self, *args, **kwargs):
        super(AdHtmlNotFoundError, self).__init__(*args, **kwargs)
        self.message = '\n'.join(['*****************************',
            '  Sorry, there was an error registering ad.',
            '  The file ad.html is required to be in the templates folder',
            '  of your project so that the ad can be served.'])
            
class AdHtmlTooLarge(AmtServicesWrapperError):
    def __init__(self, size_of_ad, *args, **kwargs):
        super(AdHtmlTooLarge, self).__init__(*args, **kwargs)
        self.message = '\n'.join(['*****************************',
                                 '  Sorry, there was an error registering the ad.',
                                 '  Your local ad.html is {} bytes, but the maximum'.format(size_of_ad),
                                 '  template size uploadable to the ad server is',
                                 '  1048576 bytes.' ])
                                 
#################
# API Exceptions
#################
class APIException(PsiturkException):
    pass
github NYUCCL / psiTurk / psiturk / psiturk_exceptions.py View on Github external
'  the \'psiTurk Access\' section of ~/.psiturkconfig.  You can obtain your',
            '  credentials or sign up at https://www.psiturk.org/login.\n'])
            
class InvalidAWSCredentialsError(AmtServicesWrapperError):
    def __init__(self, *args, **kwargs):
        super(InvalidAWSCredentialsError, self).__init__(*args, **kwargs)
        self.message = '\n'.join(['*****************************',
            '  Sorry, your AWS Credentials are invalid.\n ',
            '  You cannot create ads and hits until you enter valid credentials in ',
            '  the \'AWS Access\' section of ~/.psiturkconfig.  You can obtain your ',
            '  credentials via the Amazon AMT requester website.\n'])
            
class AdPsiturkOrgError(AmtServicesWrapperError):
    pass

class AdHtmlNotFoundError(AmtServicesWrapperError):
    def __init__(self, *args, **kwargs):
        super(AdHtmlNotFoundError, self).__init__(*args, **kwargs)
        self.message = '\n'.join(['*****************************',
            '  Sorry, there was an error registering ad.',
            '  The file ad.html is required to be in the templates folder',
            '  of your project so that the ad can be served.'])
            
class AdHtmlTooLarge(AmtServicesWrapperError):
    def __init__(self, size_of_ad, *args, **kwargs):
        super(AdHtmlTooLarge, self).__init__(*args, **kwargs)
        self.message = '\n'.join(['*****************************',
                                 '  Sorry, there was an error registering the ad.',
                                 '  Your local ad.html is {} bytes, but the maximum'.format(size_of_ad),
                                 '  template size uploadable to the ad server is',
                                 '  1048576 bytes.' ])
github NYUCCL / psiTurk / psiturk / psiturk_exceptions.py View on Github external
class BonusReasonMissingError(DoBonusError):
    pass
    
class NoAutoBonusAmountSetError(DoBonusError):
    pass

class AssignmentIdNotFoundInLocalDBError(AmtServicesWrapperError):
    def __init__(self, assignment_id='', **kwargs):
        super(AssignmentIdNotFoundInLocalDBError, self).__init__(**kwargs)
        self.assignment_id = assignment_id
    
class WorkerIdNotFoundInLocalDBError(AmtServicesWrapperError):
    pass
    
class MissingArgumentsError(AmtServicesWrapperError):
    pass
    
class InvalidPsiturkCredentialsError(AmtServicesWrapperError):
    def __init__(self, *args, **kwargs):
        super(InvalidPsiturkCredentialsError, self).__init__(*args, **kwargs)
        self.message = '\n'.join(['*****************************',
            '  Sorry, your psiTurk Credentials are invalid.\n ',
            '  You cannot create ads and hits until you enter valid credentials in ',
            '  the \'psiTurk Access\' section of ~/.psiturkconfig.  You can obtain your',
            '  credentials or sign up at https://www.psiturk.org/login.\n'])
            
class InvalidAWSCredentialsError(AmtServicesWrapperError):
    def __init__(self, *args, **kwargs):
        super(InvalidAWSCredentialsError, self).__init__(*args, **kwargs)
        self.message = '\n'.join(['*****************************',
            '  Sorry, your AWS Credentials are invalid.\n ',
github NYUCCL / psiTurk / psiturk / psiturk_exceptions.py View on Github external
self.message = '\n'.join(['*****************************',
            '  Sorry, your psiTurk Credentials are invalid.\n ',
            '  You cannot create ads and hits until you enter valid credentials in ',
            '  the \'psiTurk Access\' section of ~/.psiturkconfig.  You can obtain your',
            '  credentials or sign up at https://www.psiturk.org/login.\n'])
            
class InvalidAWSCredentialsError(AmtServicesWrapperError):
    def __init__(self, *args, **kwargs):
        super(InvalidAWSCredentialsError, self).__init__(*args, **kwargs)
        self.message = '\n'.join(['*****************************',
            '  Sorry, your AWS Credentials are invalid.\n ',
            '  You cannot create ads and hits until you enter valid credentials in ',
            '  the \'AWS Access\' section of ~/.psiturkconfig.  You can obtain your ',
            '  credentials via the Amazon AMT requester website.\n'])
            
class AdPsiturkOrgError(AmtServicesWrapperError):
    pass

class AdHtmlNotFoundError(AmtServicesWrapperError):
    def __init__(self, *args, **kwargs):
        super(AdHtmlNotFoundError, self).__init__(*args, **kwargs)
        self.message = '\n'.join(['*****************************',
            '  Sorry, there was an error registering ad.',
            '  The file ad.html is required to be in the templates folder',
            '  of your project so that the ad can be served.'])
            
class AdHtmlTooLarge(AmtServicesWrapperError):
    def __init__(self, size_of_ad, *args, **kwargs):
        super(AdHtmlTooLarge, self).__init__(*args, **kwargs)
        self.message = '\n'.join(['*****************************',
                                 '  Sorry, there was an error registering the ad.',
                                 '  Your local ad.html is {} bytes, but the maximum'.format(size_of_ad),