Package slum :: Module uiWrappers
[hide private]
[frames] | no frames]

Source Code for Module slum.uiWrappers

 1  # 
 2  # uiWrappers.py - classes to define slum template parameters and UI formating 
 3  # 
 4  #    Copyright (C) 2008 - Roberto Hradec 
 5  # 
 6  # --------------------------------------------------------------------------- 
 7  #        This file is part of SLUM. 
 8  # 
 9  #    SLUM is free software: you can redistribute it and/or modify 
10  #    it under the terms of the GNU General Public License as published by 
11  #    the Free Software Foundation, either version 3 of the License, or 
12  #    (at your option) any later version. 
13  # 
14  #    SLUM is distributed in the hope that it will be useful, 
15  #    but WITHOUT ANY WARRANTY; without even the implied warranty of 
16  #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
17  #    GNU General Public License for more details. 
18  # 
19  #    You should have received a copy of the GNU General Public License 
20  #    along with SLUM.  If not, see <http://www.gnu.org/licenses/>. 
21  # --------------------------------------------------------------------------- 
22   
23 -class parameter:
24 - def __init__(self, value, name, help='No Help available', max=1, min=0, output=False, ui=None, callback=None, hidden=False):
25 self.name = name 26 self.help = help 27 self.max = max 28 self.min = min 29 self.ui = ui 30 self.output = output 31 self.value = value 32 self.callback = callback 33 self.hidden = hidden
34
35 -class group:
36 - def __init__(self, value, name, help='No Help available', opened=True, hidden=False):
37 self.name = name 38 self.help = help 39 self.opened = opened 40 self.value = value 41 self.hidden = hidden
42
43 -class uiBase:
44 - def __init__(self, hidden=False ):
45 self.hidden = hidden
46
47 -class ui:
48 - class popup( uiBase ):
49 - def __init__(self, values = {'yes':True, 'no':False}, hidden=False ):
50 uiBase.__init__(self, hidden) 51 self.values = values
52 - class checkbox( uiBase ):
53 - def __init__(self, hidden=False):
54 uiBase.__init__(self, hidden) 55 pass
56 - class button( uiBase ):
57 - def __init__(self,callback, name='', hidden=False):
58 uiBase.__init__(self, hidden) 59 self.name = name 60 self.callback = callback
61