signature
stringlengths
8
3.44k
body
stringlengths
0
1.41M
docstring
stringlengths
1
122k
id
stringlengths
5
17
@settings.deleter<EOL><INDENT>@foundations.exceptions.handle_exceptions(foundations.exceptions.ProgrammingError)<EOL>def settings(self):<DEDENT>
raise foundations.exceptions.ProgrammingError(<EOL>"<STR_LIT>".format(self.__class__.__name__, "<STR_LIT>"))<EOL>
Deleter for **self.__settings** attribute.
f13130:c1:m6
@property<EOL><INDENT>def settings_section(self):<DEDENT>
return self.__settings_section<EOL>
Property for **self.__settings_section** attribute. :return: self.__settings_section. :rtype: unicode
f13130:c1:m7
@settings_section.setter<EOL><INDENT>@foundations.exceptions.handle_exceptions(foundations.exceptions.ProgrammingError)<EOL>def settings_section(self, value):<DEDENT>
raise foundations.exceptions.ProgrammingError(<EOL>"<STR_LIT>".format(self.__class__.__name__, "<STR_LIT>"))<EOL>
Setter for **self.__settings_section** attribute. :param value: Attribute value. :type value: unicode
f13130:c1:m8
@settings_section.deleter<EOL><INDENT>@foundations.exceptions.handle_exceptions(foundations.exceptions.ProgrammingError)<EOL>def settings_section(self):<DEDENT>
raise foundations.exceptions.ProgrammingError(<EOL>"<STR_LIT>".format(self.__class__.__name__, "<STR_LIT>"))<EOL>
Deleter for **self.__settings_section** attribute.
f13130:c1:m9
@property<EOL><INDENT>def preferences_manager(self):<DEDENT>
return self.__preferences_manager<EOL>
Property for **self.__preferences_manager** attribute. :return: self.__preferences_manager. :rtype: QWidget
f13130:c1:m10
@preferences_manager.setter<EOL><INDENT>@foundations.exceptions.handle_exceptions(foundations.exceptions.ProgrammingError)<EOL>def preferences_manager(self, value):<DEDENT>
raise foundations.exceptions.ProgrammingError(<EOL>"<STR_LIT>".format(self.__class__.__name__, "<STR_LIT>"))<EOL>
Setter for **self.__preferences_manager** attribute. :param value: Attribute value. :type value: QWidget
f13130:c1:m11
@preferences_manager.deleter<EOL><INDENT>@foundations.exceptions.handle_exceptions(foundations.exceptions.ProgrammingError)<EOL>def preferences_manager(self):<DEDENT>
raise foundations.exceptions.ProgrammingError(<EOL>"<STR_LIT>".format(self.__class__.__name__, "<STR_LIT>"))<EOL>
Deleter for **self.__preferences_manager** attribute.
f13130:c1:m12
@property<EOL><INDENT>def tcp_server(self):<DEDENT>
return self.__tcp_server<EOL>
Property for **self.__tcp_server** attribute. :return: self.__tcp_server. :rtype: QWidget
f13130:c1:m13
@tcp_server.setter<EOL><INDENT>@foundations.exceptions.handle_exceptions(foundations.exceptions.ProgrammingError)<EOL>def tcp_server(self, value):<DEDENT>
raise foundations.exceptions.ProgrammingError(<EOL>"<STR_LIT>".format(self.__class__.__name__, "<STR_LIT>"))<EOL>
Setter for **self.__tcp_server** attribute. :param value: Attribute value. :type value: QWidget
f13130:c1:m14
@tcp_server.deleter<EOL><INDENT>@foundations.exceptions.handle_exceptions(foundations.exceptions.ProgrammingError)<EOL>def tcp_server(self):<DEDENT>
raise foundations.exceptions.ProgrammingError(<EOL>"<STR_LIT>".format(self.__class__.__name__, "<STR_LIT>"))<EOL>
Deleter for **self.__tcp_server** attribute.
f13130:c1:m15
@property<EOL><INDENT>def address(self):<DEDENT>
return self.__address<EOL>
Property for **self.__address** attribute. :return: self.__address. :rtype: unicode
f13130:c1:m16
@address.setter<EOL><INDENT>@foundations.exceptions.handle_exceptions(foundations.exceptions.ProgrammingError)<EOL>def address(self, value):<DEDENT>
if value is not None:<EOL><INDENT>assert type(value) is unicode, "<STR_LIT>".format(<EOL>"<STR_LIT:address>", value)<EOL><DEDENT>self.__address = value<EOL>
Setter for **self.__address** attribute. :param value: Attribute value. :type value: unicode
f13130:c1:m17
@address.deleter<EOL><INDENT>@foundations.exceptions.handle_exceptions(foundations.exceptions.ProgrammingError)<EOL>def address(self):<DEDENT>
raise foundations.exceptions.ProgrammingError(<EOL>"<STR_LIT>".format(self.__class__.__name__, "<STR_LIT:address>"))<EOL>
Deleter for **self.__address** attribute.
f13130:c1:m18
@property<EOL><INDENT>def port(self):<DEDENT>
return self.__port<EOL>
Property for **self.__port** attribute. :return: self.__port. :rtype: int
f13130:c1:m19
@port.setter<EOL><INDENT>@foundations.exceptions.handle_exceptions(foundations.exceptions.ProgrammingError)<EOL>def port(self, value):<DEDENT>
if value is not None:<EOL><INDENT>assert type(value) is int, "<STR_LIT>".format(<EOL>"<STR_LIT:port>", value)<EOL>assert type(value) >= <NUM_LIT:0> and type(value) >= <NUM_LIT>,"<STR_LIT>".format("<STR_LIT:port>", value)<EOL><DEDENT>self.__port = value<EOL>
Setter for **self.__port** attribute. :param value: Attribute value. :type value: int
f13130:c1:m20
@port.deleter<EOL><INDENT>@foundations.exceptions.handle_exceptions(foundations.exceptions.ProgrammingError)<EOL>def port(self):<DEDENT>
raise foundations.exceptions.ProgrammingError(<EOL>"<STR_LIT>".format(self.__class__.__name__, "<STR_LIT:port>"))<EOL>
Deleter for **self.__port** attribute.
f13130:c1:m21
def activate(self, engine):
LOGGER.debug("<STR_LIT>".format(self.__class__.__name__))<EOL>self.__engine = engine<EOL>self.__settings = self.__engine.settings<EOL>self.__settings_section = self.name<EOL>self.__preferences_manager = self.__engine.components_manager["<STR_LIT>"]<EOL>self.__tcp_server = TCPServer(self.__address, self.__port, RequestsStackDataHandler)<EOL>self.activated = True<EOL>return True<EOL>
Activates the Component. :param engine: Engine to attach the Component to. :type engine: QObject :return: Method success. :rtype: bool
f13130:c1:m22
def deactivate(self):
LOGGER.debug("<STR_LIT>".format(self.__class__.__name__))<EOL>self.__engine = None<EOL>self.__settings = None<EOL>self.__settings_section = None<EOL>self.__preferences_manager = None<EOL>self.__tcp_server.online and self.__tcp_server.stop()<EOL>self.__tcp_server = None<EOL>self.activated = False<EOL>return True<EOL>
Deactivates the Component. :return: Method success. :rtype: bool
f13130:c1:m23
def initialize_ui(self):
LOGGER.debug("<STR_LIT>".format(self.__class__.__name__))<EOL>self.__Port_spinBox_set_ui()<EOL>self.__Autostart_TCP_Server_checkBox_set_ui()<EOL>self.Port_spinBox.valueChanged.connect(self.__Port_spinBox__valueChanged)<EOL>self.Autostart_TCP_Server_checkBox.stateChanged.connect(<EOL>self.__Autostart_TCP_Server_checkBox__stateChanged)<EOL>self.Start_TCP_Server_pushButton.clicked.connect(self.__Start_TCP_Server_pushButton__clicked)<EOL>self.Stop_TCP_Server_pushButton.clicked.connect(self.__Stop_TCP_Server_pushButton__clicked)<EOL>self.initialized_ui = True<EOL>return True<EOL>
Initializes the Component ui. :return: Method success. :rtype: bool
f13130:c1:m24
def uninitialize_ui(self):
LOGGER.debug("<STR_LIT>".format(self.__class__.__name__))<EOL>self.Port_spinBox.valueChanged.disconnect(self.__Port_spinBox__valueChanged)<EOL>self.Autostart_TCP_Server_checkBox.stateChanged.disconnect(<EOL>self.__Autostart_TCP_Server_checkBox__stateChanged)<EOL>self.Start_TCP_Server_pushButton.clicked.disconnect(self.__Start_TCP_Server_pushButton__clicked)<EOL>self.Stop_TCP_Server_pushButton.clicked.disconnect(self.__Stop_TCP_Server_pushButton__clicked)<EOL>self.initialized_ui = False<EOL>return True<EOL>
Uninitializes the Component ui. :return: Method success. :rtype: bool
f13130:c1:m25
def add_widget(self):
LOGGER.debug("<STR_LIT>".format(self.__class__.__name__))<EOL>self.__preferences_manager.Others_Preferences_gridLayout.addWidget(self.TCP_Server_Ui_groupBox)<EOL>return True<EOL>
Adds the Component Widget to the engine. :return: Method success. :rtype: bool
f13130:c1:m26
def remove_widget(self):
LOGGER.debug("<STR_LIT>".format(self.__class__.__name__))<EOL>self.__preferences_manager.findChild(QGridLayout, "<STR_LIT>").removeWidget(self)<EOL>self.TCP_Server_Ui_groupBox.setParent(None)<EOL>return True<EOL>
Removes the Component Widget from the engine. :return: Method success. :rtype: bool
f13130:c1:m27
def on_startup(self):
LOGGER.debug("<STR_LIT>".format(self.__class__.__name__))<EOL>if self.Autostart_TCP_Server_checkBox.isChecked():<EOL><INDENT>if not self.__tcp_server.online:<EOL><INDENT>self.__tcp_server.port = self.Port_spinBox.value()<EOL>self.__tcp_server.start()<EOL><DEDENT><DEDENT>return True<EOL>
Defines the slot triggered on Framework startup.
f13130:c1:m28
def on_close(self):
self.__tcp_server.online and self.__tcp_server.stop()<EOL>return True<EOL>
Defines the slot triggered on Framework close.
f13130:c1:m29
def __Port_spinBox_set_ui(self):
<EOL>self.__settings.get_key(self.__settings_section, "<STR_LIT:port>").isNull() andself.__settings.set_key(self.__settings_section, "<STR_LIT:port>", self.__port)<EOL>port = foundations.common.get_first_item(self.__settings.get_key(self.__settings_section, "<STR_LIT:port>").toInt())<EOL>LOGGER.debug("<STR_LIT>".format("<STR_LIT>",<EOL>port))<EOL>self.Port_spinBox.setValue(port)<EOL>self.__port = port<EOL>
Sets the **Port_spinBox** Widget.
f13130:c1:m30
def __Port_spinBox__valueChanged(self, value):
LOGGER.debug("<STR_LIT>".format(value))<EOL>self.__settings.set_key(self.__settings_section, "<STR_LIT:port>", value)<EOL>self.__port = value<EOL>
Defines the slot triggered by the **Port_spinBox** Widget when value changed. :param value: Port value. :type value: int
f13130:c1:m31
def __Autostart_TCP_Server_checkBox_set_ui(self):
<EOL>self.__settings.get_key(self.__settings_section, "<STR_LIT>").isNull() andself.__settings.set_key(self.__settings_section, "<STR_LIT>", Qt.Checked)<EOL>autostart_tcp_server = foundations.common.get_first_item(<EOL>self.__settings.get_key(self.__settings_section, "<STR_LIT>").toInt())<EOL>LOGGER.debug("<STR_LIT>".format("<STR_LIT>",<EOL>autostart_tcp_server))<EOL>self.Autostart_TCP_Server_checkBox.setCheckState(autostart_tcp_server)<EOL>
Sets the **Autostart_TCP_Server_checkBox** Widget.
f13130:c1:m32
def __Autostart_TCP_Server_checkBox__stateChanged(self, state):
autostart_tcp_server = self.Autostart_TCP_Server_checkBox.checkState()<EOL>LOGGER.debug("<STR_LIT>".format(autostart_tcp_server))<EOL>self.__settings.set_key(self.__settings_section, "<STR_LIT>", autostart_tcp_server)<EOL>
Defines the slot triggered by **Autostart_TCP_Server_checkBox** Widged when state changed. :param state: Checkbox state. :type state: int
f13130:c1:m33
def __Start_TCP_Server_pushButton__clicked(self, checked):
self.start_tcp_server(self.Port_spinBox.value())<EOL>
Defines the slot triggered by **Start_TCP_Server_pushButton** Widget when clicked. :param checked: Checked state. :type checked: bool
f13130:c1:m34
def __Stop_TCP_Server_pushButton__clicked(self, checked):
self.stop_tcp_server()<EOL>
Defines the slot triggered by **Stop_TCP_Server_pushButton** Widget when clicked. :param checked: Checked state. :type checked: bool
f13130:c1:m35
def start_tcp_server(self, port):
self.__tcp_server.port = port<EOL>if not self.__tcp_server.online:<EOL><INDENT>if self.__tcp_server.start():<EOL><INDENT>self.__engine.notifications_manager.notify(<EOL>"<STR_LIT>".format(<EOL>self.__class__.__name__,<EOL>self.__address,<EOL>self.__port))<EOL>return True<EOL><DEDENT><DEDENT>else:<EOL><INDENT>self.__engine.notifications_manager.warnify(<EOL>"<STR_LIT>".format(self.__class__.__name__))<EOL>return False<EOL><DEDENT>
Starts the TCP server using given port. :param port: Port. :type port: int :return: Method success. :rtype: bool
f13130:c1:m36
def stop_tcp_server(self):
if self.__tcp_server.online:<EOL><INDENT>if self.__tcp_server.stop():<EOL><INDENT>self.__engine.notifications_manager.notify(<EOL>"<STR_LIT>".format(self.__class__.__name__))<EOL>return True<EOL><DEDENT><DEDENT>else:<EOL><INDENT>self.__engine.notifications_manager.warnify(<EOL>"<STR_LIT>".format(self.__class__.__name__))<EOL>return False<EOL><DEDENT>
Stops the TCP server. :return: Method success. :rtype: bool
f13130:c1:m37
def __init__(self,<EOL>module=None,<EOL>name=None,<EOL>parent=None,<EOL>children=None,<EOL>roles=None,<EOL>node_flags=int(Qt.ItemIsSelectable | Qt.ItemIsEnabled),<EOL>attributes_flags=int(Qt.ItemIsSelectable | Qt.ItemIsEnabled),<EOL>**kwargs):
LOGGER.debug("<STR_LIT>".format(self.__class__.__name__))<EOL>umbra.ui.nodes.GraphModelNode.__init__(self, name, parent, children, roles, node_flags, **kwargs)<EOL>self.__module = module<EOL>ModuleNode.__initialize_node(self, attributes_flags)<EOL>
Initializes the class. :param module: Module. :type module: ModuleType :param name: Node name. :type name: unicode :param parent: Node parent. :type parent: GraphModelNode :param children: Children. :type children: list :param roles: Roles. :type roles: dict :param node_flags: Node flags. :type node_flags: int :param attributes_flags: Attributes flags. :type attributes_flags: int :param \*\*kwargs: Keywords arguments. :type \*\*kwargs: \*\*
f13131:c0:m0
@property<EOL><INDENT>def module(self):<DEDENT>
return self.__module<EOL>
Property for **self.__module** attribute. :return: self.__module. :rtype: object
f13131:c0:m1
@module.setter<EOL><INDENT>@foundations.exceptions.handle_exceptions(foundations.exceptions.ProgrammingError)<EOL>def module(self, value):<DEDENT>
raise foundations.exceptions.ProgrammingError(<EOL>"<STR_LIT>".format(self.__class__.__name__, "<STR_LIT>"))<EOL>
Setter for **self.__module** attribute. :param value: Attribute value. :type value: object
f13131:c0:m2
@module.deleter<EOL><INDENT>@foundations.exceptions.handle_exceptions(foundations.exceptions.ProgrammingError)<EOL>def module(self):<DEDENT>
raise foundations.exceptions.ProgrammingError(<EOL>"<STR_LIT>".format(self.__class__.__name__, "<STR_LIT>"))<EOL>
Deleter for **self.__module** attribute.
f13131:c0:m3
def __initialize_node(self, attributes_flags=int(Qt.ItemIsSelectable | Qt.ItemIsEnabled)):
self["<STR_LIT>"] = umbra.ui.nodes.GraphModelAttribute(name="<STR_LIT>",<EOL>value=foundations.trace.is_traced(self.__module),<EOL>flags=attributes_flags)<EOL>self.update_node_attributes()<EOL>
Initializes the node. :param attributes_flags: Attributes flags. :type attributes_flags: int
f13131:c0:m4
def update_node_attributes(self, attributes_flags=int(Qt.ItemIsSelectable | Qt.ItemIsEnabled)):
self.traced.value = foundations.trace.is_traced(self.__module)<EOL>self.traced.roles[Qt.DisplayRole] = foundations.strings.to_string(self.traced.value).title()<EOL>
Updates the Node attributes. :param attributes_flags: Attributes flags. :type attributes_flags: int :return: Method success. :rtype: bool
f13131:c0:m5
def __init__(self, parent, model=None, read_only=False, message=None):
LOGGER.debug("<STR_LIT>".format(self.__class__.__name__))<EOL>umbra.ui.views.Abstract_QTreeView.__init__(self, parent, read_only, message)<EOL>self.__tree_view_indentation = <NUM_LIT:15><EOL>self.setModel(model)<EOL>Modules_QTreeView.__initialize_ui(self)<EOL>
Initializes the class. :param parent: Object parent. :type parent: QObject :param model: Model. :type model: QObject :param read_only: View is read only. :type read_only: bool :param message: View default message when Model is empty. :type message: unicode
f13132:c0:m0
@property<EOL><INDENT>def tree_view_indentation(self):<DEDENT>
return self.__tree_view_indentation<EOL>
Property for **self.__tree_view_indentation** attribute. :return: self.__tree_view_indentation. :rtype: int
f13132:c0:m1
@tree_view_indentation.setter<EOL><INDENT>@foundations.exceptions.handle_exceptions(foundations.exceptions.ProgrammingError)<EOL>def tree_view_indentation(self, value):<DEDENT>
raise foundations.exceptions.ProgrammingError(<EOL>"<STR_LIT>".format(self.__class__.__name__, "<STR_LIT>"))<EOL>
Setter for **self.__tree_view_indentation** attribute. :param value: Attribute value. :type value: int
f13132:c0:m2
@tree_view_indentation.deleter<EOL><INDENT>@foundations.exceptions.handle_exceptions(foundations.exceptions.ProgrammingError)<EOL>def tree_view_indentation(self):<DEDENT>
raise foundations.exceptions.ProgrammingError(<EOL>"<STR_LIT>".format(self.__class__.__name__, "<STR_LIT>"))<EOL>
Deleter for **self.__tree_view_indentation** attribute.
f13132:c0:m3
def __initialize_ui(self):
self.setAutoScroll(True)<EOL>self.setSelectionMode(QAbstractItemView.ExtendedSelection)<EOL>self.setIndentation(self.__tree_view_indentation)<EOL>self.setRootIsDecorated(False)<EOL>self.setDragDropMode(QAbstractItemView.NoDragDrop)<EOL>self.setSortingEnabled(True)<EOL>self.sortByColumn(<NUM_LIT:0>, Qt.AscendingOrder)<EOL>self.__set_default_ui_state()<EOL>self.model().modelReset.connect(self.__set_default_ui_state)<EOL>
Initializes the Widget ui.
f13132:c0:m4
def __set_default_ui_state(self):
LOGGER.debug("<STR_LIT>")<EOL>if not self.model():<EOL><INDENT>return<EOL><DEDENT>self.expandAll()<EOL>for column in range(len(self.model().horizontal_headers)):<EOL><INDENT>self.resizeColumnToContents(column)<EOL><DEDENT>
Sets the Widget default ui state.
f13132:c0:m5
def setModel(self, model):
LOGGER.debug("<STR_LIT>".format(model))<EOL>if not model:<EOL><INDENT>return<EOL><DEDENT>umbra.ui.views.Abstract_QTreeView.setModel(self, model)<EOL>
Reimplements the **umbra.ui.views.Abstract_QTreeView.setModel** method. :param model: Model to set. :type model: QObject
f13132:c0:m6
def __init__(self, parent=None, name=None, *args, **kwargs):
LOGGER.debug("<STR_LIT>".format(self.__class__.__name__))<EOL>super(TraceUi, self).__init__(parent, name, *args, **kwargs)<EOL>self.deactivatable = True<EOL>self.__dock_area = <NUM_LIT:1><EOL>self.__engine = None<EOL>self.__settings = None<EOL>self.__settings_section = None<EOL>self.__model = None<EOL>self.__view = None<EOL>self.__headers = OrderedDict([("<STR_LIT>", "<STR_LIT:name>"),<EOL>("<STR_LIT>", "<STR_LIT>")])<EOL>
Initializes the class. :param parent: Object parent. :type parent: QObject :param name: Component name. :type name: unicode :param \*args: Arguments. :type \*args: \* :param \*\*kwargs: Keywords arguments. :type \*\*kwargs: \*\*
f13133:c0:m0
@property<EOL><INDENT>def dock_area(self):<DEDENT>
return self.__dock_area<EOL>
Property for **self.__dock_area** attribute. :return: self.__dock_area. :rtype: int
f13133:c0:m1
@dock_area.setter<EOL><INDENT>@foundations.exceptions.handle_exceptions(foundations.exceptions.ProgrammingError)<EOL>def dock_area(self, value):<DEDENT>
raise foundations.exceptions.ProgrammingError(<EOL>"<STR_LIT>".format(self.__class__.__name__, "<STR_LIT>"))<EOL>
Setter for **self.__dock_area** attribute. :param value: Attribute value. :type value: int
f13133:c0:m2
@dock_area.deleter<EOL><INDENT>@foundations.exceptions.handle_exceptions(foundations.exceptions.ProgrammingError)<EOL>def dock_area(self):<DEDENT>
raise foundations.exceptions.ProgrammingError(<EOL>"<STR_LIT>".format(self.__class__.__name__, "<STR_LIT>"))<EOL>
Deleter for **self.__dock_area** attribute.
f13133:c0:m3
@property<EOL><INDENT>def engine(self):<DEDENT>
return self.__engine<EOL>
Property for **self.__engine** attribute. :return: self.__engine. :rtype: QObject
f13133:c0:m4
@engine.setter<EOL><INDENT>@foundations.exceptions.handle_exceptions(foundations.exceptions.ProgrammingError)<EOL>def engine(self, value):<DEDENT>
raise foundations.exceptions.ProgrammingError(<EOL>"<STR_LIT>".format(self.__class__.__name__, "<STR_LIT>"))<EOL>
Setter for **self.__engine** attribute. :param value: Attribute value. :type value: QObject
f13133:c0:m5
@engine.deleter<EOL><INDENT>@foundations.exceptions.handle_exceptions(foundations.exceptions.ProgrammingError)<EOL>def engine(self):<DEDENT>
raise foundations.exceptions.ProgrammingError(<EOL>"<STR_LIT>".format(self.__class__.__name__, "<STR_LIT>"))<EOL>
Deleter for **self.__engine** attribute.
f13133:c0:m6
@property<EOL><INDENT>def settings(self):<DEDENT>
return self.__settings<EOL>
Property for **self.__settings** attribute. :return: self.__settings. :rtype: QSettings
f13133:c0:m7
@settings.setter<EOL><INDENT>@foundations.exceptions.handle_exceptions(foundations.exceptions.ProgrammingError)<EOL>def settings(self, value):<DEDENT>
raise foundations.exceptions.ProgrammingError(<EOL>"<STR_LIT>".format(self.__class__.__name__, "<STR_LIT>"))<EOL>
Setter for **self.__settings** attribute. :param value: Attribute value. :type value: QSettings
f13133:c0:m8
@settings.deleter<EOL><INDENT>@foundations.exceptions.handle_exceptions(foundations.exceptions.ProgrammingError)<EOL>def settings(self):<DEDENT>
raise foundations.exceptions.ProgrammingError(<EOL>"<STR_LIT>".format(self.__class__.__name__, "<STR_LIT>"))<EOL>
Deleter for **self.__settings** attribute.
f13133:c0:m9
@property<EOL><INDENT>def settings_section(self):<DEDENT>
return self.__settings_section<EOL>
Property for **self.__settings_section** attribute. :return: self.__settings_section. :rtype: unicode
f13133:c0:m10
@settings_section.setter<EOL><INDENT>@foundations.exceptions.handle_exceptions(foundations.exceptions.ProgrammingError)<EOL>def settings_section(self, value):<DEDENT>
raise foundations.exceptions.ProgrammingError(<EOL>"<STR_LIT>".format(self.__class__.__name__, "<STR_LIT>"))<EOL>
Setter for **self.__settings_section** attribute. :param value: Attribute value. :type value: unicode
f13133:c0:m11
@settings_section.deleter<EOL><INDENT>@foundations.exceptions.handle_exceptions(foundations.exceptions.ProgrammingError)<EOL>def settings_section(self):<DEDENT>
raise foundations.exceptions.ProgrammingError(<EOL>"<STR_LIT>".format(self.__class__.__name__, "<STR_LIT>"))<EOL>
Deleter for **self.__settings_section** attribute.
f13133:c0:m12
@property<EOL><INDENT>def model(self):<DEDENT>
return self.__model<EOL>
Property for **self.__model** attribute. :return: self.__model. :rtype: CollectionsModel
f13133:c0:m13
@model.setter<EOL><INDENT>@foundations.exceptions.handle_exceptions(foundations.exceptions.ProgrammingError)<EOL>def model(self, value):<DEDENT>
raise foundations.exceptions.ProgrammingError(<EOL>"<STR_LIT>".format(self.__class__.__name__, "<STR_LIT>"))<EOL>
Setter for **self.__model** attribute. :param value: Attribute value. :type value: CollectionsModel
f13133:c0:m14
@model.deleter<EOL><INDENT>@foundations.exceptions.handle_exceptions(foundations.exceptions.ProgrammingError)<EOL>def model(self):<DEDENT>
raise foundations.exceptions.ProgrammingError(<EOL>"<STR_LIT>".format(self.__class__.__name__, "<STR_LIT>"))<EOL>
Deleter for **self.__model** attribute.
f13133:c0:m15
@property<EOL><INDENT>def view(self):<DEDENT>
return self.__view<EOL>
Property for **self.__view** attribute. :return: self.__view. :rtype: QWidget
f13133:c0:m16
@view.setter<EOL><INDENT>@foundations.exceptions.handle_exceptions(foundations.exceptions.ProgrammingError)<EOL>def view(self, value):<DEDENT>
raise foundations.exceptions.ProgrammingError(<EOL>"<STR_LIT>".format(self.__class__.__name__, "<STR_LIT>"))<EOL>
Setter for **self.__view** attribute. :param value: Attribute value. :type value: QWidget
f13133:c0:m17
@view.deleter<EOL><INDENT>@foundations.exceptions.handle_exceptions(foundations.exceptions.ProgrammingError)<EOL>def view(self):<DEDENT>
raise foundations.exceptions.ProgrammingError(<EOL>"<STR_LIT>".format(self.__class__.__name__, "<STR_LIT>"))<EOL>
Deleter for **self.__view** attribute.
f13133:c0:m18
@property<EOL><INDENT>def headers(self):<DEDENT>
return self.__headers<EOL>
Property for **self.__headers** attribute. :return: self.__headers. :rtype: OrderedDict
f13133:c0:m19
@headers.setter<EOL><INDENT>@foundations.exceptions.handle_exceptions(foundations.exceptions.ProgrammingError)<EOL>def headers(self, value):<DEDENT>
raise foundations.exceptions.ProgrammingError(<EOL>"<STR_LIT>".format(self.__class__.__name__, "<STR_LIT>"))<EOL>
Setter for **self.__headers** attribute. :param value: Attribute value. :type value: OrderedDict
f13133:c0:m20
@headers.deleter<EOL><INDENT>@foundations.exceptions.handle_exceptions(foundations.exceptions.ProgrammingError)<EOL>def headers(self):<DEDENT>
raise foundations.exceptions.ProgrammingError(<EOL>"<STR_LIT>".format(self.__class__.__name__, "<STR_LIT>"))<EOL>
Deleter for **self.__headers** attribute.
f13133:c0:m21
def activate(self, engine):
LOGGER.debug("<STR_LIT>".format(self.__class__.__name__))<EOL>self.__engine = engine<EOL>self.__settings = self.__engine.settings<EOL>self.__settings_section = self.name<EOL>self.activated = True<EOL>return True<EOL>
Activates the Component. :param engine: Engine to attach the Component to. :type engine: QObject :return: Method success. :rtype: bool
f13133:c0:m22
def deactivate(self):
LOGGER.debug("<STR_LIT>".format(self.__class__.__name__))<EOL>self.__engine = None<EOL>self.__settings = None<EOL>self.__settings_section = None<EOL>self.activated = False<EOL>return True<EOL>
Deactivates the Component. :return: Method success. :rtype: bool
f13133:c0:m23
def initialize_ui(self):
LOGGER.debug("<STR_LIT>".format(self.__class__.__name__))<EOL>self.Trace_Modules_Filter_lineEdit = Search_QLineEdit(self)<EOL>self.Trace_Modules_Filter_lineEdit.search_active_label.hide()<EOL>self.Trace_Modules_Filter_lineEdit.setPlaceholderText("<STR_LIT>")<EOL>self.Trace_Modules_Filter_horizontalLayout.addWidget(self.Trace_Modules_Filter_lineEdit)<EOL>self.__model = ModulesModel(self, horizontal_headers=self.__headers)<EOL>self.Modules_treeView.setParent(None)<EOL>self.Modules_treeView = Modules_QTreeView(self, self.__model)<EOL>self.Modules_treeView.setObjectName("<STR_LIT>")<EOL>self.Modules_treeView.setContextMenuPolicy(Qt.ActionsContextMenu)<EOL>self.Trace_Ui_dockWidgetContents_gridLayout.addWidget(self.Modules_treeView, <NUM_LIT:0>, <NUM_LIT:0>)<EOL>self.__view = self.Modules_treeView<EOL>self.__view_add_actions()<EOL>self.set_modules()<EOL>self.refresh_nodes.connect(self.__model__refresh_nodes)<EOL>self.initialized_ui = True<EOL>return True<EOL>
Initializes the Component ui. :return: Method success. :rtype: bool
f13133:c0:m24
def uninitialize_ui(self):
LOGGER.debug("<STR_LIT>".format(self.__class__.__name__))<EOL>self.refresh_nodes.disconnect(self.__model__refresh_nodes)<EOL>self.__view_remove_actions()<EOL>self.__model = None<EOL>self.__view = None<EOL>self.initialized_ui = False<EOL>return True<EOL>
Uninitializes the Component ui. :return: Method success. :rtype: bool
f13133:c0:m25
def add_widget(self):
LOGGER.debug("<STR_LIT>".format(self.__class__.__name__))<EOL>self.__engine.addDockWidget(Qt.DockWidgetArea(self.__dock_area), self)<EOL>return True<EOL>
Adds the Component Widget to the engine. :return: Method success. :rtype: bool
f13133:c0:m26
def remove_widget(self):
LOGGER.debug("<STR_LIT>".format(self.__class__.__name__))<EOL>self.__engine.removeDockWidget(self)<EOL>self.setParent(None)<EOL>return True<EOL>
Removes the Component Widget from the engine. :return: Method success. :rtype: bool
f13133:c0:m27
def __model__refresh_nodes(self):
self.set_modules()<EOL>
Defines the slot triggered by the Model when Nodes need refresh.
f13133:c0:m28
def __model__refresh_attributes(self):
for node in foundations.walkers.nodes_walker(self.__model.root_node):<EOL><INDENT>if foundations.trace.is_traced(node.module) == node.traced.value:<EOL><INDENT>continue<EOL><DEDENT>node.update_node_attributes()<EOL><DEDENT>
Refreshes the Model Nodes attributes.
f13133:c0:m29
def __view_add_actions(self):
self.__view.addAction(self.__engine.actions_manager.register_action(<EOL>"<STR_LIT>",<EOL>slot=self.__view_trace_modules_action__triggered))<EOL>self.__view.addAction(self.__engine.actions_manager.register_action(<EOL>"<STR_LIT>",<EOL>slot=self.__view_untrace_modules_action__triggered))<EOL>
Sets the View actions.
f13133:c0:m30
def __view_remove_actions(self):
trace_modules_action = "<STR_LIT>"<EOL>untrace_modules_action = "<STR_LIT>"<EOL>for action in (trace_modules_action, untrace_modules_action):<EOL><INDENT>self.__view.removeAction(self.__engine.actions_manager.get_action(action))<EOL>self.__engine.actions_manager.unregister_action(action)<EOL><DEDENT>
Removes the View actions.
f13133:c0:m31
def __view_trace_modules_action__triggered(self, checked):
pattern = foundations.strings.to_string(self.Trace_Modules_Filter_lineEdit.text()) or r"<STR_LIT>"<EOL>flags = re.IGNORECASE if self.Case_Sensitive_Matching_pushButton.isChecked() else <NUM_LIT:0><EOL>return self.trace_modules(self.get_selected_modules(), pattern, flags)<EOL>
Defines the slot triggered by **'Actions|Umbra|Components|addons.trace_ui|Trace Module(s)'** action. :param checked: Action checked state. :type checked: bool :return: Method success. :rtype: bool
f13133:c0:m32
def __view_untrace_modules_action__triggered(self, checked):
return self.untrace_modules(self.get_selected_modules())<EOL>
Defines the slot triggered by **'Actions|Umbra|Components|addons.trace_ui|Untrace Module(s)'** action. :param checked: Action checked state. :type checked: bool :return: Method success. :rtype: bool
f13133:c0:m33
def get_selected_nodes(self):
return self.__view.get_selected_nodes()<EOL>
Returns the View selected nodes. :return: View selected nodes. :rtype: dict
f13133:c0:m34
def get_selected_modules(self):
return [node.module for node in self.get_selected_nodes()]<EOL>
Returns the View selected modules. :return: View selected modules. :rtype: list
f13133:c0:m35
@foundations.exceptions.handle_exceptions(umbra.exceptions.notify_exception_handler,<EOL>foundations.exceptions.UserError)<EOL><INDENT>def trace_modules(self, modules, pattern=r"<STR_LIT>", flags=re.IGNORECASE):<DEDENT>
try:<EOL><INDENT>pattern = re.compile(pattern, flags)<EOL><DEDENT>except Exception:<EOL><INDENT>raise foundations.exceptions.UserError(<EOL>"<STR_LIT>".format(self.__class__.__name__))<EOL><DEDENT>for module in modules:<EOL><INDENT>foundations.trace.trace_module(module, foundations.verbose.tracer, pattern)<EOL><DEDENT>self.__model__refresh_attributes()<EOL>return True<EOL>
Traces given modules using given filter pattern. :param modules: Modules to trace. :type modules: list :param pattern: Matching pattern. :type pattern: unicode :param flags: Matching regex flags. :type flags: int :return: Method success. :rtype: bool
f13133:c0:m36
def untrace_modules(self, modules):
for module in modules:<EOL><INDENT>foundations.trace.untrace_module(module)<EOL><DEDENT>self.__model__refresh_attributes()<EOL>return True<EOL>
Untraces given modules. :param modules: Modules to untrace. :type modules: list :return: Method success. :rtype: bool
f13133:c0:m37
def get_modules(self):
return foundations.trace.REGISTERED_MODULES<EOL>
Sets the registered Modules. :return: Registered modules. :rtype: list
f13133:c0:m38
def set_modules(self, modules=None):
node_flags = int(Qt.ItemIsSelectable | Qt.ItemIsEnabled)<EOL>modules = modules or self.get_modules()<EOL>root_node = umbra.ui.nodes.DefaultNode(name="<STR_LIT>")<EOL>for module in modules:<EOL><INDENT>module_node = ModuleNode(module=module,<EOL>name=foundations.strings.to_string(module.__name__),<EOL>parent=root_node,<EOL>node_flags=node_flags,<EOL>attributes_flags=int(Qt.ItemIsSelectable | Qt.ItemIsEnabled))<EOL><DEDENT>root_node.sort_children()<EOL>self.__model.initialize_model(root_node)<EOL>return True<EOL>
Sets the modules Model nodes. :param modules: Modules to set. :type modules: list :return: Method success. :rtype: bool
f13133:c0:m39
def __init__(self, parent=None, root_node=None, horizontal_headers=None, vertical_headers=None, default_node=None):
LOGGER.debug("<STR_LIT>".format(self.__class__.__name__))<EOL>umbra.ui.models.GraphModel.__init__(<EOL>self, parent, root_node, horizontal_headers, vertical_headers, default_node)<EOL>
Initializes the class. :param parent: Object parent. :type parent: QObject :param root_node: Root node. :type root_node: AbstractCompositeNode :param horizontal_headers: Headers. :type horizontal_headers: OrderedDict :param vertical_headers: Headers. :type vertical_headers: OrderedDict :param default_node: Default node. :type default_node: GraphModelNode
f13134:c0:m0
def initialize_model(self, root_node):
LOGGER.debug("<STR_LIT>".format(root_node))<EOL>self.beginResetModel()<EOL>self.root_node = root_node<EOL>self.enable_model_triggers(True)<EOL>self.endResetModel()<EOL>return True<EOL>
Initializes the Model using given root node. :param root_node: Graph root node. :type root_node: DefaultNode :return: Method success :rtype: bool
f13134:c0:m1
def __init__(self, parent=None, name=None, *args, **kwargs):
LOGGER.debug("<STR_LIT>".format(self.__class__.__name__))<EOL>super(TCPClientUi, self).__init__(parent, name, *args, **kwargs)<EOL>self.deactivatable = True<EOL>self.__engine = None<EOL>self.__settings = None<EOL>self.__settings_section = None<EOL>self.__preferences_manager = None<EOL>self.__script_editor = None<EOL>self.__address = foundations.common.get_host_address()<EOL>self.__port = <NUM_LIT><EOL>self.__file_command = "<STR_LIT>"<EOL>self.__connection_end = "<STR_LIT>"<EOL>
Initializes the class. :param parent: Object parent. :type parent: QObject :param name: Component name. :type name: unicode :param \*args: Arguments. :type \*args: \* :param \*\*kwargs: Keywords arguments. :type \*\*kwargs: \*\*
f13135:c0:m0
@property<EOL><INDENT>def engine(self):<DEDENT>
return self.__engine<EOL>
Property for **self.__engine** attribute. :return: self.__engine. :rtype: QObject
f13135:c0:m1
@engine.setter<EOL><INDENT>@foundations.exceptions.handle_exceptions(foundations.exceptions.ProgrammingError)<EOL>def engine(self, value):<DEDENT>
raise foundations.exceptions.ProgrammingError(<EOL>"<STR_LIT>".format(self.__class__.__name__, "<STR_LIT>"))<EOL>
Setter for **self.__engine** attribute. :param value: Attribute value. :type value: QObject
f13135:c0:m2
@engine.deleter<EOL><INDENT>@foundations.exceptions.handle_exceptions(foundations.exceptions.ProgrammingError)<EOL>def engine(self):<DEDENT>
raise foundations.exceptions.ProgrammingError(<EOL>"<STR_LIT>".format(self.__class__.__name__, "<STR_LIT>"))<EOL>
Deleter for **self.__engine** attribute.
f13135:c0:m3
@property<EOL><INDENT>def settings(self):<DEDENT>
return self.__settings<EOL>
Property for **self.__settings** attribute. :return: self.__settings. :rtype: QSettings
f13135:c0:m4
@settings.setter<EOL><INDENT>@foundations.exceptions.handle_exceptions(foundations.exceptions.ProgrammingError)<EOL>def settings(self, value):<DEDENT>
raise foundations.exceptions.ProgrammingError(<EOL>"<STR_LIT>".format(self.__class__.__name__, "<STR_LIT>"))<EOL>
Setter for **self.__settings** attribute. :param value: Attribute value. :type value: QSettings
f13135:c0:m5
@settings.deleter<EOL><INDENT>@foundations.exceptions.handle_exceptions(foundations.exceptions.ProgrammingError)<EOL>def settings(self):<DEDENT>
raise foundations.exceptions.ProgrammingError(<EOL>"<STR_LIT>".format(self.__class__.__name__, "<STR_LIT>"))<EOL>
Deleter for **self.__settings** attribute.
f13135:c0:m6
@property<EOL><INDENT>def settings_section(self):<DEDENT>
return self.__settings_section<EOL>
Property for **self.__settings_section** attribute. :return: self.__settings_section. :rtype: unicode
f13135:c0:m7
@settings_section.setter<EOL><INDENT>@foundations.exceptions.handle_exceptions(foundations.exceptions.ProgrammingError)<EOL>def settings_section(self, value):<DEDENT>
raise foundations.exceptions.ProgrammingError(<EOL>"<STR_LIT>".format(self.__class__.__name__, "<STR_LIT>"))<EOL>
Setter for **self.__settings_section** attribute. :param value: Attribute value. :type value: unicode
f13135:c0:m8
@settings_section.deleter<EOL><INDENT>@foundations.exceptions.handle_exceptions(foundations.exceptions.ProgrammingError)<EOL>def settings_section(self):<DEDENT>
raise foundations.exceptions.ProgrammingError(<EOL>"<STR_LIT>".format(self.__class__.__name__, "<STR_LIT>"))<EOL>
Deleter for **self.__settings_section** attribute.
f13135:c0:m9
@property<EOL><INDENT>def preferences_manager(self):<DEDENT>
return self.__preferences_manager<EOL>
Property for **self.__preferences_manager** attribute. :return: self.__preferences_manager. :rtype: QWidget
f13135:c0:m10
@preferences_manager.setter<EOL><INDENT>@foundations.exceptions.handle_exceptions(foundations.exceptions.ProgrammingError)<EOL>def preferences_manager(self, value):<DEDENT>
raise foundations.exceptions.ProgrammingError(<EOL>"<STR_LIT>".format(self.__class__.__name__, "<STR_LIT>"))<EOL>
Setter for **self.__preferences_manager** attribute. :param value: Attribute value. :type value: QWidget
f13135:c0:m11
@preferences_manager.deleter<EOL><INDENT>@foundations.exceptions.handle_exceptions(foundations.exceptions.ProgrammingError)<EOL>def preferences_manager(self):<DEDENT>
raise foundations.exceptions.ProgrammingError(<EOL>"<STR_LIT>".format(self.__class__.__name__, "<STR_LIT>"))<EOL>
Deleter for **self.__preferences_manager** attribute.
f13135:c0:m12