X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=daklib%2FConfig.py;h=96fdb8f5f6c0e6667b184426d8620df1c5bc5df9;hb=9af1235da5224336ede312fb5c3e0fe791bc19f0;hp=518d4de728b1420d8fe0dd03f00554ef1c368514;hpb=cd5b29ddfd8de263c085f494b9573d683913f6f3;p=dak.git diff --git a/daklib/Config.py b/daklib/Config.py index 518d4de7..96fdb8f5 100644 --- a/daklib/Config.py +++ b/daklib/Config.py @@ -1,7 +1,12 @@ #!/usr/bin/env python -# Config access class -# Copyright (C) 2008 Mark Hymers +""" +Config access class + +@contact: Debian FTPMaster +@copyright: 2008 Mark Hymers +@license: GNU General Public License version 2 or later +""" # 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 @@ -70,14 +75,9 @@ class Config(Singleton): def _startup(self, *args, **kwargs): self._readconf() + def has_key(self, name): + return self.Cnf.has_key(name) + def __getitem__(self, name): return self.Cnf[name] - def GetDBConnString(self): - s = "dbname=%s" % self.Cnf["DB::Name"] - if self.Cnf["DB::Host"]: - s += " host=%s" % self.Cnf["DB::Host"] - if self.Cnf["DB::Port"] and self.Cnf["DB::Port"] != "-1": - s += " port=%s" % self.Cnf["DB::Port"] - - return s