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

Commit

Permalink
Run main only if it's not appex
Browse files Browse the repository at this point in the history
  • Loading branch information
zrzka committed Jan 16, 2018
1 parent d2ae590 commit 5a65f0a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## master (unreleased)

*
* `pythonista_startup.py` sample - execute `main` only if `appex.is_running_extension()` is false

## 1.5.0 (2018-01-11)

Expand Down
4 changes: 3 additions & 1 deletion pythonista_startup.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,10 @@ def main():

if __name__ == 'pythonista_startup':
import traceback
import appex
try:
main()
if not appex.is_running_extension():
main()
except Exception:
print(traceback.format_exc())
print('Failed to process pythonista_startup.py')

0 comments on commit 5a65f0a

Please sign in to comment.