src/eric7/Templates/TemplateSingleVariableDialog.py

Sun, 26 Feb 2023 12:44:03 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sun, 26 Feb 2023 12:44:03 +0100
branch
mpy_network
changeset 9803
2ab3de60b51c
parent 9653
e67609152c5e
child 10431
64157aeb0312
permissions
-rw-r--r--

MicroPython
- fixed an issue checking, if the device data is available

# -*- coding: utf-8 -*-

# Copyright (c) 2005 - 2023 Detlev Offenbach <detlev@die-offenbachs.de>
#

"""
Module implementing a dialog for entering a single template variable.
"""

from PyQt6.QtWidgets import QDialog

from .Ui_TemplateSingleVariableDialog import Ui_TemplateSingleVariableDialog


class TemplateSingleVariableDialog(QDialog, Ui_TemplateSingleVariableDialog):
    """
    Class implementing a dialog for entering a single template variable.
    """

    def __init__(self, variable, parent=None):
        """
        Constructor

        @param variable template variable name (string)
        @param parent parent widget of this dialog (QWidget)
        """
        super().__init__(parent)
        self.setupUi(self)

        self.variableLabel.setText(variable)

    def getVariable(self):
        """
        Public method to get the value for the variable.

        @return value for the template variable (string)
        """
        return self.variableEdit.toPlainText()

eric ide

mercurial