conftree: add subkeys_unsorted method

This commit is contained in:
Jean-Francois Dockes 2021-04-16 12:53:03 +02:00
parent 3f23000b89
commit 3c52e45bee

View File

@ -35,6 +35,7 @@ class ConfSimple(object):
def __init__(self, confname, tildexp = False, readonly = True):
self.submaps = {}
self.subkeys_unsorted = []
self.dotildexpand = tildexp
self.readonly = readonly
self.confname = confname
@ -81,6 +82,7 @@ class ConfSimple(object):
else:
submapkey = line
#_debug("Submapkey: [%s]" % submapkey)
self.subkeys_unsorted.append(submapkey)
continue
nm, sep, value = line.partition(b'=')
@ -95,6 +97,9 @@ class ConfSimple(object):
self.submaps[submapkey] = {}
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''):
'''Returns None if not found, empty string if found empty'''
if type(nm) != type(b'') or type(sk) != type(b''):