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

Commit

Permalink
Wrap everything in try/except
Browse files Browse the repository at this point in the history
  • Loading branch information
zrzka committed Oct 1, 2017
1 parent e6bc6c7 commit 37fc6fc
Showing 1 changed file with 21 additions and 12 deletions.
33 changes: 21 additions & 12 deletions pythonista_startup.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
# !python3

import blackmamba
import blackmamba.log as log

# Default value is INFO. Use ERROR if you'd like to make Black
# Mamba quiet. Only errors will be printed.
log.set_level(log.INFO)
#!python3

# Check blackmamba.config._DEFAULTS for default values
config = {
Expand All @@ -21,7 +14,10 @@
'file_picker': {
'ignore_folders': {
'': ['.git'],
'.': ['.Trash', 'Examples', 'stash_extensions']
'.': ['Pythonista', '.Trash', 'Examples',
'site-packages-2', 'site-packages', 'stash_extensions'],
'site-packages-3': ['blackmamba', 'bm-pip-backup'],
'Working Copy': ['bm-pip-backup']
}
},
'analyzer': {
Expand All @@ -37,7 +33,9 @@
'drag_and_drop': {
'ignore_folders': {
'': ['.git'],
'.': ['.Trash', 'Examples', 'stash_extensions']
'.': ['Pythonista', '.Trash', 'Examples',
'site-packages-2', 'site-packages', 'stash_extensions'],
'Working Copy': ['bm-pip-backup']
}
}
}
Expand All @@ -62,6 +60,13 @@ def launch_stash():


def main():
import blackmamba
import blackmamba.log as log

# Default value is INFO. Use ERROR if you'd like to make Black
# Mamba quiet. Only errors will be printed.
log.set_level(log.INFO)

# The only requirement is to call main(). You can omit `config=config`
# if you'd like to use default config.
blackmamba.main(config=config)
Expand All @@ -72,6 +77,10 @@ def main():
# import console
# console.hide_output()


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

0 comments on commit 37fc6fc

Please sign in to comment.