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

Subscribers

People subscribed via source and target branches