コード例 #1
0
class ShowAlertAction(BaseAction):
    '''Show alert'''
    type = 'is.workflow.actions.alert'
    keyword = 'alert'

    show_cancel_button = BooleanField('WFAlertActionCancelButtonShown')
    text = Field('WFAlertActionMessage')
    title = Field('WFAlertActionTitle')
コード例 #2
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)
コード例 #3
0
ファイル: photo.py プロジェクト: hbcbh1999/python-shortcuts
class ImageConvertAction(BaseAction):
    '''Image convert'''
    type = 'is.workflow.actions.image.convert'
    keyword = 'convert_image'

    compression_quality = Field('WFImageCompressionQuality')
    format = Field('WFImageFormat')
    preserve_metadata = BooleanField('WFImagePreserveMetadata')
コード例 #4
0
class IfAction(BaseAction):
    '''If: you must specify group_id of this if condition'''
    type = 'is.workflow.actions.conditional'
    keyword = 'if'

    condition = Field('WFCondition', capitalize=True)
    compare_with = Field('WFConditionalActionString')
    group_id = Field('GroupingIdentifier')

    default_fields = {
        'WFControlFlowMode': 0,
    }
コード例 #5
0
class RunShortcutAction(BaseAction):
    '''Run shortcut'''
    itype = 'is.workflow.actions.runworkflow'
    keyword = 'run_shortcut'

    show = BooleanField('WFShowWorkflow', default=False)
    shortcut_name = Field('WFWorkflowName')
コード例 #6
0
class CountAction(BaseAction):
    '''Count'''

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

    count = Field('WFCountType', capitalize=True)
コード例 #7
0
ファイル: text.py プロジェクト: kyledacones/python-shortcuts
class CommentAction(BaseAction):
    '''Comment: just a comment'''

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

    text = Field('WFCommentActionText', help='Text to show in the comment')
コード例 #8
0
ファイル: web.py プロジェクト: kyledacones/python-shortcuts
class URLAction(BaseAction):
    '''URL: returns url as an output'''

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

    url = Field('WFURLActionURL')
コード例 #9
0
class SetVariableAction(BaseAction):
    '''Set variable: saves input to a variable with a name=`name`'''

    itype = 'is.workflow.actions.setvariable'
    keyword = 'set_variable'

    name = Field('WFVariableName')
コード例 #10
0
class AppendVariableAction(BaseAction):
    '''Append input to varaible'''

    itype = 'is.workflow.actions.appendvariable'
    keyword = 'append_variable'

    name = Field('WFVariableName')
コード例 #11
0
class OpenAppAction(BaseAction):
    '''Opens the specified app.'''

    itype = 'is.workflow.actions.openapp'
    keyword = 'open_app'

    app = Field('WFAppIdentifier')
コード例 #12
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')
コード例 #13
0
ファイル: scripting.py プロジェクト: yy/python-shortcuts
class ChooseFromListAction(BaseAction):
    '''Choose from list'''
    itype = 'is.workflow.actions.choosefromlist'
    keyword = 'choose_from_list'
    prompt = Field('WFChooseFromListActionPrompt', required=False)
    select_multiple = BooleanField('WFChooseFromListActionSelectMultiple',
                                   required=False)
    select_all_initially = BooleanField('WFChooseFromListActionSelectAll',
                                        required=False)
コード例 #14
0
class GetTimeBetweenDates(BaseAction):
    '''Get time difference between dates'''
    itype = 'is.workflow.actions.gettimebetweendates'
    keyword = 'get_time_between_dates'

    units = ChoiceField('WFTimeUntilUnit',
                        choices=DATE_DIFF_UNITS_CHOICES,
                        default=DATE_DIFF_UNITS_CHOICES[0])
    custom_date = Field('WFTimeUntilCustomDate', required=False)
コード例 #15
0
class ElseAction(BaseAction):
    '''Else: else for a specified group_id'''
    type = 'is.workflow.actions.conditional'
    keyword = 'else'

    group_id = Field('GroupingIdentifier')

    default_fields = {
        'WFControlFlowMode': 1,
    }
コード例 #16
0
class FormatDateAction(BaseAction):
    '''Format date'''
    itype = 'is.workflow.actions.format.date'
    keyword = 'format_date'

    format = Field('WFDateFormat')

    default_fields = {
        'WFDateFormatStyle': 'Custom',
    }
コード例 #17
0
class EndIfAction(BaseAction):
    '''EndIf: end a condition with specified group_id'''
    type = 'is.workflow.actions.conditional'
    keyword = 'endif'

    group_id = Field('GroupingIdentifier')

    default_fields = {
        'WFControlFlowMode': 2,
    }
コード例 #18
0
class IfAction(BaseAction):
    '''If'''
    itype = 'is.workflow.actions.conditional'
    keyword = 'if'

    condition = ChoiceField('WFCondition', choices=IF_CHOICES, capitalize=True)
    compare_with = Field('WFConditionalActionString')
    group_id = GroupIDField('GroupingIdentifier')

    default_fields = {
        'WFControlFlowMode': 0,
    }
コード例 #19
0
class SplitTextAction(BaseAction):
    '''Split text'''
    itype = 'is.workflow.actions.text.split'
    keyword = 'split_text'

    separator_type = ChoiceField(
        'WFTextSeparator',
        choices=SPLIT_SEPARATOR_CHOICES,
        default=SPLIT_SEPARATOR_CHOICES[0],
    )
    custom_separator = Field(
        'WFTextCustomSeparator',
        help='Works only with "Custom" `separator_type`',
        required=False,
    )
コード例 #20
0
ファイル: menu.py プロジェクト: gatarelib/python-shortcuts
class MenuItemAction(BaseAction):
    '''
    Menu item

    You must specify the title for the item.
    After this action write all actions which you want to be executed when a user selects this option in the menu.
    '''
    itype = 'is.workflow.actions.choosefrommenu'
    keyword = 'menu_item'

    group_id = GroupIDField('GroupingIdentifier')
    title = Field('WFMenuItemTitle')

    default_fields = {
        'WFControlFlowMode': 1,
    }
コード例 #21
0
class GetDictionaryValueAction(BaseAction):
    '''Get dictionary value'''
    itype = 'is.workflow.actions.getvalueforkey'
    keyword = 'get_value_for_key'

    key = Field('WFDictionaryKey')
コード例 #22
0
ファイル: out.py プロジェクト: kyledacones/python-shortcuts
class SetClipboardAction(BaseAction):
    itype = 'is.workflow.actions.setclipboard'
    keyword = 'set_clipboard'

    local_only = BooleanField('WFLocalOnly', required=False)
    expiration_date = Field('WFExpirationDate', required=False)