Plugins/UiExtensionPlugins/PipInterface/ConfigurationPage/PipPage.py

Tue, 12 Jun 2018 19:01:06 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Tue, 12 Jun 2018 19:01:06 +0200
changeset 6342
c79ecba9cde7
parent 6253
a148632e9610
child 6645
ad476851d7e0
permissions
-rw-r--r--

pip Interface: changed to use the new VirtualEnv Manager

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

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

"""
Package implementing the pip configuration page.
"""

from __future__ import unicode_literals

from Preferences.ConfigurationPages.ConfigurationPageBase import \
    ConfigurationPageBase
from .Ui_PipPage import Ui_PipPage

from .. import DefaultPyPiUrl


class PipPage(ConfigurationPageBase, Ui_PipPage):
    """
    Class implementing the pip configuration page.
    """
    def __init__(self, plugin):
        """
        Constructor
        
        @param plugin reference to the plugin object
        @type PipInterfacePlugin
        """
        super(PipPage, self).__init__()
        self.setupUi(self)
        self.setObjectName("PipPage")
        
        self.__plugin = plugin
        
        self.indexLabel.setText(self.tr(
            '<b>Note:</b> Leave empty to use the default index URL ('
            '<a href="{0}">{0}</a>).')
            .format(DefaultPyPiUrl))
        
        # set initial values
        self.indexEdit.setText(self.__plugin.getPreferences("PipSearchIndex"))
    
    def save(self):
        """
        Public slot to save the pip configuration.
        """
        self.__plugin.setPreferences(
            "PipSearchIndex", self.indexEdit.text().strip())

eric ide

mercurial