Merge lp:~chrisccoulson/lernid/no-mozembed into lp:lernid

Proposed by Chris Coulson
Status: Merged
Merged at revision: 226
Proposed branch: lp:~chrisccoulson/lernid/no-mozembed
Merge into: lp:lernid
Diff against target: 131 lines (+18/-12)
7 files modified
debian/control (+0/-1)
lernid/AboutLernidDialog.py (+1/-1)
lernid/lernidconfig.py (+2/-0)
lernid/widgets/Classroom.py (+0/-1)
lernid/widgets/IrcWidget.py (+11/-4)
lernid/widgets/NativeChatroom.py (+0/-1)
lernid/widgets/WebChatroom.py (+4/-4)
To merge this branch: bzr merge lp:~chrisccoulson/lernid/no-mozembed
Reviewer Review Type Date Requested Status
John S. Gruber Pending
Review via email: mp+64106@code.launchpad.net

Description of the change

lernid depends on python-gtkmozembed, which is being dropped from Ubuntu (see https://blueprints.launchpad.net/ubuntu/+spec/desktop-o-mozilla-rapid-release-maintenance). This ports the remaining gtkmozembed part to webkit

To post a comment you must log in.
Revision history for this message
John S. Gruber (jsjgruber) wrote :

Thanks for keeping us in mind as the mozilla software changes. I'm not aware of all you are doing as part of rapid development, but I don't see any problem with removing the dependency--that was on my list to do as well as we are now using webkit for our embeded web browser.

How urgent is this dependency change? In particular, can it wait until late August or should it be done now?

I don't see the exception at build time you were referring to wrt cursors. Can you point it out to me? On occasion I have seen an exception at lernid start-up. I'd like to know what I'm missing in the build, however, if you can spare the time to explain it.

I'm afraid I don't understand the point of the gettext changes. I must be missing something here. The change you propose seems to redefine the gettext call in lernidconfig.py to be the identity function which would remove the DESCRIPTION translation from the about box. I built this merge and tested the about box while running lernid with LANGUAGE=fr lernid -v and, indeed, the description mistakenly goes from french to english. I don't understand adding the gettext import to the AboutLearnidDialog.py either, I'm afraid.

I'm afraid my questions may not be very intelligent ones, so please excuse me. I certainly appreciate your attention to lernid and I'm grateful for your time.

lp:~chrisccoulson/lernid/no-mozembed updated
227. By Chris Coulson

Fix the translation in the about dialog

Revision history for this message
Chris Coulson (chrisccoulson) wrote :
Download full text (3.8 KiB)

Oops, yes I broke the translations in the about dialog. Sorry. I've fixed that now. The reason for that change is because I get this when I try to build it on oneiric:

cd . && \
  python2.6 setup.py clean \
  -a
running clean
'build/lib.linux-x86_64-2.6' does not exist -- can't clean it
'build/bdist.linux-x86_64' does not exist -- can't clean it
'build/scripts-2.6' does not exist -- can't clean it
WARNING: the following files are not recognized by DistUtilsExtra.auto:
  Copyright
  lernid.desktop.in
  po/lernid.pot
rm -rf debian/python-module-stampdir
find "/home/chr1s/src/lernid/lernid" -name '*.py[co]' -delete
find "/home/chr1s/src/lernid/lernid" -name __pycache__ -type d -empty -delete
find "/home/chr1s/src/lernid/lernid" -prune -name '*.egg-info' -exec rm -rf '{}' ';'
 debian/rules build
test -x debian/rules
mkdir -p "."
mkdir -p debian/python-module-stampdir
cd . && \
  python2.6 setup.py build \
  --build-base="/home/chr1s/src/lernid/lernid/./build"
/usr/lib/python2.6/dist-packages/gtk-2.0/gtk/__init__.py:57: GtkWarning: could not open display
  warnings.warn(str(e), _gtk.Warning)
ERROR: Python module lernid.CouchDBPreferences not found
Traceback (most recent call last):
  File "setup.py", line 86, in <module>
    'install': InstallAndUpdateDataDirectory
  File "/usr/lib/python2.6/dist-packages/DistUtilsExtra/auto.py", line 96, in setup
    __requires(attrs, src_all)
  File "/usr/lib/python2.6/dist-packages/DistUtilsExtra/auto.py", line 414, in __requires
    __add_imports(imports, s, attrs)
  File "/usr/lib/python2.6/dist-packages/DistUtilsExtra/auto.py", line 361, in __add_imports
    if __external_mod(cur_module, node.module, attrs):
  File "/usr/lib/python2.6/dist-packages/DistUtilsExtra/auto.py", line 315, in __external_mod
    mod = __import__(module)
  File "/home/chr1s/src/lernid/lernid/lernid/LernidOptions.py", line 23, in <module>
    from lernid.lernidconfig import VERSION
  File "/home/chr1s/src/lernid/lernid/lernid/lernidconfig.py", line 33, in <module>
    DESCRIPTION = _('Connect to a world of online tutorials quickly and easily.')
NameError: name '_' is not defined
make: *** [debian/python-module-stampdir/lernid] Error 1

Also, the GdkCursor change is required to fix this issue (also at build time), which occurs because there is no DISPLAY:

cd . && \
  python setup.py build \
  --build-base="/home/chr1s/src/lernid/lernid/./build"
/usr/lib/python2.7/dist-packages/gtk-2.0/gtk/__init__.py:57: GtkWarning: could not open display
  warnings.warn(str(e), _gtk.Warning)
/home/chr1s/src/lernid/lernid/lernid/widgets/IrcWidget.py:33: GtkWarning: IA__gdk_cursor_new_for_display: assertion `GDK_IS_DISPLAY (display)' failed
  hand_cursor = gtk.gdk.Cursor(gtk.gdk.HAND2)
Traceback (most recent call last):
  File "setup.py", line 86, in <module>
    'install': InstallAndUpdateDataDirectory
  File "/usr/lib/python2.7/dist-packages/DistUtilsExtra/auto.py", line 96, in setup
    __requires(attrs, src_all)
  File "/usr/lib/python2.7/dist-packages/DistUtilsExtra/auto.py", line 414, in __requires
    __add_imports(imports, s, attrs)
  File "/usr/lib/python2.7/dist-packages/DistUtilsExtra/auto.py", line 361, in __add_imports
    if __external_m...

Read more...

Revision history for this message
John S. Gruber (jsjgruber) wrote :

So I gather the idea is that DESCRIPTIONS should be untranslated but
the _('something') form is necessary to keep the translation in the
translation system?

Thanks again for pointing out the FTBS issues as well as the
dependency problem. I'm apologize for all the questions.

Revision history for this message
Chris Coulson (chrisccoulson) wrote :

Hi,

Yeah, the identity function in lernidconfig.py is there just ensure that the string ends up in the translation template.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/control'
--- debian/control 2011-03-14 03:20:05 +0000
+++ debian/control 2011-06-15 11:22:58 +0000
@@ -17,7 +17,6 @@
17 ${python:Depends},17 ${python:Depends},
18 telepathy-idle,18 telepathy-idle,
19 python-xdg,19 python-xdg,
20 python-gtkmozembed,
21 python-telepathy,20 python-telepathy,
22 python-webkit,21 python-webkit,
23 python-dbus,22 python-dbus,
2423
=== modified file 'lernid/AboutLernidDialog.py'
--- lernid/AboutLernidDialog.py 2010-02-08 16:49:55 +0000
+++ lernid/AboutLernidDialog.py 2011-06-15 11:22:58 +0000
@@ -47,7 +47,7 @@
47 self.builder = builder47 self.builder = builder
48 self.builder.connect_signals(self)48 self.builder.connect_signals(self)
4949
50 self.set_comments(DESCRIPTION)50 self.set_comments(_(DESCRIPTION))
51 self.set_version(VERSION)51 self.set_version(VERSION)
52 self.set_website(WEBSITE)52 self.set_website(WEBSITE)
53 self.set_authors(CONTRIBUTORS)53 self.set_authors(CONTRIBUTORS)
5454
=== modified file 'lernid/lernidconfig.py'
--- lernid/lernidconfig.py 2011-06-02 04:43:14 +0000
+++ lernid/lernidconfig.py 2011-06-15 11:22:58 +0000
@@ -29,6 +29,8 @@
29import os29import os
30import xdg.BaseDirectory30import xdg.BaseDirectory
3131
32def _(message): return message
33
32VERSION = '0.8.1'34VERSION = '0.8.1'
33DESCRIPTION = _('Connect to a world of online tutorials quickly and easily.')35DESCRIPTION = _('Connect to a world of online tutorials quickly and easily.')
34WEBSITE = 'http://wiki.ubuntu.com/Lernid'36WEBSITE = 'http://wiki.ubuntu.com/Lernid'
3537
=== modified file 'lernid/widgets/Classroom.py'
--- lernid/widgets/Classroom.py 2011-03-14 03:19:11 +0000
+++ lernid/widgets/Classroom.py 2011-06-15 11:22:58 +0000
@@ -19,7 +19,6 @@
1919
20import gtk20import gtk
21import gobject21import gobject
22import gtkmozembed
23import pango22import pango
24import time23import time
2524
2625
=== modified file 'lernid/widgets/IrcWidget.py'
--- lernid/widgets/IrcWidget.py 2010-03-05 00:45:41 +0000
+++ lernid/widgets/IrcWidget.py 2011-06-15 11:22:58 +0000
@@ -30,8 +30,15 @@
3030
31class IrcWidget(Widget):31class IrcWidget(Widget):
3232
33 hand_cursor = gtk.gdk.Cursor(gtk.gdk.HAND2)33 def get_hand_cursor(self):
34 regular_cursor = gtk.gdk.Cursor(gtk.gdk.XTERM)34 if not hasattr(self, "_hand_cursor"):
35 self._hand_cursor = gtk.gdk.Cursor(gtk.gdk.HAND2)
36 return self._hand_cursor
37
38 def get_regular_cursor(self):
39 if not hasattr(self, "_regular_cursor"):
40 self._regular_cursor = gtk.gdk.Cursor(gtk.gdk.XTERM)
41 return self._regular_cursor
3542
36 def do_event_connect(self, event_man, event):43 def do_event_connect(self, event_man, event):
37 self._browser = event_man.get_widget_by_name('browser')44 self._browser = event_man.get_widget_by_name('browser')
@@ -92,9 +99,9 @@
92 int(event.x), int(event.y))99 int(event.x), int(event.y))
93 iter = text_view.get_iter_at_location(x, y)100 iter = text_view.get_iter_at_location(x, y)
94 if (iter.has_tag(tag)):101 if (iter.has_tag(tag)):
95 text_view.get_window(gtk.TEXT_WINDOW_TEXT).set_cursor(self.hand_cursor)102 text_view.get_window(gtk.TEXT_WINDOW_TEXT).set_cursor(self.get_hand_cursor())
96 else:103 else:
97 text_view.get_window(gtk.TEXT_WINDOW_TEXT).set_cursor(self.regular_cursor)104 text_view.get_window(gtk.TEXT_WINDOW_TEXT).set_cursor(self.get_regular_cursor())
98 return False105 return False
99106
100 def _focus_out(self, widget, event):107 def _focus_out(self, widget, event):
101108
=== modified file 'lernid/widgets/NativeChatroom.py'
--- lernid/widgets/NativeChatroom.py 2011-03-14 03:19:11 +0000
+++ lernid/widgets/NativeChatroom.py 2011-06-15 11:22:58 +0000
@@ -20,7 +20,6 @@
2020
21import gtk21import gtk
22import gobject22import gobject
23import gtkmozembed
24import urlparse23import urlparse
25import logging24import logging
26import pango25import pango
2726
=== modified file 'lernid/widgets/WebChatroom.py'
--- lernid/widgets/WebChatroom.py 2010-02-08 16:49:55 +0000
+++ lernid/widgets/WebChatroom.py 2011-06-15 11:22:58 +0000
@@ -19,7 +19,7 @@
1919
20import gtk20import gtk
21import gobject21import gobject
22import gtkmozembed22import webkit
2323
24from lernid.widgets.Widget import Widget24from lernid.widgets.Widget import Widget
2525
@@ -37,7 +37,7 @@
37 Widget.__init__(self, 'chatroom')37 Widget.__init__(self, 'chatroom')
38 scroll = gtk.ScrolledWindow()38 scroll = gtk.ScrolledWindow()
39 scroll.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)39 scroll.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
40 self._chat = gtkmozembed.MozEmbed()40 self._chat = webkit.WebView()
41 scroll.add_with_viewport(self._chat)41 scroll.add_with_viewport(self._chat)
42 self.add(scroll)42 self.add(scroll)
4343
@@ -50,11 +50,11 @@
50 def do_event_connect(self, event_man, event):50 def do_event_connect(self, event_man, event):
51 chatirc = 'http://webchat.freenode.net/?nick={nick}&channels={chans}'.format(51 chatirc = 'http://webchat.freenode.net/?nick={nick}&channels={chans}'.format(
52 nick=event.nick, chans=event.chat)52 nick=event.nick, chans=event.chat)
53 self._chat.load_url(chatirc)53 self._chat.load_uri(chatirc)
54 self._chat.show()54 self._chat.show()
5555
56 def do_event_disconnect(self, event_man, event):56 def do_event_disconnect(self, event_man, event):
57 self._chat.load_url('about:blank')57 self._chat.load_uri('about:blank')
58 self._chat.hide()58 self._chat.hide()
5959
60 def get_input_widget(self):60 def get_input_widget(self):

Subscribers

People subscribed via source and target branches