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):
|
||||
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''):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user