Coverage for khufu/labelsAndBadges/progressBar.py : 100%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1# encoding: utf-8
2from . import *
4def progressBar(
5 barStyle="plain",
6 precentageWidth="10",
7 barLevel="info"):
8 """
9 *Generate a progress bar - TBS style*
11 **Key Arguments**
13 - ``barStyle`` -- style of the progress bar [ "plain" | "striped" | "striped-active" ]
14 - ``precentageWidth`` -- the current progress of the bar
15 - ``barLevel`` -- the level color of the bar [ "info" | "warning" | "success" | "error" ]
18 **Return**
20 - ``progressBar`` -- the progressBar
22 """
23 barLevel = "progress-%(barLevel)s" % locals()
25 if barStyle == "striped":
26 barStyle = "progress-striped"
27 elif barStyle == "striped-active":
28 barStyle = "progress-striped active"
29 else:
30 barStyle = ""
32 progressBar = """
33 <div class="progress %(barLevel)s %(barStyle)s">
34 <div class="bar" style="width: %(precentageWidth)s%%;"></div>
35 </div>""" % locals()
37 return progressBar