Skip to content

Commit

Permalink
Merge branch 'pr/45' into popen-non-slave
Browse files Browse the repository at this point in the history
  • Loading branch information
np1 committed Mar 9, 2014
2 parents 5c10df3 + 1adb2a2 commit 47f8cac
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions mpsyt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
"""

from __future__ import print_function
from math import ceil

__version__ = "0.01.38"
__author__ = "nagev"
Expand Down Expand Up @@ -1345,15 +1346,21 @@ def make_status_line(match_object):
pct = (current / total * 100)

except ZeroDivisionError:
pct = '?'
pct = 0

return " %s%s%s (%.0f%%)" % (
status_line = " %s%s%s %s" % (
match_object.group('elapsed_h') or '',
match_object.group('elapsed_m') or '00:',
match_object.group('elapsed_s'),
pct
("(%.0f%%)" % pct).ljust(6)
)

progress_bar_size = 30
progress = int(ceil(pct / 100 * progress_bar_size))
status_line += " [%s]" % ("=" * (progress - 1) + ">").ljust(progress_bar_size, '.')

return status_line


def _search(url, progtext, qs=None, splash=True):
""" Perform memoized url fetch, display progtext. """
Expand Down

0 comments on commit 47f8cac

Please sign in to comment.