conftree: add subkeys_unsorted method
This commit is contained in:
parent
3f23000b89
commit
3c52e45bee
@ -35,6 +35,7 @@ class ConfSimple(object):
|
|||||||
|
|
||||||
def __init__(self, confname, tildexp = False, readonly = True):
|
def __init__(self, confname, tildexp = False, readonly = True):
|
||||||
self.submaps = {}
|
self.submaps = {}
|
||||||
|
self.subkeys_unsorted = []
|
||||||
self.dotildexpand = tildexp
|
self.dotildexpand = tildexp
|
||||||
self.readonly = readonly
|
self.readonly = readonly
|
||||||
self.confname = confname
|
self.confname = confname
|
||||||
@ -81,6 +82,7 @@ class ConfSimple(object):
|
|||||||
else:
|
else:
|
||||||
submapkey = line
|
submapkey = line
|
||||||
#_debug("Submapkey: [%s]" % submapkey)
|
#_debug("Submapkey: [%s]" % submapkey)
|
||||||
|
self.subkeys_unsorted.append(submapkey)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
nm, sep, value = line.partition(b'=')
|
nm, sep, value = line.partition(b'=')
|
||||||
@ -95,6 +97,9 @@ class ConfSimple(object):
|
|||||||
self.submaps[submapkey] = {}
|
self.submaps[submapkey] = {}
|
||||||
self.submaps[submapkey][nm] = value
|
self.submaps[submapkey][nm] = value
|
||||||
|
|
||||||
|
def getSubKeys_unsorted(self):
|
||||||
|
return [k.decode('utf-8') for k in self.subkeys_unsorted]
|
||||||
|
|
||||||
def getbin(self, nm, sk = b''):
|
def getbin(self, nm, sk = b''):
|
||||||
'''Returns None if not found, empty string if found empty'''
|
'''Returns None if not found, empty string if found empty'''
|
||||||
if type(nm) != type(b'') or type(sk) != type(b''):
|
if type(nm) != type(b'') or type(sk) != type(b''):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user