1 ######################################################################
3 ## smb.conf parameter classes
5 ## Copyright (C) Gerald Carter 2004.
7 ## This program is free software; you can redistribute it and/or modify
8 ## it under the terms of the GNU General Public License as published by
9 ## the Free Software Foundation; either version 3 of the License, or
10 ## (at your option) any later version.
12 ## This program is distributed in the hope that it will be useful,
13 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
14 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 ## GNU General Public License for more details.
17 ## You should have received a copy of the GNU General Public License
18 ## along with this program; if not, write to the Free Software
19 ## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 ######################################################################
25 #####################################################################
26 ## Base class for Samba smb.conf parameters
28 def __init__( self ) :
31 def StringValue( self ) :
34 #####################################################################
35 ## Boolean smb,conf parm
36 class SambaParmBool( SambaParm ):
37 def __init__( self, value ) :
38 x = string.upper(value)
41 if x=="YES" or x=="TRUE" or x=="1":
43 elif x=="NO" or x=="FALSE" or x=="0":
49 def SetValue( self, value ) :
50 x = string.upper(value)
53 if x=="YES" or x=="TRUE" or x=="1":
55 elif x=="NO" or x=="FALSE" or x=="0":
61 def StringValue( self ) :
67 #####################################################################
68 ## Boolean smb,conf parm (inverts)
69 class SambaParmBoolRev( SambaParmBool ) :
70 def __init__( self, value ):
71 SambaParmBool.__init__( self, value )
73 self.value = not self.value
76 #####################################################################
77 ## string smb.conf parms
78 class SambaParmString( SambaParm ):
79 def __init__( self, value ):