Merge pull request #741 from nautics889/minor-fixes-configjson

fix: Minor fixes in terminatorlib/configjson.py
This commit is contained in:
Matt Rose 2023-08-26 21:21:23 -04:00 committed by GitHub
commit f3841c640f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 5 deletions

View File

@ -1,6 +1,5 @@
from .util import dbg, err from .util import dbg, err
from os import path from os import path
import sys
import json import json
import copy import copy
from .config import Config from .config import Config
@ -8,6 +7,7 @@ from .config import Config
JSON_PROFILE_NAME = "__internal_json_profile__" JSON_PROFILE_NAME = "__internal_json_profile__"
JSON_LAYOUT_NAME = "__internal_json_layout__" JSON_LAYOUT_NAME = "__internal_json_layout__"
class ConfigJson(object): class ConfigJson(object):
profile_to_use = 'default' profile_to_use = 'default'
@ -73,7 +73,7 @@ class ConfigJson(object):
self.build_terminal_layout(layoutjson, children, parent, order) self.build_terminal_layout(layoutjson, children, parent, order)
return return
dbg ('Building %s layout from json: %s' % ("vertical" if vertical else "horizental", layoutjson)) dbg ('Building %s layout from json: %s' % ("vertical" if vertical else "horizontal", layoutjson))
counter = 0 counter = 0
actualparent = parent actualparent = parent
@ -106,8 +106,6 @@ class ConfigJson(object):
vertical = layoutjson["vertical"] vertical = layoutjson["vertical"]
del layoutjson["vertical"] del layoutjson["vertical"]
result = None
if len(layoutjson) == 1: if len(layoutjson) == 1:
firstitem = next(iter(layoutjson.values())) firstitem = next(iter(layoutjson.values()))
result = self.build_single_tab_layout(firstitem, vertical) result = self.build_single_tab_layout(firstitem, vertical)