eric6/WebBrowser/SpeedDial/Page.py

Sat, 07 Sep 2019 17:35:43 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 07 Sep 2019 17:35:43 +0200
branch
without_py2_and_pyqt4
changeset 7223
2d58b9c1a981
parent 6942
2602857055c5
child 7229
53054eb5b15a
permissions
-rw-r--r--

Closed branch after it was merged into 'default'.

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

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

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


from __future__ import unicode_literals


class Page(object):
    """
    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