Hide keyboard shortcuts

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 * 

3 

4def progressBar( 

5 barStyle="plain", 

6 precentageWidth="10", 

7 barLevel="info"): 

8 """ 

9 *Generate a progress bar - TBS style* 

10 

11 **Key Arguments** 

12 

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" ] 

16  

17 

18 **Return** 

19 

20 - ``progressBar`` -- the progressBar 

21  

22 """ 

23 barLevel = "progress-%(barLevel)s" % locals() 

24 

25 if barStyle == "striped": 

26 barStyle = "progress-striped" 

27 elif barStyle == "striped-active": 

28 barStyle = "progress-striped active" 

29 else: 

30 barStyle = "" 

31 

32 progressBar = """ 

33 <div class="progress %(barLevel)s %(barStyle)s"> 

34 <div class="bar" style="width: %(precentageWidth)s%%;"></div> 

35 </div>""" % locals() 

36 

37 return progressBar