blob: 74befe20bd1ae892b17dd10d8a5b23db961f251f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
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()
|