Я пытаюсь закодировать плагин qgis, используя последнюю версию python и qgis 2.18, но продолжаю получать это сообщение об ошибке:
AttributeError: AutomatisationDEPLOIEMENT instance has no attribute 'utilisat_lineEdit'
Это мой код.пожалуйста, помогите мне?
class AutomatisationDEPLOIEMENT:
"""QGIS Plugin Implementation."""
def __init__(self, iface):
"""Constructor.
:param iface: An interface instance that will be passed to this class
which provides the hook by which you can manipulate the QGIS
application at run time.
:type iface: QgisInterface
"""
# Save reference to the QGIS interface
self.iface = iface
# initialize plugin directory
self.plugin_dir = os.path.dirname(__file__)
# initialize locale
locale = QSettings().value('locale/userLocale')[0:2]
locale_path = os.path.join(
self.plugin_dir,
'i18n',
'AutomatisationDEPLOIEMENT_{}.qm'.format(locale))
if os.path.exists(locale_path):
self.translator = QTranslator()
self.translator.load(locale_path)
if qVersion() > '4.3.3':
QCoreApplication.installTranslator(self.translator)
# Declare instance attributes
self.actions = []
self.menu = self.tr(u'&Automatisation DEPLOIEMENT')
# TODO: We are going to let the user set this up in a future iteration
self.toolbar = self.iface.addToolBar(u'AutomatisationDEPLOIEMENT')
self.toolbar.setObjectName(u'AutomatisationDEPLOIEMENT')
... snip ...
def loginCheck(self):
username = self.utilisat_lineEdit.text()
password = self.pass_lineEdit.text()
connection = sqlite3.connect("login.db")
result = connection.execute("SELECT * FROM USERS WHERE USERNAME = ? AND PASSWORD = ?", (username, password))
if (len(result.fetchall()) > 0):
print("User Found ! ")
else:
print("User Not Found !")
self.showMessageBox('Warning', 'Invalid Username And Password')
connection.close()
Я пытаюсь заставить функцию logincheck работать