Skip to content

Commit 62bbd0c

Browse files
author
Jonathan Goetzinger
committed
barebox: use function split_output_to_dict
Signed-off-by: Jonathan Goetzinger <[email protected]>
1 parent 5548d69 commit 62bbd0c

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

labgridhelper/barebox.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from labgrid.driver import BareboxDriver
2-
2+
from labgridhelper.dictionary_functions import split_output_to_dict
33

44
def get_commands(command):
55
"""Returns the available commands of a running Barebox bootloader
@@ -25,12 +25,4 @@ def get_globals(command):
2525
dict: name as key and value as key-value
2626
"""
2727
assert isinstance(command, BareboxDriver)
28-
out = command.run_check("global")
29-
out = map(lambda x: x[2:], out)
30-
global_variables = {}
31-
for line in out:
32-
sep = line.index(":")
33-
key = line[:sep]
34-
value = line[sep+2:]
35-
global_variables[key] = value
36-
return global_variables
28+
return split_output_to_dict(command, "global", delimiter=":", strip_chars="* ")

0 commit comments

Comments
 (0)