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, see <http://www.gnu.org/licenses/>.
20
######################################################################
24
#####################################################################
25
## Base class for Samba smb.conf parameters
27
def __init__( self ) :
30
def StringValue( self ) :
33
#####################################################################
34
## Boolean smb,conf parm
35
class SambaParmBool( SambaParm ):
36
def __init__( self, value ) :
37
x = string.upper(value)
40
if x=="YES" or x=="TRUE" or x=="1":
42
elif x=="NO" or x=="FALSE" or x=="0":
48
def SetValue( self, value ) :
49
x = string.upper(value)
52
if x=="YES" or x=="TRUE" or x=="1":
54
elif x=="NO" or x=="FALSE" or x=="0":
60
def StringValue( self ) :
66
#####################################################################
67
## Boolean smb,conf parm (inverts)
68
class SambaParmBoolRev( SambaParmBool ) :
69
def __init__( self, value ):
70
SambaParmBool.__init__( self, value )
72
self.value = not self.value
75
#####################################################################
76
## string smb.conf parms
77
class SambaParmString( SambaParm ):
78
def __init__( self, value ):