From 46bb2b65e6fe642b07dee1de6c628c6f2cd303fd Mon Sep 17 00:00:00 2001 From: drebs Date: Fri, 19 Aug 2016 11:50:33 -0300 Subject: [pkg] add --pdb option to migration script --- scripts/migration/0.8.2/migrate.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/scripts/migration/0.8.2/migrate.py b/scripts/migration/0.8.2/migrate.py index adc0f7d9..fe612221 100755 --- a/scripts/migration/0.8.2/migrate.py +++ b/scripts/migration/0.8.2/migrate.py @@ -85,10 +85,22 @@ def _parse_args(): parser.add_argument( '--log-file', help='the log file to use') + parser.add_argument( + '--pdb', action='store_true', + help='escape to pdb shell in case of exception') return parser.parse_args() +def _enable_pdb(): + import sys + from IPython.core import ultratb + sys.excepthook = ultratb.FormattedTB( + mode='Verbose', color_scheme='Linux', call_pdb=1) + + if __name__ == '__main__': args = _parse_args() + if args.pdb: + _enable_pdb() _configure_logger(args.log_file) migrate(args, TARGET_VERSION) -- cgit v1.2.3