Skip to content

Commit

Permalink
show the function with the progress
Browse files Browse the repository at this point in the history
  • Loading branch information
drak@kaverne committed May 24, 2017
1 parent 1e1f78a commit c6adaad
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions babcom.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
import threading # TODO: replace by futures once we have Python3
import logging
import functools
import hashlib
import smtplib
from email.mime.text import MIMEText
import imaplib
Expand Down Expand Up @@ -107,7 +108,16 @@ def w():
sys.stderr.write(letter)
sys.stderr.flush()
return w
def funcinfo(fun):
_n = func.__name__
return "".join(["[",
_n[:2],
hashlib.sha256(_n.encode("utf-8")).hexdigest()[:1],
_n[-2:],
"]"])
tasks = []
# start with the function name
tasks.append(threading.Timer(0.9, waiting(funcinfo(func))))
# one per second for 20 seconds
for i in range(1, 21):
tasks.append(threading.Timer(i, waiting(".")))
Expand Down

0 comments on commit c6adaad

Please sign in to comment.