Helpviewer/SpeedDial/Page.py

Fri, 18 Oct 2013 23:00:41 +0200

author
T.Rzepka <Tobias.Rzepka@gmail.com>
date
Fri, 18 Oct 2013 23:00:41 +0200
branch
Py2 comp.
changeset 3057
10516539f238
parent 2538
b2642e7a4c18
parent 2954
bf0215fe12d1
child 3060
5883ce99ee12
permissions
-rw-r--r--

Merge with default branch after shorten the code lines to max. 79 characters.

1699
10706f6ad9d2 Changed the speedial to store the data into an XML file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1 # -*- coding: utf-8 -*-
10706f6ad9d2 Changed the speedial to store the data into an XML file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2
2302
f29e9405c851 Updated copyright for 2013.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1699
diff changeset
3 # Copyright (c) 2012 - 2013 Detlev Offenbach <detlev@die-offenbachs.de>
1699
10706f6ad9d2 Changed the speedial to store the data into an XML file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
4 #
10706f6ad9d2 Changed the speedial to store the data into an XML file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
5
10706f6ad9d2 Changed the speedial to store the data into an XML file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
6 """
10706f6ad9d2 Changed the speedial to store the data into an XML file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
7 Module implementing a structure to hold the data for a speed dial page.
10706f6ad9d2 Changed the speedial to store the data into an XML file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
8 """
10706f6ad9d2 Changed the speedial to store the data into an XML file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
9
10706f6ad9d2 Changed the speedial to store the data into an XML file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
10
2525
8b507a9a2d40 Script changes: Future import added, super calls modified and unicode behavior for str.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 2302
diff changeset
11 from __future__ import unicode_literals # __IGNORE_WARNING__
8b507a9a2d40 Script changes: Future import added, super calls modified and unicode behavior for str.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 2302
diff changeset
12
2538
b2642e7a4c18 Fixed a few PEP-8 related issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2525
diff changeset
13
1699
10706f6ad9d2 Changed the speedial to store the data into an XML file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
14 class Page(object):
10706f6ad9d2 Changed the speedial to store the data into an XML file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
15 """
10706f6ad9d2 Changed the speedial to store the data into an XML file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
16 Class to hold the data for a speed dial page.
10706f6ad9d2 Changed the speedial to store the data into an XML file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
17 """
10706f6ad9d2 Changed the speedial to store the data into an XML file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
18 def __init__(self, url="", title="", broken=False):
10706f6ad9d2 Changed the speedial to store the data into an XML file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
19 """
10706f6ad9d2 Changed the speedial to store the data into an XML file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
20 Constructor
10706f6ad9d2 Changed the speedial to store the data into an XML file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
21
10706f6ad9d2 Changed the speedial to store the data into an XML file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
22 @param url URL of the page (string)
10706f6ad9d2 Changed the speedial to store the data into an XML file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
23 @param title title of the page (string)
2954
bf0215fe12d1 Continued correcting doc strings by using the new doc string checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
24 @param broken flag indicating a broken connection (boolean)
1699
10706f6ad9d2 Changed the speedial to store the data into an XML file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
25 """
10706f6ad9d2 Changed the speedial to store the data into an XML file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
26 self.url = url
10706f6ad9d2 Changed the speedial to store the data into an XML file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
27 self.title = title
10706f6ad9d2 Changed the speedial to store the data into an XML file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
28 self.broken = broken
10706f6ad9d2 Changed the speedial to store the data into an XML file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
29
10706f6ad9d2 Changed the speedial to store the data into an XML file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
30 def __eq__(self, other):
10706f6ad9d2 Changed the speedial to store the data into an XML file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
31 """
10706f6ad9d2 Changed the speedial to store the data into an XML file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
32 Public method implementing the equality operator.
10706f6ad9d2 Changed the speedial to store the data into an XML file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
33
10706f6ad9d2 Changed the speedial to store the data into an XML file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
34 @param other reference to the other page object (Page)
10706f6ad9d2 Changed the speedial to store the data into an XML file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
35 @return flag indicating equality (boolean)
10706f6ad9d2 Changed the speedial to store the data into an XML file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
36 """
10706f6ad9d2 Changed the speedial to store the data into an XML file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
37 return self.title == other.title and \
10706f6ad9d2 Changed the speedial to store the data into an XML file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
38 self.url == other.url

eric ide

mercurial