class SetDictionaryValueAction(BaseAction): '''Set dictionary value''' itype = 'is.workflow.actions.setvalueforkey' keyword = 'set_value_for_key' key = VariablesField('WFDictionaryKey') value = VariablesField('WFDictionaryValue')
class NotificationAction(BaseAction): '''Show notification''' itype = 'is.workflow.actions.notification' keyword = 'notification' play_sound = BooleanField('WFNotificationActionSound', default=True) text = VariablesField('WFNotificationActionBody') title = VariablesField('WFNotificationActionTitle')
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
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
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')
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', }
class TextAction(BaseAction): '''Text: returns text as an output''' itype = 'is.workflow.actions.gettext' keyword = 'text' text = VariablesField('WFTextActionText', help='Output of this action')
class CreateFolderAction(BaseAction): '''Create folder''' itype = 'is.workflow.actions.file.createfolder' keyword = 'create_folder' path = VariablesField('WFFilePath')
class AppendFileAction(BaseAction): '''Append file''' itype = 'is.workflow.actions.file.append' keyword = 'append_file' path = VariablesField('WFFilePath')
class DateAction(BaseAction): '''Date''' itype = 'is.workflow.actions.date' keyword = 'date' default_answer = VariablesField('WFAskActionDefaultAnswer', required=False)
class ShowResultAction(BaseAction): '''Show result: shows a result''' itype = 'is.workflow.actions.showresult' keyword = 'show_result' text = VariablesField('Text')
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)
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')
class SaveFileAction(BaseAction): '''Save file''' type = 'is.workflow.actions.documentpicker.save' keyword = 'save_file' path = VariablesField('WFFileDestinationPath') overwrite = Field('WFSaveFileOverwrite') show_picker = BooleanField('WFAskWhereToSave')
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, }
class MyAction(BaseAction): itype = identifier my_field = VariablesField(field_name)