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 buttonGroup( 

5 buttonList=[], 

6 format="default", 

7 pull=False): 

8 """ 

9 *Generate a buttonGroup - TBS style* 

10 

11 **Key Arguments** 

12 

13 - ``buttonList`` -- a list of buttons 

14 - ``format`` -- format of the button [ default | toolbar | vertical ] 

15  

16 

17 **Return** 

18 

19 - ``buttonGroup`` -- the buttonGroup 

20  

21 """ 

22 thisButtonList = "" 

23 count = 1 

24 for button in buttonList: 

25 thisButtonList = "%(thisButtonList)s %(button)s" % locals() 

26 count += 1 

27 

28 if pull is not False: 

29 pull = "pull-%(pull)s" % locals() 

30 else: 

31 pull = "" 

32 

33 if format == "vertical": 

34 vertical = "btn-group-vertical" 

35 else: 

36 vertical = "" 

37 

38 toolbar = "" 

39 if format == "toolbar": 

40 toolbar = "btn-toolbar" 

41 

42 buttonGroup = """ 

43 <div class="btn-group %(vertical)s %(toolbar)s %(pull)s" id=" "> 

44 %(thisButtonList)s 

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

46 

47 return buttonGroup