Commits

mickael9  committed cedd61c

- Make SIGINT terminate the program cleanly
- Fix a small progress display issue (race condition)

  • Participants
  • Parent commits d3b4c5d

Comments (0)

Files changed (1)

 
 import sys, os, os.path
 import argparse
+import signal
 
 from gett import *
 from time import sleep
 
+signal.signal(signal.SIGINT, signal.SIG_DFL)
+
 home = os.getenv('USERPROFILE') or os.getenv('HOME')
 
 parser = argparse.ArgumentParser(description="A simple ge.tt uploader")
 
 args = parser.parse_args()
 
-
 user = User()
 try:
     # Try to log-in with the token
         upload.join(0.5)
 
         if not upload.is_alive():
+            print_status(upload)
+
             if upload.ex:
                 sys.stderr.write(('\rError uploading %s : %s' % (upload.file.name, upload.ex)).ljust(80))