python: heed conftop/confmid in rclconfig.py
This commit is contained in:
parent
3be0af0b15
commit
fe66206ee7
@ -75,7 +75,7 @@ class ConfTree(ConfSimple):
|
|||||||
which should be '/'-separated values. When a value is requested for a
|
which should be '/'-separated values. When a value is requested for a
|
||||||
given path, it will also be searched in the sections corresponding to
|
given path, it will also be searched in the sections corresponding to
|
||||||
the ancestors. E.g. get(name, '/a/b') will also look in sections '/a' and
|
the ancestors. E.g. get(name, '/a/b') will also look in sections '/a' and
|
||||||
'/' or '' (the last 2 are equivalent"""
|
'/' or '' (the last 2 are equivalent)"""
|
||||||
def get(self, nm, sk = ''):
|
def get(self, nm, sk = ''):
|
||||||
if sk == '' or sk[0] != '/':
|
if sk == '' or sk[0] != '/':
|
||||||
return ConfSimple.get(self, nm, sk)
|
return ConfSimple.get(self, nm, sk)
|
||||||
@ -161,9 +161,17 @@ class RclConfig:
|
|||||||
if self.datadir is None:
|
if self.datadir is None:
|
||||||
self.datadir = "/usr/share/recoll"
|
self.datadir = "/usr/share/recoll"
|
||||||
#print "Datadir: [%s]" % self.datadir
|
#print "Datadir: [%s]" % self.datadir
|
||||||
self.cdirs = [self.confdir,]
|
self.cdirs = []
|
||||||
|
|
||||||
|
# Additional config directory, values override user ones
|
||||||
|
if os.environ.has_key("RECOLL_CONFTOP"):
|
||||||
|
self.cdirs.append(os.environ["RECOLL_CONFTOP"])
|
||||||
|
self.cdirs.append(self.confdir)
|
||||||
|
# Additional config directory, overrides system's, overridden by user's
|
||||||
|
if os.environ.has_key("RECOLL_CONFMID"):
|
||||||
|
self.cdirs.append(os.environ["RECOLL_CONFMID"])
|
||||||
self.cdirs.append(os.path.join(self.datadir, "examples"))
|
self.cdirs.append(os.path.join(self.datadir, "examples"))
|
||||||
#print self.cdirs
|
|
||||||
self.config = ConfStack("recoll.conf", self.cdirs, "tree")
|
self.config = ConfStack("recoll.conf", self.cdirs, "tree")
|
||||||
self.keydir = ''
|
self.keydir = ''
|
||||||
|
|
||||||
@ -185,3 +193,6 @@ class RclExtraDbs:
|
|||||||
dync = RclDynConf(dyncfile)
|
dync = RclDynConf(dyncfile)
|
||||||
return dync.getStringList("actExtDbs")
|
return dync.getStringList("actExtDbs")
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
config = RclConfig()
|
||||||
|
print config.getConfParam("topdirs")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user