src/eric7/WebBrowser/SpeedDial/Page.py

Wed, 13 Jul 2022 14:55:47 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Wed, 13 Jul 2022 14:55:47 +0200
branch
eric7
changeset 9221
bf71ee032bb4
parent 9209
b99e7fd55fd3
child 9653
e67609152c5e
permissions
-rw-r--r--

Reformatted the source code using the 'Black' utility.

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

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

"""
Module implementing a structure to hold the data for a speed dial page.
"""


class Page:
    """
    Class to hold the data for a speed dial page.
    """

    def __init__(self, url="", title="", broken=False):
        """
        Constructor

        @param url URL of the page (string)
        @param title title of the page (string)
        @param broken flag indicating a broken connection (boolean)
        """
        self.url = url
        self.title = title
        self.broken = broken

    def __eq__(self, other):
        """
        Special method implementing the equality operator.

        @param other reference to the other page object (Page)
        @return flag indicating equality (boolean)
        """
        return self.title == other.title and self.url == other.url

    def isValid(self):
        """
        Public method to check the validity.

        @return flag indicating a valid object
        @rtype bool
        """
        return bool(self.url)

eric ide

mercurial