Parse [ENERGY], only support inp out
This commit is contained in:
@@ -57,15 +57,15 @@ def set_energy(name: str, cs: ChangeSet) -> ChangeSet:
|
|||||||
return execute_command(name, set_energy_cache(name, cs))
|
return execute_command(name, set_energy_cache(name, cs))
|
||||||
|
|
||||||
|
|
||||||
def inp_in_energy(section: list[str]) -> ChangeSet:
|
# def inp_in_energy(section: list[str]) -> ChangeSet:
|
||||||
cs = g_update_prefix | { 'type' : 'energy' }
|
# cs = g_update_prefix | { 'type' : 'energy' }
|
||||||
for s in section:
|
# for s in section:
|
||||||
line = s.upper().strip()
|
# line = s.upper().strip()
|
||||||
for key in get_energy_schema('').keys():
|
# for key in get_energy_schema('').keys():
|
||||||
if line.startswith(key):
|
# if line.startswith(key):
|
||||||
value = line.removeprefix(key).strip()
|
# value = line.removeprefix(key).strip()
|
||||||
cs |= { key : value }
|
# cs |= { key : value }
|
||||||
return ChangeSet(cs)
|
# return ChangeSet(cs)
|
||||||
|
|
||||||
|
|
||||||
def inp_out_energy(name: str) -> list[str]:
|
def inp_out_energy(name: str) -> list[str]:
|
||||||
|
|||||||
Reference in New Issue
Block a user