Skip to content

Commit

Permalink
have verbose mode print tracebacks
Browse files Browse the repository at this point in the history
  • Loading branch information
cmlsharp committed Jul 11, 2018
1 parent f413c98 commit 068e969
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion submit50.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env python3

import argparse
import gettext
import logging
@@ -7,6 +9,7 @@
import shutil
import sys
import textwrap
import traceback

import push50
import requests
@@ -94,8 +97,12 @@ def excepthook(type, value, tb):
else:
cprint(_("Sorry, something's wrong! Let [email protected] know!"), "yellow")

if excepthook.verbose:
traceback.print_exception(type, value, tb)

cprint(_("Submission cancelled."), "red")

excepthook.verbose = True

if __name__ == "__main__":

@@ -112,10 +119,11 @@ def excepthook(type, value, tb):
"prescribed identifier of work to submit"))

args = parser.parse_args()
excepthook.verbose = args.verbose

if args.verbose:
logging.basicConfig(level="INFO")
push50.ProgressBar.DISBALED = True
push50.ProgressBar.DISABLED = True

check_announcements()
check_version()

0 comments on commit 068e969

Please sign in to comment.