import ConfigParser class AliasConfigParser(ConfigParser.SafeConfigParser): def read(self, filename): ConfigParser.SafeConfigParser.read(self, filename) self.name = self.get("component", "name") self.root = self.get("component", "root") self.host = self.get("component", "host") self.secret = self.get("component", "secret") self.port = self.getint("component", "port") self.background = self.getboolean("component", "background") if self.has_option("component", "logfile"): self.logfile = self.get("component", "logfile") if self.has_option("component", "pidfile"): self.pidfile = self.get("component", "pidfile") config = AliasConfigParser()