Selasa, 25 Januari 2011

Martin Pitt: Na zdraví PyGI!

Last week I was in Prague to attend the GNOME/Python 2011 Hackfest for gobject-introspection, to which Tomeu Vizoso kindly invited me after I started working with PyGI some months ago. It happened at a place called brmlab which was quite the right environment for a bunch of 9 hackers: Some comfy couches and chairs, soldering irons, lots of old TV tubes, chips, and other electronics, a big Pirate flag, really good Wifi, plenty of Club Mate and Coke supplies, and not putting unnecessary effort into mundane things like wallpapers.


It was really nice to get to know the upstream experts John (J5) Palmieri and Tomeu Vizoso. When sitting together in a room, fully focussing on this area for a full week, it’s so much easier to just ask them about something and getting things done and into upstream than on IRC or bugzilla, where you don’t know each other personally. I certainly learned a lot this week (and not only how great Czech beer tastes :-) )!


So what did I do?


Application porting


After already having ported four Ubuntu PyGTK applications to GI before (apport, jockey, aptdaemon, and language-selector),

my main goal and occupation during this week was to start porting a bigger PyGTK application. I picked system-config-printer, as it’s two magnitudes bigger than the previous projects, exercises quite a lot more of the GTK GI bindings, and thus also exposes a lot more GTK annotation and pygobject bugs. This resulted in a new pygi s-c-p branch which has the first 100 rounds of “test, break, fix” iterations. It now at least starts, and you can do a number of things with it, but a lot of functionality is still broken.


As a kind of “finger exercise” and also to check for how well pygi-convert works for small projects now, I also ported computer-janitor. This went really well (I had it working after about 30 minutes), and also led me to finally fixing the unicode vs. str mess for GtkTreeView that you got so far with Python 2.x.


pygobject and GTK fixes


Porting system-config-printer and computer-janitor uncovered a lot of opportunities to improve pygi-convert.sh, a big “perl -e” kind of script to do the mechanical grunt work of the porting process. It doesn’t fix up changed signatures (such as adding missing arguments which were default arguments in PyGTK, or the ubiquitous “user_data” argument for signal handlers), but at least it gets a lot of namespaces, method, and constant names right.


I also fixed three annotation fixes in GTK+. We also collaboratively reviewed and tested Pavel’s annotation branch which helped to fix tons of problems, especially after Steve Frécinaux’s excellent reference leak fix, so if you play around with current pygobject git head, you really also have to use the current GTK+ git head.


Speaking of which, if you want to port applications and always stay on top of the pygobject/GTK development without having to clutter your package system with “make install”s of those, it works very well to have this in your ~/.bashrc:


export GI_TYPELIB_PATH=$HOME/projects/gtk/gtk:$HOME/projects/gtk/gdk
export PYTHONPATH=$HOME/projects/pygobject

Better GVariant/GDBus support


The GNOME world is moving from the old dbus-glib python bindings to GDBus, which is integrated into GLib. However, dbus-python exposed a really nice and convenient way of doing D-Bus calls, while using GDBus from Python was hideously complicated, especially for nontrivial arguments with empty or nested arrays:


from gi.repository import Gio, GLib
from gi._gi import variant_type_from_string

d = Gio.bus_get_sync(Gio.BusType.SESSION, None)
notify = Gio.DBusProxy.new_sync(d, 0, None, 'org.freedesktop.Notifications',
'/org/freedesktop/Notifications', 'org.freedesktop.Notifications', None)

vb = GLib.VariantBuilder()
vb.init(variant_type_from_string('r'))
vb.add_value(GLib.Variant('s', 'test'))
vb.add_value(GLib.Variant('u', 1))
vb.add_value(GLib.Variant('s', 'gtk-ok'))
vb.add_value(GLib.Variant('s', 'Hello World!'))
vb.add_value(GLib.Variant('s', 'Subtext'))
# add an empty array
eavb = GLib.VariantBuilder()
eavb.init(variant_type_from_string('as'))
vb.add_value(eavb.end())
# add an empty dict
eavb = GLib.VariantBuilder()
eavb.init(variant_type_from_string('a{sv}'))
vb.add_value(eavb.end())
vb.add_value(GLib.Variant('i', 10000))
args = vb.end()

result = notify.call_sync('Notify', args, 0, -1, None)
id = result.get_child_value(0).get_uint32()
print id

So I went to making the GLib.Variant constructor work properly with nested types and boxed variants, adding Pythonic GVariant iterators and indexing (so that you can treat GVariant dictionaries/arrays/tuples just like their Python equivalents), and finally a Variant.unpack() method for converting the return value of a D-Bus call back into a native Python data type. This looks a lot friendlier now:


from gi.repository import Gio, GLib

d = Gio.bus_get_sync(Gio.BusType.SESSION, None)
notify = Gio.DBusProxy.new_sync(d, 0, None, 'org.freedesktop.Notifications',
'/org/freedesktop/Notifications', 'org.freedesktop.Notifications', None)

args = GLib.Variant('(susssasa{sv}i)', 'test', 1, 'gtk-ok', 'Hello World!',
'Subtext', [], {}, 10000)
result = notify.call_sync('Notify', args, 0, -1, None)
id = result.unpack()[0]
print id

I also prepared another patch in GNOME#640181 which will provide the icing on the cake, i. e. handle the variant building/unpacking transparently and make the explicit call_sync() unnecessary:


from gi.repository import Gio, GLib

d = Gio.bus_get_sync(Gio.BusType.SESSION, None)
notify = Gio.DBusProxy.new_sync(d, 0, None, 'org.freedesktop.Notifications',
'/org/freedesktop/Notifications', 'org.freedesktop.Notifications', None)

result = notify.Notify('(susssasa{sv}i)', 'test', 1, 'gtk-ok', 'Hello World!',
'Subtext', [], {}, 10000)
print result[0]

I hope that I can get this reviewed and land this soon.



Thanks to our sponsors!


Many thanks to the GNOME Foundation and Collabora for sponsoring this event!

The Fridge: User Days January 29-30 Schedule

On the weekend of January 29-30th we will be hosting our 3rd Ubuntu User Days event in #ubuntu-classroom on irc.freenode.net (#ubuntu-classroom-chat for questions).

All times in the timetable are in UTC, click the time to find out your local time.

Saturday, January 29th

Time (UTC)SubjectPresenter
08:30Introduction to User Daynigelb, pleia2, nhandler
09:00Software Installationshrini
10:00Networking and sharing files in Ubuntudnivra
11:00Cloud for usersDaviey
12:00Ubuntu Oneralsina
13:00Finding Help in Ubuntustarcraftman
14:00How to fix a broken machinepopey
15:00Switching from OS Xaveilleux
16:00Tips and tricks for multi-bootersCheri703
17:00Inkscape Introductiondoctormo
18:00Command Line Email Clients for Ubuntu_marx_
19:00Using IRCIdleOne
20:00Accessibility appsPendulum
21:00Desktop Environments: Gnome, KDE, XFCEmaco and pleia2
22:00Command Line Basicsimbrandon
23:00Asking questions on Launchpad and Reporting bugs on Launchpadcharlie-tca

Sunday, January 30th

Time (UTC)SubjectPresenter
00:00Switching from Windowscprofitt
01:00Entertaining and educating kids using UbuntuMichelleQ
02:00Linux Security Mythmaco
03:00Unityjcastro and Dbo
04:00What’s cooking in Ubuntujcastro

For more information about User Days, including any last-minute adjustments to our schedule, please see our wiki page:

https://wiki.ubuntu.com/UserDays

Originally posted by Elizabeth Krumbach here on January 24, 2011 at 17:52

Edubuntu: Edubuntu on YouTube

Edubuntu on YouTube


Last year Edubuntu jumped on the bandwagon and signed up for a channel on YouTube. We found some Edubuntu related videos and added them as favourites. Favourite videos appears in our profile so that anyone who visits our profile page will see them.


We thought it might be a good idea to round up some videos in a blog entry for people who don't actively follow YouTube. More importantly, if you know of some videos who should add as favourites on our channel, please point them out!


The Videos


Screencasts:



Bernadette Rego has a series of video FOSS4Educators tutorials that cover applications in Edubuntu. Sound quality could be better but otherwise her screencasts are great, here are some of them:



People who use Edubuntu:



Conference



The OpenSourceSchools channel is part of the UK BECTA initiative designed to promote the use of Open Source Software in the UK. Here are some videos that was uploaded from BETT that is relevant to Ubuntu/Edubuntu and the software we ship:



We love videos


We welcome your video contributions! If you'd like to create any Edubuntu videos, whether they are screencasts, documentation, demos, general discussion, talks or reviews then we'll be happy to feature it on our channel. Simple add the Edubuntu Project user as a friend and send a message!


read more

FCM#44 is HERE!

FCM#44 is HERE!: "This is it folks, the last issue of Full Circle… … last issue of 2010 that is! Get it while it’s hot! - http://fullcirclemagazine.org/issue-44/ This month: Command and Conquer. How-To : Program in Python – Part 18, Backup with Wubi & Link Shortening with Phurl. Review – Unetbootin. Top 5 – BitTorrent Clients. plus: Interviews, [...]"

Usability in Ireland - Gerry Gaffney interviews Morgan McKeagney

Usability in Ireland - Gerry Gaffney interviews Morgan McKeagney: "







Gerry Gaffney interviews Morgan McKeagney. For a transcript of this and other episodes, visit www.uxpod.com.



UIEtips: A Look Back at 3 of Our Most Popular UIE Articles of 2010

Happy New Year! We know a new year means looking forward and moving on to new adventures, challenges, and opportunities. But we’re glancing back at 2010 and sharing three of our most popular articles from 2010. Even in a few years, I think these articles will stand the test of time and still provide valuable insights to help you and your team with UX design.


Today, we’ll take a look back at:



  • How to Create a UX Design Library. Nathan Curtis of EightShapes walks us through the process of creating a library. He’s broken it down into four doable steps (and even has a fabulous poster-grade visualization of the process).

  • Five Indispensable Skills for UX Mastery. Here I explain five essential skills a UX designer needs to be really excellent at what they do.

  • Why We Sketch. In this article, I discuss how great designers use sketching for note taking, to convey their ideas in meetings, to record their conversations with their co-workers, and to support their design research.


We have big things planned for you in 2011. We’re working on some awesome new podcasts, articles, events, and virtual seminars to share with you throughout the year. Tell us how you’ll make design decisions in 2011. Share your thoughts with us below.

SpoolCast: Kim Goodwin’s “Getting Design Into the Corporate DNA” UI15 Session Sample

Duration: 11m | 6 MB

Recorded: November, 2010

[ Subscribe to our podcast via Use iTunes to subscribe to UIE's RSS feed. ←This link will launch the iTunes application.]

[ Subscribe with other podcast applications.]


Design has made a lot of progress in the corporate landscape over the past decade, but many designers still find themselves justifying their existence on a fairly regular basis. Most companies, even those who claim to value design, aren’t taking full advantage of what design can offer them.


In Kim Goodwin’s talk, “Getting Design Into the Corporate DNA” from the 2010 User Interface Conference, she explains that it’s a matter of changing the culture of your organization. Kim understands that this is one of the most complex design problems you will ever have to face, but she can also tell you how to set it in motion.


One of the issues, as Kim points out, is that most businesses have a unit efficiency focus. This causes people to look inward and not share responsibility. It ends up promoting a lack of cooperation as turf wars develop and people begin competing for resources to ensure that their unit, department, or team is doing well rather than the company as a whole. This creates silos within the organization.


This slide illustrates courtesy focus versus unit-efficiency focus


The alternative is a user-centered focus, but getting to that point isn’t easy. Kim concedes, shifting the way the entire company thinks is a daunting prospect. But she offers that organizational change is actually, in fact, individual change. She says to think of organizational change like moving a series of pebbles and boulders instead of the entire mountain. The organization is made up of individuals and shifting the organization is a matter of moving those individuals.


This slide illustrates the idea of moving the rocks in your organization


But it could be even more attainable than that. As Kim says, “Think about starting an avalanche. If you roll the right rock down the hill, it’s going to start taking others with it. You don’t personally have to touch every rock.” She encourages you to seek out the most influential “rocks” in your organization.


In order to bring change about, you need to be persuasive. Kim mentions that one of the greatest tools of persuasion is the users. She says that getting executives in front of users more often is one of the best ways to get them to begin to think differently about design. The more user exposure that you can get the more they will see the benefit of the design process.


You can also look for teachable moments. By that she means, look for a way to convey any unhappiness or dissatisfaction that your users may have. Then show how design can help improve the problem and give a clear way from Point A to Point B. In the end, it’s human nature to view change as loss. Exhibiting how design can improve things will help alleviate that sense of loss.


A pseudo equation to explain the sense of loss


The audio to Kim’s full talk is available for purchase with all seven other Featured Talks from the conference as part of UI15 OnDemand. Also included are the handouts and presentation slides from the talks as well as the slides from the each presenters’ full day workshop. Get more information or place your order for UI15 OnDemand.


Have you experienced difficulty illustrating design’s value in your organization? Feel free to share your experiences in the comments section.