class SetDictionaryValueAction(BaseAction):
    '''Set dictionary value'''
    itype = 'is.workflow.actions.setvalueforkey'
    keyword = 'set_value_for_key'

    key = VariablesField('WFDictionaryKey')
    value = VariablesField('WFDictionaryValue')
예제 #2
0
class NotificationAction(BaseAction):
    '''Show notification'''
    itype = 'is.workflow.actions.notification'
    keyword = 'notification'

    play_sound = BooleanField('WFNotificationActionSound', default=True)
    text = VariablesField('WFNotificationActionBody')
    title = VariablesField('WFNotificationActionTitle')
예제 #3
0
    def test_field_with_variables_with_token_only(self, variable, exp_data):
        f = VariablesField('')

        exp_data = {
            'Value': exp_data,
            'WFSerializationType': 'WFTextTokenAttachment',
        }

        assert f.process_value(variable) == exp_data
예제 #4
0
    def test_field_with_variables(self, variable, exp_data):
        f = VariablesField('')

        exp_data = {
            'Value': exp_data,
            'WFSerializationType': 'WFTextTokenString',
        }

        assert f.process_value(variable) == exp_data
예제 #5
0
class ShowAlertAction(BaseAction):
    '''Show alert'''
    itype = 'is.workflow.actions.alert'
    keyword = 'alert'

    show_cancel_button = BooleanField('WFAlertActionCancelButtonShown',
                                      default=True)
    text = VariablesField('WFAlertActionMessage')
    title = VariablesField('WFAlertActionTitle')
예제 #6
0
class SendMessageAction(BaseAction):
    '''Send Message'''
    itype = 'is.workflow.actions.sendmessage'
    keyword = 'send_message'

    recepients = VariablesField('WFSendMessageActionRecipients')
    text = VariablesField('WFSendMessageContent')

    default_fields = {
        'IntentAppIdentifier': 'com.apple.MobileSMS',
    }
예제 #7
0
class TextAction(BaseAction):
    '''Text: returns text as an output'''

    itype = 'is.workflow.actions.gettext'
    keyword = 'text'

    text = VariablesField('WFTextActionText', help='Output of this action')
예제 #8
0
class CreateFolderAction(BaseAction):
    '''Create folder'''

    itype = 'is.workflow.actions.file.createfolder'
    keyword = 'create_folder'

    path = VariablesField('WFFilePath')
예제 #9
0
class AppendFileAction(BaseAction):
    '''Append file'''

    itype = 'is.workflow.actions.file.append'
    keyword = 'append_file'

    path = VariablesField('WFFilePath')
예제 #10
0
class DateAction(BaseAction):
    '''Date'''

    itype = 'is.workflow.actions.date'
    keyword = 'date'

    default_answer = VariablesField('WFAskActionDefaultAnswer', required=False)
예제 #11
0
class ShowResultAction(BaseAction):
    '''Show result: shows a result'''

    itype = 'is.workflow.actions.showresult'
    keyword = 'show_result'

    text = VariablesField('Text')
예제 #12
0
class AskAction(BaseAction):
    '''Ask for input'''
    itype = 'is.workflow.actions.ask'
    keyword = 'ask'

    question = Field('WFAskActionPrompt')
    input_type = Field('WFInputType', required=False)
    default_answer = VariablesField('WFAskActionDefaultAnswer', required=False)
예제 #13
0
class ReadFileAction(BaseAction):
    '''Get file'''
    type = 'is.workflow.actions.documentpicker.open'
    keyword = 'read_file'

    path = VariablesField('WFGetFilePath')
    not_found_error = BooleanField('WFFileErrorIfNotFound')
    show_picker = BooleanField('WFShowFilePicker')
예제 #14
0
class SaveFileAction(BaseAction):
    '''Save file'''
    type = 'is.workflow.actions.documentpicker.save'
    keyword = 'save_file'

    path = VariablesField('WFFileDestinationPath')
    overwrite = Field('WFSaveFileOverwrite')
    show_picker = BooleanField('WFAskWhereToSave')
예제 #15
0
class IfAction(BaseAction):
    '''If'''
    itype = 'is.workflow.actions.conditional'
    keyword = 'if'

    _additional_identifier_field = 'WFControlFlowMode'

    condition = ChoiceField('WFCondition',
                            choices=IF_CHOICES,
                            capitalize=True,
                            default=IF_CHOICES[0])
    compare_with = VariablesField('WFConditionalActionString')
    group_id = GroupIDField('GroupingIdentifier')

    default_fields = {
        'WFControlFlowMode': 0,
    }
예제 #16
0
        class MyAction(BaseAction):
            itype = identifier

            my_field = VariablesField(field_name)