environment
dev_tool.tui.environment
__all__ = ['DiffMenu']
module-attribute
DiffMenu
The constructor for the EnvironmentDiffMenu class.
Parameters:
-
terminal(Terminal) –The blessed Terminal instance.
-
local(dict[str, str]) –The local environment variables.
-
remote(dict[str, str]) –The remote environment variables.
Source code in dev_tool/tui/environment/menu.py
local = local
instance-attribute
offset = 0
instance-attribute
remote = remote
instance-attribute
terminal = terminal
instance-attribute
added = {k: v for k, v in remote.items() if k not in local}
instance-attribute
modified = {k: {'local': local[k], 'remote': remote[k]} for k in local if k in remote and local[k] != remote[k]}
instance-attribute
removed = {k: v for k, v in local.items() if k not in remote}
instance-attribute
draw_menu
A method that draws the environment diff menu.
Source code in dev_tool/tui/environment/menu.py
handle_input
A method that handles input for the menu.
Parameters:
-
key(str) –The key name.
Returns:
-
MergeChoice | None–The selected choice or None to continue.
Source code in dev_tool/tui/environment/menu.py
run
A method that runs the menu loop.
Returns:
-
MergeChoice–The choice the user made, or cancel if the menu was left.