Skip to content
This repository has been archived by the owner on Apr 1, 2020. It is now read-only.

Commit

Permalink
Outline quickly includes async functions
Browse files Browse the repository at this point in the history
  • Loading branch information
zrzka committed Jan 19, 2018
1 parent 8e52739 commit 54cb761
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* `pythonista_startup.py` sample - execute `main` only if `appex.is_running_extension()` is false
* `script/new_tab.py` trashed, it was there just for `Cmd T`, which is supported by Pythonista now
* Keyboard shortcuts added to Pythonista 3.2 removed - dropped support of Pythonista < 3.2
* `outline_quickly.py`
* Added support for `async` functions

## 1.5.0 (2018-01-11)

Expand Down
6 changes: 3 additions & 3 deletions blackmamba/script/outline_quickly.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@


class OutlineNodeItem(PickerItem):
class Style(Enum):
class Style(str, Enum):
cls = 'class'
fn = 'function'

Expand All @@ -23,7 +23,7 @@ def __init__(self, style, name, line, column, level, breadcrumb):
self.column = column
self.level = level
self.breadcrumb = breadcrumb
self.image = Image(style.value)
self.image = Image(style)


class OutlineDataSource(PickerDataSource):
Expand All @@ -40,7 +40,7 @@ def _generate_nodes(parent, level=0, breadcrumb=''):
for child in parent.body:
if isinstance(child, ast.ClassDef):
style = OutlineNodeItem.Style.cls
elif isinstance(child, ast.FunctionDef):
elif isinstance(child, ast.FunctionDef) or isinstance(child, ast.AsyncFunctionDef):
style = OutlineNodeItem.Style.fn
else:
style = None
Expand Down

0 comments on commit 54cb761

Please sign in to comment.