fix the overlap of my last commit with thomas'
This commit is contained in:
commit
12c7d438b1
|
@ -32,7 +32,7 @@ AttributeError. This is by design. If you want to look something
|
||||||
up, set a default for it first."""
|
up, set a default for it first."""
|
||||||
|
|
||||||
# import standard python libs
|
# import standard python libs
|
||||||
import os, sys
|
import os, sys, re
|
||||||
|
|
||||||
# import unix-lib
|
# import unix-lib
|
||||||
import pwd
|
import pwd
|
||||||
|
@ -129,6 +129,7 @@ class TerminatorConfValuestoreDefault (TerminatorConfValuestore):
|
||||||
|
|
||||||
class TerminatorConfValuestoreRC (TerminatorConfValuestore):
|
class TerminatorConfValuestoreRC (TerminatorConfValuestore):
|
||||||
rcfilename = ""
|
rcfilename = ""
|
||||||
|
splitter = re.compile("\s*=\s*")
|
||||||
#FIXME: use inotify to watch the rc, split __init__ into a parsing function
|
#FIXME: use inotify to watch the rc, split __init__ into a parsing function
|
||||||
# that can be re-used when rc changes.
|
# that can be re-used when rc changes.
|
||||||
def __init__ (self):
|
def __init__ (self):
|
||||||
|
@ -143,7 +144,7 @@ class TerminatorConfValuestoreRC (TerminatorConfValuestore):
|
||||||
try:
|
try:
|
||||||
item = item.strip ()
|
item = item.strip ()
|
||||||
if item and item[0] != '#':
|
if item and item[0] != '#':
|
||||||
(key, value) = item.split ("=")
|
(key, value) = self.splitter.split (item)
|
||||||
if value.lower () == 'true':
|
if value.lower () == 'true':
|
||||||
self.values[key] = True
|
self.values[key] = True
|
||||||
elif value.lower () == 'false':
|
elif value.lower () == 'false':
|
||||||
|
@ -151,8 +152,8 @@ class TerminatorConfValuestoreRC (TerminatorConfValuestore):
|
||||||
else:
|
else:
|
||||||
self.values[key] = value
|
self.values[key] = value
|
||||||
dbg (" VS_RCFile: Set value '%s' to '%s'"%(key, self.values[key]))
|
dbg (" VS_RCFile: Set value '%s' to '%s'"%(key, self.values[key]))
|
||||||
except:
|
except Exception, e:
|
||||||
dbg (" VS_RCFile: Exception handling: %s"%item)
|
dbg (" VS_RCFile: %s Exception handling: %s" % (type(e), item))
|
||||||
pass
|
pass
|
||||||
|
|
||||||
class TerminatorConfValuestoreGConf (TerminatorConfValuestore):
|
class TerminatorConfValuestoreGConf (TerminatorConfValuestore):
|
||||||
|
|
Loading…
Reference in New Issue