コード例 #1
0
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
ファイル: tests.py プロジェクト: zorrock/python-shortcuts
    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
ファイル: tests.py プロジェクト: zorrock/python-shortcuts
    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
ファイル: text.py プロジェクト: kyledacones/python-shortcuts
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
ファイル: out.py プロジェクト: kyledacones/python-shortcuts
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)