Merge lp:~dobey/ubuntuone-dev-tools/add-gireactor into lp:ubuntuone-dev-tools

Proposed by dobey on 2012-01-24
Status: Merged
Approved by: dobey on 2012-01-24
Approved revision: 56
Merged at revision: 56
Proposed branch: lp:~dobey/ubuntuone-dev-tools/add-gireactor
Merge into: lp:ubuntuone-dev-tools
Diff against target: 32 lines (+28/-0)
1 file modified
ubuntuone/devtools/reactors/gi.py (+28/-0)
To merge this branch: bzr merge lp:~dobey/ubuntuone-dev-tools/add-gireactor
Reviewer Review Type Date Requested Status
Natalia Bidart 2012-01-24 Approve on 2012-01-24
Review via email: mp+89965@code.launchpad.net

Commit Message

Add a gi.py in reactors to handle working with new gireactor coming in twisted

Description of the Change

This will be a bit difficult to test at the moment. To test with twisted 11.1 which is currently in Ubuntu 12.04, you will need to apply a patch to use it: http://people.gnome.org/~dobey/twisted-11-1-gireactor.patch

This patch might also apply to 11.0 in Ubuntu 11.10 as well, but no guarantees.

To post a comment you must log in.
Natalia Bidart (nataliabidart) wrote :

Looks and works great.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'ubuntuone/devtools/reactors/gi.py'
2--- ubuntuone/devtools/reactors/gi.py 1970-01-01 00:00:00 +0000
3+++ ubuntuone/devtools/reactors/gi.py 2012-01-24 18:10:29 +0000
4@@ -0,0 +1,28 @@
5+# Copyright 2009-2012 Canonical Ltd.
6+#
7+# This program is free software: you can redistribute it and/or modify it
8+# under the terms of the GNU General Public License version 3, as published
9+# by the Free Software Foundation.
10+#
11+# This program is distributed in the hope that it will be useful, but
12+# WITHOUT ANY WARRANTY; without even the implied warranties of
13+# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
14+# PURPOSE. See the GNU General Public License for more details.
15+#
16+# You should have received a copy of the GNU General Public License along
17+# with this program. If not, see <http://www.gnu.org/licenses/>.
18+"""The introspection based main loop integration reactor for testing."""
19+
20+REACTOR_URL = 'http://twistedmatrix.com/trac/ticket/4558'
21+
22+
23+def install(options=None):
24+ """Install the reactor and parse any options we might need."""
25+ reactor_name = None
26+ if options is not None and options['gui']:
27+ reactor_name = 'twisted.internet.gtk3reactor'
28+ else:
29+ reactor_name = 'twisted.internet.gireactor'
30+
31+ glibreactor = __import__(reactor_name, None, None, [''])
32+ glibreactor.install()

Subscribers

People subscribed via source and target branches

to all changes: