From b99ae5137471fad034dc7e98bc60cd2dc893b631 Mon Sep 17 00:00:00 2001 From: Gerald Carter <jerry@samba.org> Date: Tue, 12 Jul 2005 16:34:44 +0000 Subject: r8384: merging clutter fixes from release branch (This used to be commit cbe74c09109dcfe93aa4af085920999ccbff34df) --- examples/scripts/shares/python/SambaParm.py | 84 +++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 examples/scripts/shares/python/SambaParm.py (limited to 'examples/scripts/shares/python/SambaParm.py') diff --git a/examples/scripts/shares/python/SambaParm.py b/examples/scripts/shares/python/SambaParm.py new file mode 100644 index 0000000000..292ad42cd2 --- /dev/null +++ b/examples/scripts/shares/python/SambaParm.py @@ -0,0 +1,84 @@ +###################################################################### +## +## smb.conf parameter classes +## +## Copyright (C) Gerald Carter 2004. +## +## This program is free software; you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 2 of the License, or +## (at your option) any later version. +## +## This program is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with this program; if not, write to the Free Software +## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +## +###################################################################### + +import string + +##################################################################### +## Base class for Samba smb.conf parameters +class SambaParm : + def __init__( self ) : + pass + + def StringValue( self ) : + return self.value + +##################################################################### +## Boolean smb,conf parm +class SambaParmBool( SambaParm ): + def __init__( self, value ) : + x = string.upper(value) + self.valid = True + + if x=="YES" or x=="TRUE" or x=="1": + self.value = True + elif x=="NO" or x=="FALSE" or x=="0": + self.value = False + else: + self.valid = False + return self + + def SetValue( self, value ) : + x = string.upper(value) + self.valid = True + + if x=="YES" or x=="TRUE" or x=="1": + self.value = True + elif x=="NO" or x=="FALSE" or x=="0": + self.value = False + else: + self.valid = False + return + + def StringValue( self ) : + if self.value : + return "yes" + else: + return "no" + +##################################################################### +## Boolean smb,conf parm (inverts) +class SambaParmBoolRev( SambaParmBool ) : + def __init__( self, value ): + SambaParmBool.__init__( self, value ) + if self.valid : + self.value = not self.value + + +##################################################################### +## string smb.conf parms +class SambaParmString( SambaParm ): + def __init__( self, value ): + self.value = value + self.valid = True + + + -- cgit From 2a9b4da0fa00d4ada504f49fafcadab7b0094331 Mon Sep 17 00:00:00 2001 From: Jeremy Allison <jra@samba.org> Date: Mon, 9 Jul 2007 19:46:27 +0000 Subject: r23780: Find and fix more GPL2 -> GPL3. Jeremy. (This used to be commit c2f7ab1c175ecff0cf44d0bbc4763ba9f7d7803f) --- examples/scripts/shares/python/SambaParm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'examples/scripts/shares/python/SambaParm.py') diff --git a/examples/scripts/shares/python/SambaParm.py b/examples/scripts/shares/python/SambaParm.py index 292ad42cd2..4933a2f702 100644 --- a/examples/scripts/shares/python/SambaParm.py +++ b/examples/scripts/shares/python/SambaParm.py @@ -6,7 +6,7 @@ ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or +## the Free Software Foundation; either version 3 of the License, or ## (at your option) any later version. ## ## This program is distributed in the hope that it will be useful, -- cgit From 153cfb9c83534b09f15cc16205d7adb19b394928 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell <tridge@samba.org> Date: Tue, 10 Jul 2007 05:23:25 +0000 Subject: r23801: The FSF has moved around a lot. This fixes their Mass Ave address. (This used to be commit 87c91e4362c51819032bfbebbb273c52e203b227) --- examples/scripts/shares/python/SambaParm.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'examples/scripts/shares/python/SambaParm.py') diff --git a/examples/scripts/shares/python/SambaParm.py b/examples/scripts/shares/python/SambaParm.py index 4933a2f702..82c99c84ac 100644 --- a/examples/scripts/shares/python/SambaParm.py +++ b/examples/scripts/shares/python/SambaParm.py @@ -15,8 +15,7 @@ ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License -## along with this program; if not, write to the Free Software -## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +## along with this program; if not, see <http://www.gnu.org/licenses/>. ## ###################################################################### -- cgit