summaryrefslogtreecommitdiffstats
path: root/cobbler/settings.py
diff options
context:
space:
mode:
authorMichael DeHaan <mdehaan@redhat.com>2006-05-08 11:19:46 -0400
committerJim Meyering <jim@meyering.net>2006-05-08 11:19:46 -0400
commitfde48f2d1dc6412a0e9e483da8d197fd8c5d8e53 (patch)
tree1af94dc01339be06d7b339b87f55e87503052553 /cobbler/settings.py
parentd3f5db5d15a74c9149d86a2a73317365d726beba (diff)
downloadthird_party-cobbler-fde48f2d1dc6412a0e9e483da8d197fd8c5d8e53.tar.gz
third_party-cobbler-fde48f2d1dc6412a0e9e483da8d197fd8c5d8e53.tar.xz
third_party-cobbler-fde48f2d1dc6412a0e9e483da8d197fd8c5d8e53.zip
PyChecker.
Diffstat (limited to 'cobbler/settings.py')
-rw-r--r--cobbler/settings.py20
1 files changed, 17 insertions, 3 deletions
diff --git a/cobbler/settings.py b/cobbler/settings.py
index bbdf3e9..48226a0 100644
--- a/cobbler/settings.py
+++ b/cobbler/settings.py
@@ -10,12 +10,21 @@ import utils
class Settings(serializable.Serializable):
def filename(self):
+ """
+ The filename where settings are serialized.
+ """
return "/var/lib/cobbler/settings"
def __init__(self):
+ """
+ Constructor.
+ """
self.clear()
def clear(self):
+ """
+ Reset this object to reasonable default values.
+ """
self._attributes = {
"httpd_bin" : "/usr/sbin/httpd",
"pxelinux" : "/usr/lib/syslinux/pxelinux.0",
@@ -30,19 +39,24 @@ class Settings(serializable.Serializable):
def to_datastruct(self):
+ """
+ Return an easily serializable representation of the config.
+ """
return self._attributes
def from_datastruct(self,datastruct):
+ """
+ Modify this object to load values in datastruct.
+ """
if datastruct is None:
- print "DEBUG: not loading empty structure"
+ print "warning: not loading empty structure for %s" % self.filename()
return
self._attributes = datastruct
return self
- # could use getatr, but I'd rather not.
def __getattr__(self,name):
if utils.app_debug:
- print "Settings::__getattr__(self,%s)" % name
+ print "Settings::__getattr__(self,%s)" % name
if self._attributes.has_key(name):
return self._attributes[name]
else: