Editorial Workflows

Edit Python...

public workflow

Install Workflow...

This workflow contains at least one Python script. Only use it if you trust the person who shared this with you, and if you know exactly what it does.

I understand, install the workflow!

This is a workflow for Editorial, a Markdown and plain text editor for iOS. To download it, you need to view this page on a device that has the app installed.

Description: Place the contents of a Python file into the Editor. The Python file should have been created via the "Save as Python" workflow. You can also save the changes that you make with that workflow.

See: http://omz-forums.appspot.com/editorial/post/5265481661415424

Shared by: @cclauss

Comments: Comment Feed (RSS)

There are no comments yet.

+ Add Comment

Workflow Preview
Run Python Script ?
Source Code
#coding: utf-8
import os, workflow

action_in = workflow.get_input()

#TODO: Generate the output...
python_files = '\n'.join([x for x in sorted(os.listdir('.'))
                             if x.lower().endswith('.py')
                             and not os.path.isdir(x)])
action_out = python_files

workflow.set_output(action_out)
Select from List ?
Title
Select a file to edit.
List (Lines)
Input
Multiple Selection
OFF
Show in Popover
OFF
If… ?
Run the block if
Input
  • is Equal to
  • is Not Equal to
  • Contains
  • Doesn't Contain
  • Matches Regular Expression
Stop ?
Stop
  • This Workflow
  • Repeat Block
Show HUD Alert
ON
Message
No file was selected.
…End If
Run Python Script ?
Source Code
#coding: utf-8
import editor, workflow

action_in = workflow.get_input()

#TODO: Generate the output...
assert action_in, 'No filename provided!'
with open(action_in) as in_file:
    editor.replace_text(0, len(editor.get_text()), in_file.read())
action_out = action_in

workflow.set_output(action_out)