conductor.clarisse.scripted_class.environment_ui module¶
Provide a window in which to add extra env vars.
This is required because Clarisse’s attribute editor doesn’t allow custom UI to be embedded.
-
class
conductor.clarisse.scripted_class.environment_ui.
EnvListWidget
(parent, y_val)¶ Bases:
sphinx.ext.autodoc.importer._MockObject
The panel within the window that provides scrollbars.
-
add_entries
(*entries)¶ Add a line and hook up the delete button event.
-
on_remove_but
(sender, _)¶ Remove from view.
We have to keep the item_list in sync.
-
-
class
conductor.clarisse.scripted_class.environment_ui.
EnvWindow
(node)¶ Bases:
sphinx.ext.autodoc.importer._MockObject
The entire window.
Holds the panel plus buttons to Add, Go, Cancel and so on.
-
on_add_but
(sender, eventid)¶
-
on_apply_but
(sender, eventid)¶ Save values on the attribute and keep the window visible.
-
on_close_but
(sender, eventid)¶ Hide only.
Don’t destroy because hide will cause the event loop to end and destroy will kick in afterwards.
-
on_go_but
(sender, eventid)¶ Save values on the attribute and hide(destroy) the window.
-
-
class
conductor.clarisse.scripted_class.environment_ui.
VarWidget
(parent, y_val, entry)¶ Bases:
sphinx.ext.autodoc.importer._MockObject
This is a line item containing UI for one env var.
An env var has a merge policy (exclusive or append), so we have a checkbox for that. And we have a button to delete the line. We inherit because GuiWidget::get_child_items is broken and we have to have a way to store the children.
-
index
()¶ Calculate the index of this widget in the list.
Derive from it’s height so we don’t have to maintain another variable each time a line is added or deleted.
-
set_y_index
(index)¶ Adjust this widget’s height based on its list position.
Notice here we can’t simply set the height of the container. Widgets locations are relative to the window, not their direct parent. In fact the only reason to set the parent’s position is OCD.
-
to_json
()¶ Serialize for storage in the node’s attribute.
-
-
conductor.clarisse.scripted_class.environment_ui.
build
(*args)¶ Show the window.
Populate it with existing entries from the extra_env attribute. The window is shown in modal mode so we don’t keep losing the damn thing behind other stuff. Listen for events until the window is hidden.