PipxInterface/ConfigurationPage/PipxPage.py

Thu, 29 Aug 2024 13:16:22 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Thu, 29 Aug 2024 13:16:22 +0200
changeset 63
4b38c24b15dd
parent 32
b7a3ae7519ba
child 83
d841c572a465
permissions
-rw-r--r--

Corrected some source code documentation.

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

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

"""
Module implementing the pipx configuration page.
"""

from eric7 import Preferences
from eric7.Preferences.ConfigurationPages.ConfigurationPageBase import (
    ConfigurationPageBase,
)

from .Ui_PipxPage import Ui_PipxPage


class PipxPage(ConfigurationPageBase, Ui_PipxPage):
    """
    Class implementing the pipx configuration page.
    """

    def __init__(self, plugin):
        """
        Constructor

        @param plugin reference to the plugin object
        @type PluginPipxInterface
        """
        super().__init__()
        self.setupUi(self)
        self.setObjectName("PipxPage")

        self.__plugin = plugin

        # set the pip index URL for information only
        self.indexEdit.setText(Preferences.getPip("PipSearchIndex"))

        # set initial values
        self.autoCheckOutdatedCheckBox.setChecked(
            self.__plugin.getPreferences("AutoCheckOutdated")
        )
        self.outdatedDependenciesCheckBox.setChecked(
            self.__plugin.getPreferences("IncludeOutdatedDependencies")
        )
        self.recentWorkdirsSpinBox.setValue(
            self.__plugin.getPreferences("MaxRecentAppWorkdirs")
        )

    def save(self):
        """
        Public slot to save the pipx interface configuration.
        """
        self.__plugin.setPreferences(
            "AutoCheckOutdated", self.autoCheckOutdatedCheckBox.isChecked()
        )
        self.__plugin.setPreferences(
            "IncludeOutdatedDependencies", self.outdatedDependenciesCheckBox.isChecked()
        )
        self.__plugin.setPreferences(
            "MaxRecentAppWorkdirs", self.recentWorkdirsSpinBox.value()
        )

eric ide

mercurial