Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(173)

Side by Side Diff: third_party/twisted_8_1/twisted/plugins/twisted_qtstub.py

Issue 12261012: Remove third_party/twisted_8_1 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 # Copyright (c) 2006 Twisted Matrix Laboratories.
2 # See LICENSE for details.
3
4 """
5 Backwards-compatibility plugin for the Qt reactor.
6
7 This provides a Qt reactor plugin named C{qt} which emits a deprecation
8 warning and a pointer to the separately distributed Qt reactor plugins.
9 """
10
11 import warnings
12
13 from twisted.application.reactors import Reactor, NoSuchReactor
14
15 wikiURL = 'http://twistedmatrix.com/trac/wiki/QTReactor'
16 errorMessage = ('qtreactor is no longer a part of Twisted due to licensing '
17 'issues. Please see %s for details.' % (wikiURL,))
18
19 class QTStub(Reactor):
20 """
21 Reactor plugin which emits a deprecation warning on the successful
22 installation of its reactor or a pointer to further information if an
23 ImportError occurs while attempting to install it.
24 """
25 def __init__(self):
26 super(QTStub, self).__init__(
27 'qt', 'qtreactor', 'QT integration reactor')
28
29
30 def install(self):
31 """
32 Install the Qt reactor with a deprecation warning or try to point
33 the user to further information if it cannot be installed.
34 """
35 try:
36 super(QTStub, self).install()
37 except (ValueError, ImportError):
38 raise NoSuchReactor(errorMessage)
39 else:
40 warnings.warn(
41 "Please use -r qt3 to import qtreactor",
42 category=DeprecationWarning)
43
44
45 qt = QTStub()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698