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

Side by Side Diff: third_party/twisted_8_1/twisted/internet/glib2reactor.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
2 """
3 This module provides support for Twisted to interact with the glib mainloop.
4 This is like gtk2, but slightly faster and does not require a working
5 $DISPLAY. However, you cannot run GUIs under this reactor: for that you must
6 use the gtk2reactor instead.
7
8 In order to use this support, simply do the following::
9
10 | from twisted.internet import glib2reactor
11 | glib2reactor.install()
12
13 Then use twisted.internet APIs as usual. The other methods here are not
14 intended to be called directly.
15
16 When installing the reactor, you can choose whether to use the glib
17 event loop or the GTK+ event loop which is based on it but adds GUI
18 integration.
19
20 Maintainer: U{Itamar Shtull-Trauring<mailto:twisted@itamarst.org>}
21 """
22
23 from twisted.internet import gtk2reactor
24
25
26
27 class Glib2Reactor(gtk2reactor.Gtk2Reactor):
28 """
29 The reactor using the glib mainloop.
30 """
31
32 def __init__(self):
33 """
34 Override init to set the C{useGtk} flag.
35 """
36 gtk2reactor.Gtk2Reactor.__init__(self, useGtk=False)
37
38
39
40 def install():
41 """
42 Configure the twisted mainloop to be run inside the glib mainloop.
43 """
44 reactor = Glib2Reactor()
45 from twisted.internet.main import installReactor
46 installReactor(reactor)
47
48 __all__ = ['install']
49
OLDNEW
« no previous file with comments | « third_party/twisted_8_1/twisted/internet/fdesc.py ('k') | third_party/twisted_8_1/twisted/internet/gtk2reactor.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698