Plugins/VcsPlugins/vcsMercurial/HgUserConfigHostFingerprintDialog.py

Sat, 22 Oct 2016 17:09:08 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 22 Oct 2016 17:09:08 +0200
changeset 5264
8bc23ecb4ea3
child 5292
ac8b476ba122
permissions
-rw-r--r--

Finished the refactoring of the Mercurial user config management code.

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

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

"""
Module implementing a dialog to edit a host fingerprint.
"""

from __future__ import unicode_literals

from PyQt5.QtWidgets import QDialog

from .Ui_HgUserConfigHostFingerprintDialog import \
    Ui_HgUserConfigHostFingerprintDialog


class HgUserConfigHostFingerprintDialog(
        QDialog, Ui_HgUserConfigHostFingerprintDialog):
    """
    Class implementing a dialog to edit a host fingerprint.
    """
    def __init__(self, parent=None, host="", fingerprint=""):
        """
        Constructor
        
        @param parent reference to the parent widget
        @type QWidget
        @param host host name
        @type str
        @param fingerprint fingerprint for the host
        @type str
        """
        super(HgUserConfigHostFingerprintDialog, self).__init__(parent)
        self.setupUi(self)
        
        self.hostEdit.setText(host)
        self.fingerprintEdit.setText(fingerprint)
    
    def getData(self):
        """
        Public method to retrieve the data.
        
        @return tuple containig the host name and the fingerprint
        @rtype tuple of two str
        """
        return (
            self.hostEdit.text(),
            self.fingerprintEdit.text(),
        )

eric ide

mercurial