Merge lp:~alecu/ubuntu-sso-client/textfilter-quacks into lp:ubuntu-sso-client

Proposed by Alejandro J. Cura
Status: Merged
Approved by: Alejandro J. Cura
Approved revision: 834
Merged at revision: 832
Proposed branch: lp:~alecu/ubuntu-sso-client/textfilter-quacks
Merge into: lp:ubuntu-sso-client
Diff against target: 68 lines (+1/-52)
2 files modified
ubuntu_sso/utils/tests/test_txsecrets.py (+1/-1)
ubuntu_sso/utils/webclient/tests/webclient_demo.py (+0/-51)
To merge this branch: bzr merge lp:~alecu/ubuntu-sso-client/textfilter-quacks
Reviewer Review Type Date Requested Status
dobey (community) Approve
Natalia Bidart (community) Approve
Review via email: mp+88248@code.launchpad.net

Commit message

Fix filter that broke maverick and lucid build; removed demo script that gives lint error

Description of the change

 * filters don't really need to inherit from logging.Filter, they just need to quack like it
 * removed demo script since it gives a lint error when qt4reactor is not installed

To post a comment you must log in.
834. By Alejandro J. Cura

restore call to the parent __init__, even though it's object

Revision history for this message
Alejandro J. Cura (alecu) wrote :

For the record, calling super methods from classes derived from "object" is a good thing, mostly because of multiple inheritance and the MRO.

Revision history for this message
Natalia Bidart (nataliabidart) wrote :

Looks great!

review: Approve
Revision history for this message
dobey (dobey) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ubuntu_sso/utils/tests/test_txsecrets.py'
2--- ubuntu_sso/utils/tests/test_txsecrets.py 2012-01-06 21:05:53 +0000
3+++ ubuntu_sso/utils/tests/test_txsecrets.py 2012-01-11 18:40:29 +0000
4@@ -390,7 +390,7 @@
5 return base + "/" + random
6
7
8-class TextFilter(logging.Filter):
9+class TextFilter(object):
10 """Prevents the logging of messages containing a given text."""
11
12 def __init__(self, *args):
13
14=== removed file 'ubuntu_sso/utils/webclient/tests/webclient_demo.py'
15--- ubuntu_sso/utils/webclient/tests/webclient_demo.py 2012-01-04 21:26:27 +0000
16+++ ubuntu_sso/utils/webclient/tests/webclient_demo.py 1970-01-01 00:00:00 +0000
17@@ -1,51 +0,0 @@
18-# -*- coding: utf-8 -*-
19-#
20-# Copyright 2011 Canonical Ltd.
21-#
22-# This program is free software: you can redistribute it and/or modify it
23-# under the terms of the GNU General Public License version 3, as published
24-# by the Free Software Foundation.
25-#
26-# This program is distributed in the hope that it will be useful, but
27-# WITHOUT ANY WARRANTY; without even the implied warranties of
28-# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
29-# PURPOSE. See the GNU General Public License for more details.
30-#
31-# You should have received a copy of the GNU General Public License along
32-# with this program. If not, see <http://www.gnu.org/licenses/>.
33-
34-"""Sample program that uses the Qt webclient."""
35-
36-import sys
37-from PyQt4 import QtGui
38-# need to create the QApplication before installing the reactor
39-QtGui.QApplication(sys.argv)
40-import qt4reactor
41-qt4reactor.install()
42-
43-from pprint import pprint
44-from ubuntu_sso.utils.webclient import qtnetwork
45-from twisted.internet import defer, reactor
46-
47-
48-@defer.inlineCallbacks
49-def do_web_call():
50- """Wait for the webcall to finish and stop the reactor."""
51- webclient = qtnetwork.WebClient()
52- d = webclient.request(u"http://slashdot.org")
53- try:
54- response = yield d
55- pprint(response.headers.items())
56- finally:
57- reactor.stop()
58-
59-
60-def main():
61- """The main function of this test script."""
62- do_web_call()
63- # pylint: disable=E1101
64- reactor.run()
65-
66-
67-if __name__ == "__main__":
68- main()

Subscribers

People subscribed via source and target branches