/srv/irclogs.ubuntu.com/2011/04/12/#ubuntu-classroom.txt

=== mRy is now known as Guest92858
=== mRy is now known as Guest78285
=== mRy is now known as Guest18185
=== mRy is now known as Guest74526
=== mRy is now known as Guest28633
=== rmrf|NA is now known as rmrf
=== _LibertyZero is now known as LibertyZero
=== mRy is now known as Guest90119
=== Atlan is now known as bulldog98_konv
=== mRy is now known as Guest83516
=== mRy is now known as Guest69628
=== jhernandez_afk is now known as jhernandez
=== mRy is now known as Guest7849
=== mRy is now known as Guest56374
=== mRy is now known as Guest91948
=== yofel_ is now known as yofel
=== bregma_ is now known as bregma
=== mRy is now known as Guest38306
=== boulabiar is now known as boulabiar|
=== CodeBlock is now known as CodeBlock_
abmhi14:52
abmtime15:10
=== teckfatt_ is now known as teckfatt
dpmUbuntu App Developer Week - Day 2 starting in ~10 minutes! :-)16:51
pittiClassBot: good day to you!16:54
cdbshi pitti16:55
* cdbs was waiting for this session for a really really long time16:55
dpmWelcome everyone to a new and exciting day of the Ubuntu App Developer Week!17:00
dpmLots of interesting sessions lined up for today17:00
dpmBringing you the best content from the best speakers17:01
=== ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - https://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi || Questions in #ubuntu-classroom-chat || Event: Ubuntu App Developer Week - Current Session: PyGTK is dead, long live PyGI! Using gobject-introspection in Python - Instructors: pitti
dpmCheck out http://ubuntu-news.org/2011/04/12/off-to-a-great-start-ubuntu-app-developer-week-day-1/ if you missed any of the sessions yesterday17:01
ClassBotLogs for this session will be available at http://irclogs.ubuntu.com/2011/04/12/%23ubuntu-classroom.html following the conclusion of the session.17:01
dpmNext up is Martin Pitt, one of the persons who know Ubuntu and its technologies inside out17:02
dpmHe's going to be talking about porting your old PyGTK applications to the new PyGI framework,17:02
dpmso that they can make use of all the awesomeness of introspection.17:02
dpmLet's hand him the mike...17:02
* pitti clears throat17:03
pittiHello everyone! I am Martin Pitt from the Canonical Ubuntu Desktop Team.17:03
pittiPython is a very important and popular language in Ubuntu, we have a lot of applications written in Python for GTK and Qt/KDE. Most prominent examples are our installer Ubiquity, Software Center, our driver installer "Jockey", and our bug/crash reporting system "Apport" (shameless plug!).17:03
pittiBy way of Quickly we also encourage application developers to use Python and GTK, as these allow you to write GUI applications both conveniently, fast, and still rather robust.17:03
pittiSo far the package of choice for that has been PyGTK, a manually maintained Python binding for GTK, ATK, Pango, Glade, and a few other things. However, a few months ago, with the advent of GTK3, PyGTK was declared dead, so it's time to bring the banner of the great new world of its successor -- gobject-introspection -- to the world!17:03
pittiTomeu Vizoso already explained what gobject-introspection (commonly abbreviated "GI") is, why we need it, and how library developers can use it to provide a machine readable and complete API/ABI description. So I'll just do a very brief summary here.17:04
pittiI'll concentrate on the app developer side, i. e. how to use GI typelibs in Python.17:04
pittiPorting existing PyGTK2 code is a topic that will keep many of us busy in the next months, so I'll explain the process and common pitfalls with that.17:04
pittiFinally I'll give some pointers to documentation, and will be available for some Q&A.17:04
pittiEveryone ready to dive in? Please let me know (here or in #-chat) when I become too fast. If I am being totally unclear, please yell and I'll handle that immediately. If you just have a followup question, let's handle these at the end.17:05
pitti== Quick recap: What is GI? ==17:05
pittiSo far a lot of energy was spent to write so-called "bindings", i. e. glue code which exposes an existing API such as GTK for a target language: PyGTK, libnotify-cil, or Vala's .vapi files.17:05
pittiThis both leads to a combinatorial explosion (libraries times languages), as well as many bindings which don't exist at all, or being of low quality. In addition it is also an almost insurmountable barrier for introducing new languages, as they would need a lot of bindings before they become useful.17:05
pittiGI is a set of tools to generate a machine parseable and complete API/ABI description of a library, and a library (libgirepository) which can then be used by a language compiler/interpreter to automatically provide a binding for this library.17:05
pittiWith GI you can then use every library which ships a typelib in every language which has GI support.17:06
pittiGI ABI/API descriptions come in two forms:17:06
pitti * An XML file, called the "GIR" (GI repository). These are mainly interesting for developers if they need to look up a particular detail of e. g. a method argument or an enum value. These are not actually used at runtime (as XML would be too costly to interpret every time), and thus they are shipped in the library's -dev package in Ubuntu and Debian. For example, libgtk2.0-dev ships17:06
pitti/usr/share/gir-1.0/Gdk-2.0.gir.17:06
pitti * A compiled binary form for efficient access, called the "typelib". These are the files that language bindings actually use. Ubuntu/Debian ship them in separate packages named gir<GI_ABI_version>-<libraryname>-<library_ABI_version>, for example, gir1.2-gtk-2.0 ships /usr/lib/girepository-1.0/Gdk-2.0.typelib.17:07
pitti(Yes, it's confusing that the gir1.2-* package does _not_ actually ship the .gir file; don't ask me why they were named "gir-", not "typelib-").17:07
pitti== How does it work in Python? ==17:07
pittipygobject is the piece of software which provides Python access to GI (amongst other things, like providing the glib and GObject bindings).17:07
pittiThe package name in Ubuntu/Debian is "python-gobject", and it should already be installed on all but the most manually trimmed down installations.17:08
pittiInitial GI support was added to pygobject in version 2.19.0 (August 2009), but the entire GI/pygobject/annotations stack really only stabilized in the last couple of months, so that in practice you will need at least pygobject 2.28 and the corresponding latest upstream releases of GTK and other libraries you want to use.17:08
pittiThis means that you can only really use this with distros which are less than about three months old. For Debian/Ubuntu this means you'll need to use the current development versions, i. e. Ubuntu Natty (beta-1) or Debian experimental (most of this wasn't uploaded to unstable yet after the squeeze release).17:08
pittipygobject provides a "gi.repository" module namespace which generates virtual Python modules from installed typelibs on the fly.17:09
pittiFor example, if you install gir1.2-gtk-2.0 (it's already installed by default in Ubuntu Natty), you can do:17:09
pitti  $ python -c 'from gi.repository import Gtk; print Gtk'17:09
pitti  <gi.module.DynamicModule 'Gtk' from '/usr/lib/girepository-1.0/Gtk-2.0.typelib'>17:09
pittiand use it just like any other Python module.17:10
pittiI bet that this first example comes as an absolutely unexpected surprise to you:17:10
pitti  $ python -c 'from gi.repository import Gtk; Gtk.MessageDialog(None, 0, Gtk.MessageType.INFO, Gtk.ButtonsType.CLOSE, "Hello World").run()'17:10
* pitti gives everyone a minute to try this17:10
pittiLet's look at the corresponding C declaration:17:11
pitti  GtkWidget* gtk_message_dialog_new (GtkWindow *parent, GtkDialogFlags flags, GtkMessageType type, GtkButtonsType buttons, const gchar *message_format, ...);17:11
pittiand the C call:17:12
pitti  GtkMessageDialog* msg = gtk_message_dialog_new (NULL, 0, GTK_MESSAGE_INFO, GTK_BUTTONS_CLOSE, "Hello World");17:12
pitti  msg.run()17:12
pittiSo what do we see here?17:12
pitti(1) The C API by and large remains valid in Python (and other languages using the GI bindings), in particular the structure, order, and data types of arguments.17:12
pittiThere are a few exceptions which are mostly due to the different way Python works, and in some cases to make it easier to write code in Python. I'll speak about details below. But this means that you can (and should) use the normal API documentation for the C API of the library. devhelp is your friend!17:13
pitti(2) As Python is a proper object oriented language, pygobject (and in fact the GI typelib already) expose a GObject API as proper classes, objects, methods, and attributes.17:13
pittiI. e. in Python you write17:13
pitti  b = Gtk.Button(...)17:13
pitti  b.set_label("foo")17:13
pittiinstead of the C gobject syntax17:13
pitti  GtkWidget* b = gtk_button_new(...);17:13
pitti  gtk_button_set_label(b, "foo");17:13
pittiThe class names in the typelib (and thus in Python) are derived from the actual class names stated in the C library (like "GtkButton"), except that the common namespace prefix ("Gtk" here) is stripped, as it becomes the name of the module.17:14
pitti(3) Global constants would be a heavy namespace clutter in Python, and thus pygobject exposes them in a namespaced fashion as well.17:14
pittiI. e. if the MessageDialog constructor expects a constant of type "GtkMessageType", then by above namespace split this becomes a Python class "Gtk.MessageType" with the individual constants as attributes, e. g. Gtk.MessageType.INFO.17:14
pitti(This is actually something that pygtk gets quite wrong, the constant names are quite arbitrary there)17:15
pitti(4) Data types are converted in a rather obvious fashion. E. g. when the C API expects an int* array pointer, you can supply a normal Python array [0, 1, 2]. A Python string "foo" will match a gchar*, Pythons None matches NULL, etc.17:15
pittiSo the GObject API actually translates quite naturally into a real OO language like Python, and after some time of getting used to above transformation rules, you should have no trouble translating the C API documentation into their Python equivalents.17:16
pittiWhen in doubt, you can always look for the precise names, data types, etc. in the .gir instead, which shows the API broken by class, method, enum, etc, with the exact names and namespaces as they are exposed in Python.17:16
pittis I mentioned above, this is in no way restricted to GTK, GNOME, or UI. For example, if you handle any kind of hardware and hotplugging, you almost certainly want to query udev, which provides a nice glib integration (with signals) through the gudev library.17:16
pittiThis example lists all block devices (i. e. hard drives, USB sticks, etc.):17:17
pitti(You need to install the gir1.2-gudev-1.0 package for this)17:17
pitti$ python17:17
pitti>>> from gi.repository import GUdev17:17
pitti>>> c = GUdev.Client()17:17
pitti>>> for dev in c.query_by_subsystem("block"):17:18
pitti...     print dev.get_device_file()17:18
pitti...17:18
pitti/dev/sda17:18
pitti/dev/sda117:18
pitti/dev/sda217:18
pitti[...]17:18
pittiSee http://www.kernel.org/pub/linux/utils/kernel/hotplug/gudev/GUdevClient.html#g-udev-client-query-by-subsystem for the corresponding C API.17:18
pittiGI is not even restricted to GObject, you can annotate any non-OO function based API with it. E. g. there is already a /usr/share/gir-1.0/xlib-2.0.gir (although it's horribly incomplete). These will behave as normal functions in Python (or other languages) as well.17:19
pitti== Other API differences ==17:20
pittiI said above in (1) that the structure of method arguments is by and large the same in C and in GI/Python. There are some notable exceptions which you must be aware of.17:20
pitti=== Constructors ===17:20
pittiThe biggest one is constructors. There is actually two ways of calling one:17:20
pitti * Use the real constructor implementation from the library. Unlike in normal Python you need to explicitly specify the constructor name:17:20
pitti   Gtk.Button.new()17:21
pitti   Gtk.Button.new_with_label("foo")17:21
pitti * Use the standard GObject constructor and pass in the initial property values as named arguments:17:21
pitti   Gtk.Button(label="foo", use_underline=True)17:21
pittiThe second is actually the recommended one, as it makes the meaning of the arguments more explicit, and also underlines the GObject best practice that a constructor should do nothing more than to initialize properties. But otherwise it's pretty much a matter of taste which one you use.17:22
pitti=== Passing arrays ===17:23
pittiUnlike C, higher level languages know how long an array is, while in the C API you need to specify that explicitly, either by terminating them with NULL or explicitly giving the length of the array in a separate argument.17:23
pittiWhich one is used is already specified in the annotations and thus in the typelib, so Python can automatically provide the right format without the developer needing to append an extra "None" or a separate len(my_array) argument.17:23
pittiFor example, in C you have17:23
pitti   gtk_icon_theme_set_search_path (GtkIconTheme *icon_theme, const gchar *path[], gint n_elements)17:23
pittiIn Python you can just call this as17:24
pitti   my_icon_theme.set_search_path(['/foo', '/bar'])17:24
pittiand don't need to worry about the array size.17:24
pitti=== Output arguments ===17:24
pittiC functions can't return more than one argument, so they often use pointers which the function then fills out. Conversely, Python doesn't know about pointers, but can easily return more than one value as a tuple.17:24
pittiThe annotations already describe which arguments are "out" arguments, so in Python they become part of the return tuple: first one is the "real" return value, and then all out arguments in the same order as they appear in the declaration. For example:17:25
pitti  GdkWindow* gdk_window_get_pointer (GdkWindow *window, gint *x, gint *y, GdkModifierType *mask)17:25
pittiIn Python you would call this like17:25
pitti  (ptr_window, x, y, mask) = mywindow.get_pointer()17:25
pitti=== GDestroyNotify ===17:26
pittiSome GLib/GTK functions take a callback method and an extra "user_data" argument that is passed to the callback.17:26
pittiIn C they often also take a "GDestroyNotify" function which is run once all callbacks are done, in order to free the memory of user_data.17:26
pittiAs Python has automatic memory management, pygobject will take care of all this by itself, so you simply don't specify the GDestroyNotify argument.17:26
pittiFor example:17:26
pitti    void gtk_enumerate_printers (GtkPrinterFunc func, gpointer user_data, GDestroyNotify destroy, gboolean wait)17:27
pittiIn Python you call this as17:27
pitti   Gtk.enumerate_printers(my_callback, my_user_data, True)17:27
pitti=== Non-introspectable functions/methods ===17:27
pittiWhen you work with PyGI for a longer time, you'll inevitably stumble over a method that simply doesn't exist in the bindings. These usually are marked with introspectable="0" in the GIR.17:28
pittiIn the best case this is because there are some missing annotations in the library which don't have a safe default, so GI disables these to prevent crashes. They usually come along with a corresponding warning message from g-ir-scanner, and it's usually quite easy to fix these.17:28
pittiSo please do file upstream bugs against the relevant library when you find these17:28
pittiAnother common case are functions which take a variable number of arguments, such as gtk_cell_area_add_with_properties().17:28
pittiVarargs cannot be handled safely by libgirepository. In these cases there are often alternatives available (such as gtk_cell_area_cell_set_property()). For other cases libraries now often have a ..._v() counterpart which takes a list instead of variable arguments.17:29
pitti== Overrides ==17:29
pittiA specialty of pygobject is the possibility of replacing functions, methods, or classes of the introspected library with custom code, called "overrides".17:29
pittiAs the goal is to stay very close to the original API, they should be used and written sparsely, though.17:30
pittiOne major use case is to provide replacements for unintrospectable methods. For example, Gtk.Menu.popup() is not introspectable in GTK, but the GTK override implements this method in terms of Gtk.Menu.popup_for_device(), so in this case the override actually helps to get closer to the original API again.17:30
pittiAnother important case is automatic data type conversion, most prominently to allow passing unicode objects to methods which expect an UTF-8 encoded gchar*. This also actually helps to prevent workarounds in application code and maintain a clean API.17:30
pittiThirdly, overrides are useful if they help to massively ease development. For example it is quite laborious to do GDBus calls or GVariant constructions with the native Gio/GLib API.17:31
pittipygobject offers convenience overrides to make these a lot simpler and more Pythonic, but of course without actually breaking the original API.17:31
pittiOverrides are shipped in /usr/share/pyshared/gi/overrides/, and should be quite easy to understand.17:32
pittie. g. in /usr/share/pyshared/gi/overrides/Gtk.py you see the "def popup()" method for Menu that I mentioned above17:32
pittiIn general you should not even be required to know about it, as most of them really just fix stuff to work as expected.17:32
pittiBut for the GDBus/GVariant cases it is useful to know them, as you can safe yourself a ton of extra work17:33
pitti== Migrating pygtk2 code ==17:33
pittiA big task that we in Ubuntu already started in the Natty cycle, and which will continue to keep us and all other PyGTK app developers busy for a while is to port PyGTK2 applications to GTK3 and PyGI.17:33
pittiNote that this is really two migrations in one step, but is recommended as GTK2 still has a lot of breakage with PyGI, although I did a fair amount of work to backport fixes from GTK3 (the six applications that we ported in Natty run with PyGI and GTK2, after all).17:33
pittiThe GTK2 → GTK3 specifics are documented at http://developer.gnome.org/gtk3/stable/gtk-migrating-2-to-3.html and I don't want to cover them here.17:34
pittiIf we compare the PyGTK vs. PyGI code for a "Hello" message box, we see that it's actually very similar in structure:17:34
pitti  $ python -c 'from gi.repository import Gtk; Gtk.MessageDialog(None, 0, Gtk.MessageType.INFO, Gtk.ButtonsType.CLOSE, "Hello World").run()'17:34
pitti(^ pygi)17:34
pitti  $ python -c 'import gtk; gtk.MessageDialog(None, 0, gtk.MESSAGE_INFO, gtk.BUTTONS_CLOSE, "Hello World").run()'17:34
pitti(^ pygtk)17:34
pittiSo PyGTK also already did the representation of the C functions as proper classes and methods, thus if you port from PyGTK instead of from C, it'll be a lot easier.17:35
pitti=== Step 1: The Great Renaming ===17:35
pittiThe biggest part in terms of volume of code changed is basically just a renaming exercise.17:35
pittiE. g. "gtk.*" now becomes "Gtk.*", and "gtk.MESSAGE_INFO" becomes "Gtk.MessageType.INFO".17:35
pittiLikewise, the imports need to be updated: "import gtk" becomes "from gi.repository import Gtk".17:35
pittiFortunately this is is a mechanical task which can be automated. The pygobject git tree has a script "pygi-conver.sh" which is a long list of perl -pe 's/old/new/' string replacements. You can get it from http://git.gnome.org/browse/pygobject/tree/pygi-convert.sh.17:35
pittiIt's really blunt, but surprisingly effective, and for small applications chances are that it will already produce something which actually runs.17:36
pittiNote that this script is in no way finished, and should be considered a collaborative effort amongst porters. So if you have something which should be added there, please don't hesitate to open a bug or ping me or someone else on IRC (see below). We pygobject devs will be happy to improve the script.17:36
pittiWhen you just run pygi-convert.sh in your project tree, it will work on all *.py files.17:36
pittiIf you have other Python code there which is named differently (such as bin/myprogram), you should run it once more with all these file names as argument.17:36
pitti=== Step 2: Wash, rinse, repeat ===17:37
pittiOnce the mechanical renamings are out of the way, the tedious and laborious part starts. As Python does not have a concept of "compile-time check" and can't even check that called methods exist or that you pass the right number of parameters, you now have to enter a loop of "start your program", "click around until it breaks", "fix it", "goto 1".17:37
pittiThe necessary changes here are really hard to generalize, as they highly depend on what your program actually does, and this will also involve the GTK 2 → 3 parts.17:37
pittiOne thing that comes up a lot are pack_start()/pack_end() calls.17:37
pittiIn PyGTK they have default values for "expand", "start", and "padding", but as GTK does not have them, you won't have them in PyGI either.17:38
pittiThere even was a patch once for providing an override for them, but it was rejected as it would cement the API incompatibility.17:38
pittited as it would cement the API incompatibility.17:38
pittiOne thing you need to be aware of is that you can't do a migration halfway: If you try to import both "gtk" and "gi.repository.Gtk" hell will break lose and you'll get nothing but program hangs and crashes, as you are trying to work with the same library in two different ways.17:38
pittiYou can mix static and GI bindings of _different_ libraries, such as using dbus-python and GTI-GI.17:39
pittierm, Gtk-GI, sorry17:39
pitti=== Step 3: Packaging changes ===17:39
pittiAfter you have your code running with PyGI and committed it to your branch and released it, you need to update the dependencies of your distro package for PyGI.17:39
pittiThis section will be Debian/Ubuntu specific due to the involved package names, sorry. It is not be fundamentally different on other distros, though.17:39
pittiYou should grep your code for "gi.repository" and collect a list of all imported typelibs, and then translate them into the appropriate package name.17:40
pittiFor example, if you import "Gtk, Notify, Gudev" you need to add package dependencies to gir1.2-gtk-3.0, gir1.2-notify-0.7, and gir1.2-gudev-1.0.17:40
pittiAt the same time you should drop the old static bindings, like python-gtk2, python-notify, etc.17:40
pittiFinally you should also bump the version of the python-gobject dependency to (>= 2.28) to ensure that you run with a reasonably bug free PyGI.17:40
pitti== RTFM & Links ==17:41
pittiI'd like to give a list of useful links for this topic here.17:41
pittiThis has a good general overview about GI's architecture, annotations, etc:17:41
pitti    https://live.gnome.org/GObjectIntrospection17:41
pittiThe interview with Jon Palmieri and Tomeu Vizoso is also an interesting read about its state:17:41
pitti    http://www.gnomejournal.org/article/118/pygtk-gobject-and-gnome-317:41
pittiThe GI/PyGI developers hang out on IRC here:17:41
pitti    #introspection / #python on irc.gnome.org17:42
pittipygobject's git tree has a very comprehensive demo showing off pretty much all available GTK widgets in PyGI:17:42
pitti    http://git.gnome.org/browse/pygobject/tree/demos/gtk-demo17:42
pittiDescription of the Python overrides for much easier GVariant and GDBus support17:42
pitti    http://www.piware.de/2011/01/na-zdravi-pygi/17:42
pittiExamples of previously done pygtk → pyGI ports:17:42
pitti   Apport: http://bazaar.launchpad.net/~apport-hackers/apport/trunk/revision/180117:42
pitti   Jockey: http://bazaar.launchpad.net/~jockey-hackers/jockey/trunk/revision/67917:42
pitti   gtimelog: http://bazaar.launchpad.net/~pitti/gtimelog/pygi/revision/18117:42
pitti   system-config-printer (work in progress): http://git.fedorahosted.org/git/?p=system-config-printer.git;a=shortlog;h=refs/heads/pygi17:42
pitti   The gtimelog one is interesting because it makes the code work with *both* PyGTK and PyGI, whichever is available.17:42
pittifinally, I plan to turn this talk into a proper wiki page below https://live.gnome.org/GObjectIntrospection, so that it's more useful for posterity17:43
pitti== Q & A ==17:43
pittiThanks everyone for your attention! I'm happy to answer questions now.17:43
ClassBottoabctl asked: why is it git1.2 but girepository-1.0?17:44
pitti1.0 is the ABI version of libgirepository, i. e. the client side library for gjs, pygojbect, etc. to create bindings17:44
pitti1.2 is the binary format version for the .typelibs17:45
ClassBottoabctl asked: what about structs like eg GDate/GDateTime?17:45
pittithese actually do get exported17:45
pittihave a look at /usr/share/gir-1.0/GLib-2.0.gir17:46
pitti    <record name="DateTime" c:type="GDateTime" ...17:46
pitti    <record name="Date" c:type="GDate">17:46
pitti      <field name="julian_days" writable="1" bits="32">17:46
pitti        <type name="guint" c:type="guint"/>17:46
pitti      </field>17:46
pittietc.17:46
pittiso as long as they are relatively simple, they do work17:46
ClassBotJanC asked: does GI support named parameters & default values, so that in Python method/function calls we can leave some parameters out?17:47
pittinot right now17:48
pittiI hear that there is a plan to support default values which are specified in the C code/annotations themselves17:48
pittibut otherwise you'll need an override for cases where it makes sens17:48
pittie17:48
ClassBotrr0hit asked: the hello world example in pygi gives me error: TypeError: __init__() takes at most 5 arguments (6 given) . What am I doing wrong17:49
pittirr0hit: I suppose you are using Ubuntu 10.10?17:49
pittias I said above, I'm afraid this is all pretty new, and you need 11.04 beta17:49
ClassBotcrazedpsyc asked: why did pygtk not work out well? wxpython seems just fine, and it is a C wrapper as well.17:49
pittiwell, it did work well for years17:50
pittibut as I said, someone would need to maintain it, and port it to GTK3, and keep that up to date, etc.17:50
pittiand provide missing bindings for all other GNOMEish libraries (which were often missing)17:50
ClassBotchadadavis asked: If other distros are not using the latest GI yet, is Ubuntu planning to maintain their own GI-ported version of all these apps?17:51
pittino, that would be quite crazy17:51
ClassBotThere are 10 minutes remaining in the current session.17:51
pittiso far we just ported a lot of our Ubuntu specific stuff17:51
pittiand I ported gtimelog, but proposed that upstream first17:51
pittiso likewise, if we port upstream software, we do that upstream17:52
pittie. g. GNOME will certainly appreciate these patches, it's a GNOME goal to port their pygtk stack, etc.17:52
pittinot sure if that answered chadadavis question?17:52
ClassBottoabctl asked: how can i create a instance of GDate/GDatetime with python? and how to map these types to the python types(datetime.date/datetime.datetime) ?17:52
pitti$ python -c 'from gi.repository import GLib; GLib.Date()'17:53
pittietc.17:53
pitti(not really tested much)17:53
pittibut that's the idea17:53
pittinote that structs have always been a bit fiddly, as often GI doesn't have enough type information about members17:54
pittiso this only works for simple structs17:54
pittithe more complex ones should be turned into proper GObjects (that was necessary and done in GTK3 in some cases)17:54
pittithe most common case is probably the Events struct, which works good enough17:54
ClassBotzinga60 asked: can I use Python introspection like dir() for the dynamically created modules?17:55
pittinot right now, I'm afraid17:55
pittiit is possible in principle, the typelib has all necessary information17:55
pittibut it doesn't work right now17:55
ClassBotzinga60 asked: so as a beginner with gtk, etc. (without the need of porting from pygtk to pygi) I should use the official C API docs (to look up function signatures, etc.) and the gir-xml files to see the corresponding Python name spaces?17:55
pittiusually the C API docs (libgtk-3-doc etc.) should suffice17:56
pittiwith the appropriate transformation rules that I mentioned above17:56
ClassBotThere are 5 minutes remaining in the current session.17:56
pittiso usually you should be able to easily derive the according Python call17:56
pittiif not, you can look in the gir, but I seldomly found that necessary myself17:56
pittiout of questions :)17:56
pittiso, thanks everyone!17:56
pittiI hang out in #ubuntu-desktop, #ubuntu-devel, and also #python/#introspection on the GNOME IRC, so feel free to ask me there later17:57
pittidpm: clearing the floor then17:58
pittifor manish_17:58
dpmthanks a lot for a great session pitti!17:59
dpmexcellent participation as well17:59
dpmNext up are m4n1sh (or m4n1sh_) and seiflotfy from the Zeitgeist project, who are going to talk about integrating Zeitgeist to your application18:01
=== ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - https://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi || Questions in #ubuntu-classroom-chat || Event: Ubuntu App Developer Week - Current Session: Zeitgeist API & Zeigeist Application Integration - Instructors: m4n1sh, seiflofty
ClassBotLogs for this session will be available at http://irclogs.ubuntu.com/2011/04/12/%23ubuntu-classroom.html following the conclusion of the session.18:01
m4n1shHello everyone18:02
m4n1shMy name is Manish Sinha18:02
m4n1shand seiflotfy is Seif Lotfy18:02
m4n1shwe both work in Zeitgeist team18:02
m4n1shI am just giving a small introduction18:02
m4n1shSeif is the founder of Zeitgeist18:03
m4n1shand I work on integration and some engine work18:03
m4n1shLet us start seiflotfy :)18:03
m4n1shfirst a basic introduction18:03
m4n1shZeitgeist is an event logger18:03
m4n1shwhich logs the events which happens on your computer18:03
m4n1shevents can be opening files18:03
m4n1shclosing files18:03
m4n1shcreating files18:03
m4n1shconnecting to internet18:04
m4n1shreceiving a call18:04
m4n1shall the event logging doesnt happen automagically18:04
=== ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - https://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi || Questions in #ubuntu-classroom-chat || Event: Ubuntu App Developer Week - Current Session: Zeitgeist API & Zeigeist Application Integration - Instructors: m4n1sh, seiflofty, manish
m4n1shzeitgeist is a daemon running on your computer18:04
ClassBotLogs for this session will be available at http://irclogs.ubuntu.com/2011/04/12/%23ubuntu-classroom.html following the conclusion of the session.18:04
m4n1shwhose work is to get events18:04
m4n1shmeans log them18:04
m4n1shwhen some application sends the data to it18:05
m4n1shand applications can also query events from the daemon18:05
m4n1shit is like a event store18:05
m4n1shwhen we talk about integration, we mean creating small plugins/extensions/addons/addins which sends the relevant events to the daemon18:05
m4n1shso basically it is the plugins which push data18:06
m4n1shall the plugins which push events are called dataproviders18:06
m4n1shtheir work is to only push data18:06
m4n1shlike whenever you open a note, a tomboy extension tells zeitgeist that the user opened the note18:07
m4n1shthis extension is called an Event18:07
m4n1shthe most important part of Zeitgeist is called an event18:07
m4n1shevent is a packet of information which tells the daemon of "What happened"18:07
m4n1shtake the literal meaning of event18:07
m4n1sheach event instance has metadata contained with it18:08
m4n1shlike timestamp18:08
m4n1shwhat happened18:08
m4n1shhow it happened18:08
m4n1shany payload18:08
m4n1shwhich application was involved in the event etc18:08
m4n1shzeitgeist runs as a daemon and exposes an API via DBus18:08
m4n1shDBus is an interprocess communication software18:09
m4n1shit helps applications talk to each other18:09
m4n1shto inspect the zeitgeist API18:09
m4n1shyou can install d-feet from the repositories18:09
m4n1shand open it18:09
m4n1shand search for zeitgeist18:09
m4n1shyou will get something like this18:09
m4n1shhttp://i.imgur.com/DKx0G.png18:09
m4n1shthe zeitgeist API looks like this18:09
m4n1shhttp://zeitgeist-project.com/docs/0.5.2/dbus_api.html#org-gnome-zeitgeist-log18:09
m4n1shlet us start with the basic building block of zeitgeist18:10
m4n1shan Event18:10
m4n1shhow event looks like is given here18:10
m4n1shhttp://zeitgeist-project.com/docs/0.6/dbus_api.html#index-018:10
m4n1shthe first thing is an event Id18:10
m4n1shwhich recognizes it uniquely18:10
m4n1sh2nd is Timestamp telling when it happened18:10
m4n1sh3rd is interpretation18:11
m4n1shwhich means18:11
m4n1sh“what happened”18:11
m4n1sh4th is Manifestation18:11
m4n1shwhich means18:11
m4n1sh“how did this happen”18:11
m4n1shthen we have an actor which looks like application://tomboy.desktop18:11
m4n1shwhich tells which application was involved in the event18:11
m4n1shthis is the metadata for an event18:12
m4n1sheach event can then contain something called as Subject18:12
m4n1sheach event can have more than one subject18:12
m4n1shnow we should go to what is subject contained of18:12
m4n1shURI which is something like file:///tmp/my.txt18:12
m4n1shInterpretation - the abstract notion of what the subject18:13
m4n1shManifestation - the abstract notion of how the subject is stored or available18:13
m4n1shlike the subject is stored as a File18:13
m4n1shOrigin - the URI where the user accessed the subject from18:13
m4n1shMimetype18:13
m4n1shwhich is something like text/plain18:13
m4n1shimage/png18:13
m4n1shText - a descriptive explanation18:14
m4n1shStorage - how it is stored18:14
m4n1shI know all these were a bit boring, but it is important for a developer to understand what an event actually is18:14
m4n1shto access Zeitgeist API18:14
m4n1shyou have Python bindings18:14
m4n1shC/Vala bindings18:14
m4n1shC# bindings18:14
m4n1shso you can choose your language18:15
m4n1shif you are working on a application which needs zeitgeist integration and it is coded in Python then you can use the python binding of zeitgeist18:15
m4n1shyou lets move to the API18:15
m4n1shthis is the API18:15
m4n1shhttp://zeitgeist-project.com/docs/0.5.2/dbus_api.html#org-gnome-zeitgeist-log18:15
m4n1shlets not go so deep in the API18:16
m4n1shonly a few methods18:16
m4n1shlike InsertEvents18:16
m4n1shwhich inserts events in the daemon18:16
m4n1shGetEvents - which gets events from the  daemon when you specify the event ids18:17
m4n1shAnd 3rd18:17
m4n1shFindEventIds - you can search for events18:17
m4n1shand get back the event Ids18:17
m4n1shFindEvents - you can search for events, and get the actual events instead of just the ID18:17
m4n1shwhen searching for an event you use the event template18:18
m4n1shit is like a pattern18:18
m4n1shthe best part is that event template are events themselves18:18
m4n1shthey are represented the same way18:18
m4n1shlet me take you people to an example which will clear all the doubts18:18
m4n1shwe will take a working example18:18
m4n1shour example uses python API18:19
m4n1shgit.gnome.org/browse/rhythmbox/tree/plugins/rbzeitgeist/rbzeitgeist/__init__.py18:19
m4n1shplease open this file18:19
m4n1shnow I am teaching how to push events18:20
m4n1shnot pulling18:20
m4n1shcheck line 36 and 37 of the link I have18:20
m4n1sh*gave18:20
m4n1shfrom zeitgeist.client import ZeitgeistClient18:20
m4n1shfrom zeitgeist.datamodel import Event, Subject, Interpretation, Manifestation18:20
m4n1shwe imported Evebt, Subject, Manifestation and Interpretation18:21
m4n1shnow we have to determine the Interpretation for Event and Subject18:21
m4n1shsimilarly Manifestation for Event and Subject18:21
m4n1shEvent Interpretation is either LEAVE_EVENT or ACCESS_EVENT18:22
m4n1shwhich means "what happened"18:22
m4n1shACCESS_EVENT means that the track started18:23
m4n1shwe are at the start of the event18:23
m4n1shmeans we started playing the track18:23
m4n1shLEAVE_EVENT means we left the track18:23
m4n1shmeans track finished18:23
m4n1shEvent Manifestation: USER_ACTIVITY/SCHEDULED_ACTIVITY : 120/122 - "how did this happen"18:23
m4n1shHow did it happen?18:23
m4n1shIt happened via User Activity or Scheduled Activity18:23
m4n1shUserActivity means that the user himself pressed Next track18:24
m4n1shScheduled means the next track in the queue started itself18:24
m4n1shcheck line 120  and 12218:24
m4n1shthe list of interprerations is here http://zeitgeist-project.com/docs/0.6/ontology.html#symbol-interpretation18:25
m4n1shand list of Manifestation http://zeitgeist-project.com/docs/0.6/ontology.html#symbol-manifestation18:25
m4n1shplease choose one from these list18:25
m4n1shnext is Subject Interpration18:25
m4n1shSubject Interpretation: AUDIO : 135 - "what is this"18:25
m4n1shcheck line 13518:25
m4n1shWhat is this? It is Audio :)18:25
ClassBotakshatj asked: Are there guides available on how to write a dataprovider or plugin?18:26
m4n1shakshatj: there are definitive guide. This session is meant for that :)18:26
m4n1shnext is Subject Manifestation18:26
m4n1shcheck line 6218:26
m4n1shManifestion for subject asks18:26
m4n1sh"how does this item exist"18:26
=== jhernandez is now known as jhernandez_afk
m4n1shit exists as FILE_DATA_OBJECT18:26
m4n1shall these values are from the list of Manifestation18:27
m4n1shI will give you people one more example to study yourself18:27
m4n1shIt is EOG Plugin18:27
m4n1shthe file is18:27
m4n1shhttp://bazaar.launchpad.net/~zeitgeist-dataproviders/zeitgeist-dataproviders/trunk/view/head:/eog/zeitgeist_plugin.py18:27
m4n1shHints are18:27
m4n1shEvent Interpretation: MODIFY_EVENT/LEAVE_EVENT : 69/87 - "what happened"18:27
m4n1shEvent Manifestation: USER_ACTIVITY : 70/88 - "how did this happen"18:27
m4n1shSubject Interpretation: IMAGE : 61 - "what is this"18:27
m4n1shSubject Manifestation: FILE_DATA_OBJECT : 62 - "how does this item exist"18:27
m4n1shKeep the questions coming people18:28
m4n1shMore examples18:28
m4n1shTomboy:18:28
m4n1shhttp://bazaar.launchpad.net/~zeitgeist-dataproviders/zeitgeist-dataproviders/trunk/files/head:/tomboy/18:28
m4n1shBanshee: https://gitorious.org/banshee-community-extensions/banshee-community-extensions/blobs/master/src/ZeitgeistDataprovider/Banshee.ZeitgeistDataprovider/ZeitgeistDataprovider.cs18:28
m4n1shI would also like to defuse a few myths18:28
m4n1shZeitgeist is not a file search engine18:28
m4n1shit does not track files18:28
m4n1shthere can be events for zeitgeist which might not need a file18:29
m4n1shlike you got disconnected from internet18:29
m4n1shor you recieved a call18:29
m4n1shI would like to recieve some feedback from you people before I advance to next part of the session18:29
m4n1shyou can keep them coming on -chat channel18:29
m4n1shmoving to next part18:30
m4n1shwe have to search for events18:31
m4n1shfor searching for events18:31
m4n1shwe can look at the method18:31
m4n1shFindEvents18:31
m4n1shit contains18:31
ClassBotmurphy asked: Can you please give an example of some context sensitive situation Zeitgeist helps with?18:32
m4n1shmurphy: as seiflotfy gave you the link on -chat18:32
m4n1shhttp://www.youtube.com/watch?v=U6YOvVaRWh418:32
m4n1shthis is an example18:32
m4n1shit contains18:32
m4n1shtime_range18:32
m4n1shwhich tells you the range of time when you want to search18:33
m4n1shlike you want to search for events only between today and 3 days back18:33
m4n1shevent_templates18:33
m4n1shyou can create event instances and pass it18:33
m4n1shthe daemon will compare these templates to the stored events18:33
m4n1shand provide you with the results18:34
m4n1shstorage_state18:34
m4n1shit is18:34
m4n1shEnumeration class defining the possible values for the storage state of an event subject.18:34
m4n1shhttp://zeitgeist-project.com/docs/0.5.2/datamodel.html#zeitgeist.datamodel.StorageState18:34
m4n1shcontains 3 values18:34
m4n1shStorageState.NotAvailable18:34
m4n1shThe storage medium of the events subjects must not be available to the user. (Integer value: 0)18:34
m4n1shStorageState.Available18:34
m4n1shThe storage medium of all event subjects must be immediately available to the user. (Integer value: 1)18:34
m4n1shStorageState.Any18:34
m4n1shThe event subjects may or may not be available. (Integer value: 2)18:34
m4n1shthen we have18:35
m4n1shnum_events18:35
m4n1shmaximal amount of returned events18:35
m4n1shlast one is18:35
m4n1shorder18:35
m4n1shwhich asks in which order the results have to be returned18:35
m4n1shresult type is an enumration18:36
m4n1shhttp://zeitgeist-project.com/docs/0.5.2/datamodel.html#zeitgeist.datamodel.ResultType18:36
m4n1shit has many values18:36
m4n1shhave a look18:36
m4n1shthis contains the full list of events18:36
m4n1shhttp://zeitgeist-project.com/docs/0.5.2/dbus_api.html#org-gnome-zeitgeist-log18:36
m4n1shnow we have an example of how we can pull the events18:37
m4n1shwe have a gedit plugin18:37
m4n1shhere18:37
m4n1shhttp://paste.ubuntu.com/593228/18:37
m4n1shwritten by seiflotfy and others18:37
m4n1shseiflotfy: can you explain this18:37
seiflotfysure18:37
seiflotfyso18:37
seiflotfytemplate = Event()18:37
seiflotfy        template.actor = "application://gedit.desktop"18:37
seiflotfyhere you can see an Event being created18:37
seiflotfyand the actor of the event is being set to "gedit"18:38
seiflotfywe then ask Zeitgeist for18:38
seiflotfy"Get me most used files with gedit"18:38
seiflotfythis will look like this18:38
seiflotfy            CLIENT.find_events_for_templates([template], handle_most, num_events = 100, result_type = ResultType.MostUsed)18:38
seiflotfywhere handle_most is a method for the callback18:38
seiflotfyand then you get the "most used" files with gedit18:39
=== ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - https://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi || Questions in #ubuntu-classroom-chat || Event: Ubuntu App Developer Week - Current Session: Zeitgeist API & Zeigeist Application Integration - Instructors: m4n1sh, seiflofty, manish, seiflotfy
ClassBotLogs for this session will be available at http://irclogs.ubuntu.com/2011/04/12/%23ubuntu-classroom.html following the conclusion of the session.18:39
seiflotfythe whole code can be found http://paste.ubuntu.com/593238/18:39
m4n1shif you people want a documentation of zeitgeist for mono/C# it can be found here18:40
m4n1shhttp://launchpad.net/zeitgeist-sharp/0.1/0.1.0.1/+download/zeitgeist-sharp-0.1-api-doc.tar.gz18:40
m4n1shand for C/Vala library18:41
m4n1shdocumentation is here http://people.canonical.com/~kamstrup/projects/libzeitgeist/doc18:41
ClassBotakshatj asked: So, dataprovider is used for pushing data to zg and plugin is used for pulling from it?18:41
m4n1shakshatj: dataprovider is out term for those plugins which only push events to the daemon18:42
m4n1shthey dont pull18:42
m4n1shdataproviders are a subset of plugins18:42
m4n1shwe have many dataproviders already18:42
m4n1shthey are hosted here18:42
m4n1shhttps://launchpad.net/zeitgeist-dataproviders18:42
m4n1shyou can see the list here18:43
m4n1shhttp://bazaar.launchpad.net/~libzeitgeist-developers/libzeitgeist/trunk/files18:43
m4n1shsorry18:43
m4n1shwrong link18:43
m4n1shhttp://bazaar.launchpad.net/~zeitgeist-dataproviders/zeitgeist-dataproviders/trunk/files18:43
m4n1shlike18:43
m4n1shbzr, chrome, emacs, eog, firefox, chrome, geany, gedit, rhythmbox, telepathy, tomboy18:43
m4n1shvim xchat18:44
m4n1shbanshee18:44
m4n1shbanshee is upstream18:44
m4n1shnot in this repo18:44
m4n1shwe need more dataproviders18:44
m4n1shto make more sensible logging18:44
m4n1shor say more detailed logging18:44
m4n1shthen we can have plugins which pull information18:45
m4n1shexample.. I can show a snapshot18:45
m4n1shof how gedit source code you checked actually looks like18:45
m4n1shhttp://wiki.zeitgeist-project.com/images/2/2b/GEditOpenZeitgeist.png18:45
m4n1shif you use synapse18:45
m4n1shit shows results from zeitgeist18:45
m4n1shit asks zeitgeist for info18:46
m4n1sh<psusi> asked : this may be a silly question but, what is the purpose of zietguiest, and how is it different than syslog?18:46
m4n1shsyslog logs system events18:46
m4n1shit does not log that you opened a file18:46
m4n1shsyslog contains things like18:46
m4n1shApr 12 23:17:01 Foo CRON[4852]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)18:47
m4n1shhow much sense did it make to you :)18:47
m4n1shit stores info in unstructured format18:47
m4n1shdoes not have any dedicated API (as far as I know)18:47
m4n1shso what all you can do via Zeitgeist18:48
m4n1shyou can have a complete list18:48
m4n1shof which file you opened when, closed when, saved when18:48
m4n1shstarted from when it was created18:48
m4n1shyou can  have a list of all the calls you recieved via empathy18:48
m4n1shwhen you recieved, when you dropped18:48
m4n1shwhen you got a call18:48
m4n1shthe whole list18:48
m4n1shwe people are still working in that area18:49
m4n1shwe have telepathy  work in progress18:49
m4n1shwe need to integrate it even more18:49
m4n1shyou can even list down all recent used files18:49
m4n1shsort them based on18:49
m4n1sh1) Application18:49
m4n1sh2) Which all were related to file creation18:50
m4n1sh3) Time Range18:50
m4n1shetc etc18:50
m4n1sh<psusi> Windows has a logging facility that was originally an attempt to store more structured log data that could be better parsed.  Is that about the same idea here?  So the idea is to replace .xsession-errors with a more structured log system?18:50
m4n1shpsusi asked this question18:50
m4n1shI don't remember if windows had such a thing18:50
m4n1shI think it is there somewhere in Control Panel18:50
m4n1shI dont think anyone uses it18:50
m4n1shit is about Logs18:51
m4n1shsame like we have in Linux18:51
m4n1shsyslog, messages, kern.log etc18:51
m4n1shbut zeitgeist is meant not only for storing data18:51
ClassBotThere are 10 minutes remaining in the current session.18:51
m4n1shbut having a nice API such that any application can get back the data18:51
m4n1shZeitgeist is a thing under development18:52
m4n1shand its development is very fast18:52
m4n1shwe all are learning a lot18:52
m4n1shso if you want to learn a lot, you can come to our channel #zeitgeist18:52
m4n1shtry out some examples18:52
m4n1shand get your hands dirty18:52
m4n1shI am always there after 16UTC on that channel by this same nick18:53
ClassBotmurphy asked: So if I copied a file to a server using nautilus I would be able to discover which server and what I copied a few days later (assuming nautilus informed zg)? Stuff for which there is usually no log... What about bash?18:53
m4n1shmurphy: sadly bash events are not logged now18:53
m4n1shsince we use GtkRecentManager for logging where plugins are not available18:53
m4n1shit is fallback logging18:53
m4n1shAFAIK bash doesnt inform GtkRecentManager18:54
m4n1shso it is not logged18:54
m4n1shwe need a dataprovider for bash too18:54
m4n1shwrt nautilus18:54
m4n1shthe source file is surely logged18:54
m4n1shnautilus does inform zeitgeist18:54
m4n1shusing GtkRecentManager18:54
m4n1shand it gets logged to zeitgeist18:54
m4n1shyou can come to know about it18:54
m4n1shwrt to "which server" depends on the URI18:55
m4n1shwhich is stored18:55
ClassBotzinga60 asked: how does the zeitgeist daemon store the events? in some db I guess? is it going to be more slow with more and more data providers and the longer the daemon runs (over months/years)?18:55
m4n1shzinga60: events are stored in sqlite database in ~/.local/share/zeitgeist/activity.sqlite18:55
m4n1shplease dont try to open it maually18:55
m4n1shit is locked by the daemon18:55
m4n1shit *might* become slow and slow as millions of events fill up18:56
m4n1shbut it will take lot of time18:56
m4n1shdataproviders dont make it slow18:56
ClassBotThere are 5 minutes remaining in the current session.18:56
m4n1shas dataproviders run with the application18:56
m4n1shdaemon can run for months and years18:56
m4n1shit is perfectly fine for it to work for long time18:56
m4n1shit doesnt leak memory18:57
m4n1shif it leaks memory, please inform us on #zeitgeist18:57
m4n1sh<psusi> yea, sounds like what MS originally intended the windows logging service to be, but it never really caught on and so nobody uses it today... only they had it apply to both system logging and user application logging.  Zeitgeist has no intention of handling syslog events as well?  Only desktop events?  Or will there be a version on the system dbus as well as the session?18:57
m4n1shwe handle mostly desktop events18:57
m4n1shwhich helps the *user*18:57
m4n1shour area of focus is desktop events18:57
seiflotfydepends what apps push into it18:57
m4n1sheven though zeitgeist can log any event18:58
m4n1sheven system events18:58
seiflotfyexactly18:58
m4n1sha user doesnt care much about  system events18:58
seiflotfyubuntu one uses zeitgeist to log sync events18:58
m4n1sh:)18:58
m4n1shclosing time18:58
m4n1shplease join us at #zeitgeist channel18:58
m4n1shwe are happy to mentor  anyone who wants to work with us18:58
m4n1shzeitgeist team is an extremely rocking and close-knit team18:59
m4n1shif you join us, you will really enjoy18:59
m4n1shtake my word :)18:59
seiflotfywe have a list of things we need to get done18:59
seiflotfyso feel free to join18:59
m4n1sh<psusi> so there is no instance running on the system wide dbus?18:59
m4n1shzeitgeist runs as SessionBus which is user based18:59
m4n1shinstead of SystemBus which is system wide18:59
m4n1shmakes sense to run on per user basis19:00
m4n1shwe have many many more things to do19:00
m4n1shlots of applications needs to be touched19:00
m4n1shwe have a rush of adrenalin whenever we get something done :)19:00
m4n1shjust for info.. if anyone of you know django we have a good work for you :)19:00
m4n1shfeel free to poke me19:00
m4n1shesp if you know django-piston then you can start contributing to us very easily19:01
=== ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - https://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi || Questions in #ubuntu-classroom-chat || Event: Ubuntu App Developer Week - Current Session: GStreamer+Python: Multimedia Swiss Army Machete - Instructors: jderose
dpmthanks seiflotfy and m4n1sh for a great session! Next up: jderose will tell us all about using python and gstreamer in many interesting ways :)19:01
ClassBotLogs for this session will be available at http://irclogs.ubuntu.com/2011/04/12/%23ubuntu-classroom.html following the conclusion of the session.19:01
m4n1shThanks everyone19:01
jderoseokay, should i start?19:03
nigelbyes :)19:03
jderoseHi everyone, hope you're having a great Ubuntu App Developer Week so far!19:03
jderoseOkay, lets get started...19:03
jderoseI have a short prepared intro to get you pumped up about GStreamer + Python.19:03
jderoseThen we'll spend rest of the hour getting our hands dirty with real code, and I'll do my best to answer all of your questions.19:03
jderoseDuring the intro, why don't you make sure the packages needed for the code examples are installed:19:04
jderosesudo apt-get install gstreamer0.10-tools python-gst0.10 gstreamer0.10-plugins-good19:04
jderoseAside from `gstreamer0.10-tools`, you probably already have the rest installed, but it's good to make sure we're on the same page package-wise.19:04
jderoseI'm running Natty, but the examples should work fine under Maverick and Lucid too, and even older release.19:04
jderose== INTRO ==19:05
jderoseFirst, I'm going to share why I think GStreamer is *the* multimedia framework, is going to totally dominate in *everything* from simple playback to big production video editing.19:05
jderoseI hope you're a bit surprised as to why I think this, because it's exciting, and I want to get you exited!19:05
jderoseIf I don't surprise you, then I assume you're already as excited as I am :)19:05
jderoseSecond, I'm going to share why I think Python is *the* language for building GStreamer apps, and correct some misconceptions I frequently hear about Python threading and GStreamer.19:05
jderose-- Why GStreamer? --19:06
jderoseAh, I should introduce myself.  My name is Jason Gerard DeRose, and I started writing pygst apps 7 years ago, back when gstreamer0.8 was the hot newness.19:06
jderoseSo I have a longtime love affair with GStreamer.19:06
jderoseBut recently I had to pick the multimedia framework for Novacut, my distributed (ala bzr/git/hg) video editor project.19:06
jderoseNovacut isn't just a project, it's a startup, so I needed to pick something that makes good longterm strategic sense.19:07
jderoseGStreamer was my gut feeling, but I played devils advocate with myself and looked at a number of other options.19:07
jderoseI looked most seriously at Media Lovin' Toolkit (MLT), as Jonathan Thomas originally was using GStreamer + Gnonlin for OpenShot, and then switched to MLT out of frustration.19:07
jderoseI believe Jonathan pointed out some legitimate weaknesses in Gnonlin, and the OpenShot development pace has been impressively quick, so you can't argue with that.19:07
jderoseHowever, I still chose GStreamer without hesitation.  Why?19:07
* jderose makes "drumroll" sounds...19:08
jderose* GStreamer is on the Kindle19:08
jderose* GStreamer is on the Nokia N90019:08
jderose* GStreamer is on webos phones and tablets19:08
jderose* GStreamer is what's getting attention from those wonderful Linaro folks19:08
jderose* GStreamer is on every Ubuntu desktop, along with most other desktop Linux distros19:08
jderoseIn short, I choose GStreamer because of it's economy of scale.19:08
jderoseGStreamer is already running on everything from small to medium, and although running it at industrial scale (big) might not be that common right now... it's inevitable.19:09
jderoseAnd doesn't that sound strikingly similar to something?19:09
jderoseIt does to me: the Linux kernel, running on everything from smart phones to supercomputers, everything from consumer grade to pro grade.19:09
jderoseOnce you reach that economy of scale, you're pretty unbeatable.  And I believe that over the past several years GStreamer has reached that tipping point.19:09
jderoseNonlinear editing is easily exercising 90% of the same code paths as playback.19:09
jderoseAnd from a business perspective, I'd choose something where I knew that 90% would be getting serious investment across the industry...19:09
jderoseeven if the other 10% might currently have some shortcomings compared to other options.19:10
jderoseI believe Edward Hervey has built an excellent foundation in Gnonlin.  It just needs more developers, more apps uses it, more users abusing it.19:10
jderose-- Why Python? --19:10
jderoseWhy not? GStreamer gives you a lot of power, you can build arbitrarily complex pipelines.19:11
jderoseAnd that's exactly the place when a simple, clear language like Python is perfect.19:11
jderoseYou want to be able to iterate quite, and write tons of tests without a lot of friction.19:11
jderoseNow if you want to write new GStreamer plugins (say some new video filter), those should of course be written in C.19:11
jderoseBut the job of assembling a GStreamer Pipeline can get surprisingly complex, and that's a great place for Python.19:12
jderoseQ: But wont Python make my GStreamer application slow because Python only allows on thread to run at once because of the Global Interpreter Lock (GIL)?19:12
jderoseA: No :)19:12
jderoseThe Python GIL means only one thread at a time can *manipulate Python state*.19:12
jderoseBut an arbitrary number of threads can run at once assuming those threads are't manipulating Python state (aka pretty much everything GStreamer does).19:12
jderoseSo repeat after me:19:13
jderose"Python wont make my GStreamer application slow, because after I assemble and start the pipeline, Python just sits there waiting for signals from GStreamer, and GStreamer with exactly the same performance it would have it the pipeline were assembled and started in C!"19:13
jderose:)19:13
jderose== LEARNING BY DOING ==19:14
jderoseokay, is everyone ready to play with some code?19:14
jderoseanyone needs a moment to catch up, at any point, please say so in #ubuntu-classroom-chat, which is also where you ask questions19:15
jderoseQUESTION: So, that's because the threads are just running code from an external lib, then, rather then Python code?19:15
jderosechadadavis: basically, yes.19:15
jderosegstreamer can/will create quite a few different threads, say for video playback19:16
jderoseand unless you wrote gstreamer plugins in python (which is possible, and handy for prototyping)19:17
jderosepython wont actually be doing anything in any of those threads19:17
jderosepython will just be sitting idle waiting for events from gstreamer19:17
jderosethe normal way to use gstreamer is all asyncronous19:17
jderoseokay, do doing stuff with multimedia, you always need a test video to work with:19:18
jderosehttp://cdn.novacut.com/jorge.ogv19:18
jderose:)19:18
jderoseeveryone go ahead and grab the example code here:19:19
jderosebzr branch lp:~jderose/+junk/machete19:19
jderoseor you can browse it here - http://bazaar.launchpad.net/~jderose/+junk/machete/files19:20
jderosei didn't quite have time to get all the minimal python examples together i wanted, so i'm ganna wing it a bit, but thats okay :)19:20
jderosegstreamer is a graph based pipeline, very genric at it's core19:21
jderosethe `gst-launch-0.10` command is very handy for quickly testing a pipeline, so lets look at ex1-audio-flac.sh - http://bazaar.launchpad.net/~jderose/+junk/machete/view/head:/ex1-audio-flac.sh19:22
=== kevin7060 is now known as seidos
jderosei know, not python yet, but this is a good way to see what gstreamer is going conceptually :)19:23
jderoseso the first element in this pipeline is `filesrc`... which reads from a file, in this case "jorge.ogv"19:23
jderosethe next element is `oggdemux`... ogg is a containing that can contain many different types of data inside: theroa video, vp8 video, vorbis audio, flac audio, etc19:24
jderoseso a demuxer will take a container as split out individual elementary streams19:25
jderosein this example, were just going to split out the vorbis audio, transcode to flac19:25
jderosenow gst-launch has some magic it dose behind the scences, so it's a bit more complex from python, where you're doing everything very explicity19:26
jderosenow, let me introduce you to handy cool you'll use all the time if you do much with gstreamer19:27
jderosein a terminal, run:19:27
jderosegst-inspect-0.10 vorbisdec19:27
jderosesudo apt-get install gstreamer0.10-tools19:28
jderoseyou might have to install that ^^^19:28
jderosethat work for everyone?19:28
jderoseif you scroll up in the output, you'll see something like this:19:29
jderose  SINK template: 'sink'19:29
jderose    Availability: Always19:29
jderose    Capabilities:19:29
jderose      audio/x-vorbis19:29
jderosevorbisdec can receive 'audio/x-vorbis', only19:30
jderosegstreamer has "caps" (capabilities) that describe what an element can consume (at its src pads), and what an element can produce (at its sink pads)19:31
jderoseso when you assemble and start a pipeline, the elements do some pretty amazing dynamic negotiation19:31
jderoseokay, back to example - http://bazaar.launchpad.net/~jderose/+junk/machete/view/head:/ex1-audio-flac.sh19:32
jderosethe `audiorate` rate element will duplicate or drop samples in order to make the buffer timestamps match whatever the global clock of the pipeline is19:33
jderoseit can also correct badly constructed files, or deal with issues where on formats idea of time is different than anothers19:33
jderosethis stuff gets trick to make work all the time because so many of the media files in the wild are often slightly broken, don't comply with a spec totally19:34
jderose`audioconvert`, okay, now we go back to gst-inspect-0.1019:34
jderosegst-inspect-0.10 vorbisdec19:35
jderose  SRC template: 'src'19:35
jderose    Availability: Always19:35
jderose    Capabilities:19:35
jderose      audio/x-raw-float19:35
jderose                   rate: [ 1, 2147483647 ]19:35
jderose               channels: [ 1, 256 ]19:35
jderose             endianness: 123419:35
jderose                  width: 3219:35
jderosegst-inspect-0.10 flacenc19:35
jderose  SINK template: 'sink'19:35
jderose    Availability: Always19:35
jderose    Capabilities:19:35
jderose      audio/x-raw-int19:35
jderose             endianness: 123419:35
jderose                 signed: true19:35
jderose                  width: 819:35
jderose                  depth: 819:35
jderose                   rate: [ 1, 655350 ]19:35
jderose               channels: [ 1, 8 ]19:35
jderoseso vorbisdec produces audio/x-raw-float, but flacenc consumes audio/x-raw-int19:36
jderoseyou might try removing the `audioconvert` from that pipeline, and you'll see that things wont work19:36
jderoseso audioconvert sees that on one side there is audio/x-raw-flow, the other audio/x-raw-int, and it converts between the two19:37
jderosemake sense?19:37
jderosehttp://bazaar.launchpad.net/~jderose/+junk/machete/view/head:/ex2-transcode.py19:38
jderosei didn't have time to trim this down, but here we go19:38
jderosehttp://bazaar.launchpad.net/~jderose/+junk/machete/view/head:/ex2-transcode.py#L23619:39
jderoselook at the AudioTranscoder class19:39
jderosethis is a common pattern in pygst19:39
jderosethere is a step you need, like trancoding audio, and you want it to me reusuable19:40
jderoseso you but the only process into a gst.Bin, and use that element abstractly19:40
jderosevery handy19:40
jderosegst.element_factory_make('queue')19:40
jderosethis deserves special mention19:40
jderosewhen you have something like a jorge.ogv, which has audio and video, you need to use queues like this:19:41
jderoseaudio side: demux => inq => dec => enc => outq => mux19:42
jderosevideo side: audio side: demux => inq => dec => enc => outq => mux19:42
jderosethis is because the audio and video are interleaved in the container, and if you don't do this, things will just hang because there wont be exactly enough to keep all the consumers happy19:43
jderose-- Getting Signals/Events from pygst --19:44
jderosehttp://bazaar.launchpad.net/~jderose/+junk/machete/view/head:/ex2-transcode.py#L30819:44
jderosechadadavis: QUESTION: So, a queue can be a mux or a demux, How does it know what's what?19:45
jderosewill, a queue itself is neither, a queue is a type of gstreamer element19:45
jderosegst-inspect-0.10 queue19:45
jderosea queue just means that buffers can be added before the last was consumed19:46
jderosemost of the gstreamer elements are 1-to-1: consume a buffer, do stuff, produce a buffer19:46
jderoseself.bus = self.pipeline.get_bus()19:47
jderoseyou get messages from pygst using a "bus"19:47
jderosethis is quite nice because it takes care of a threading issue that can be a pain...19:47
jderosemessages from the bus are only emitted in the main thread19:48
jderoseso your UI code can always safely manipulate the UI state based on the signal19:48
jderoseself.bus.connect('message::eos', self.on_eos)19:49
jderosethis signal is fired when the pipeline has completed, when say an entire file has been transcoded, rendered, played back, etc19:49
jderoseself.bus.connect('message::error', self.on_error)19:49
jderoseand this one when gstreamer encounters an error.... any time you build a pipeline, you'll probably have those two signals19:50
jderoseat least those two, that is19:50
jderosehttp://bazaar.launchpad.net/~jderose/+junk/machete/view/head:/ex2-transcode.py#L33119:50
jderosea Pipeline is sort of the main containing for all the gstreamer elements you chain together19:51
ClassBotThere are 10 minutes remaining in the current session.19:51
jderoseso any element that is linked into the chain *must* be in the pipeline19:51
jderosemurphy: QUESTION: what about progress events?19:52
jderosegood question :)19:52
jderoseso gstreamer doesn't have intrinsic progress events19:52
jderoseso what you do is great a gobject timeout that fires every 1 second or whatever19:53
jderoseand then you query gstreamer to figure out where it is the the pipeline19:53
jderoseyou would to this for a seek bar for audio/video playback19:53
jderoseor to get progress for transcoding19:53
jderosehttp://bazaar.launchpad.net/~jderose/+junk/machete/view/head:/ex2-transcode.py#L34819:54
jderosei know the times about up, but i want to talk about states a bit19:54
jderosegst.STATE_NULL - no resources have been alocated at all19:54
jderosegst.STATE_READY - plugins are ready, but they haven't actually touched any data, allocated buffers19:55
jderosegst.STATE_PAUSED - the first buffers have been consumed, pipeline is negotiated19:56
ClassBotThere are 5 minutes remaining in the current session.19:56
jderosegst.STATE_PLAYING - the loop is running, all the elements are consuming, producing, doing their thing19:56
jderoseso to query the pipeline at all, it must be in at least gst.STATE_PAUSED19:57
jderosewell, that's about time19:57
jderosesorry if this was a bit rough - this is my first time doing a session like this :)19:57
jderosei'm going to continue to work on that example repo, make it more useful19:58
jderoseso thanks everyone, and enjoy all the rest of the sessions! :)19:58
=== ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - https://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi || Questions in #ubuntu-classroom-chat || Event: Ubuntu App Developer Week - Current Session: KDE Development Intro: Q+A - Instructors: apachelogger
ClassBotLogs for this session will be available at http://irclogs.ubuntu.com/2011/04/12/%23ubuntu-classroom.html following the conclusion of the session.20:01
dpmhey everyone, we're up for a slight change of schedule on the next session20:05
dpmFirst of all a big applause to jderose for a great session20:05
dpmOriginally we scheduled a talk on writing KDE applications with KdeAppTemplate20:06
dpmbut the speaker could not make it this time20:06
dpmhowever...20:06
dpmfear not, we've got some cool KDE topics as a replacement for you20:07
dpmPlease welcome apachelogger and Riddell, who are going to do a quick intro and Q+A session on how to get started with KDE development20:07
dpmAll yours apachelogger and Riddell!20:08
apacheloggerthank you dpm20:08
apacheloggerhi everyone20:08
dpm(And everyone, line up your questions on #ubuntu-classroom-chat!)20:08
apacheloggerso, this session is highly dependent on your questions, the more you ask the better :)20:08
apacheloggerOne of the best resources for KDE development related topics is the KDE techbase20:10
apacheloggerhttp://techbase.kde.org/20:10
apacheloggeryou can find just about anything there20:10
ClassBotdpm asked: which tools do you recommend for getting started developing KDE applications?20:10
apacheloggerIt really depends on what you personally prefer. If you like IDEs there are 2 KDE (and Qt) centric ones. Namely KDevelop and QtCreator.20:11
apacheloggerThey are both very powerful and easy to use.20:11
apacheloggerOf course you can also use any editor and command line tools :)20:12
ClassBotbulldog98_konv asked: whom to poke to get help?20:12
apacheloggerNo one :P20:12
apacheloggerUsually it is best to just go to #kde-devel and ask your question20:12
Riddellkate is great for development without being filled with options20:13
apacheloggerMost of the time someone will be around to answer it.20:13
Riddellthe kde-devel mailing list is also good for questions20:13
apacheloggerIf that fails there is also a mailing list kde-devel@kde.org :)20:13
Riddellif you already have some code then reviewboard.kde.org is the place to post it to get feedback20:13
ClassBotstyx_ asked: Which language is recommended? Can i use java?20:13
apacheloggerGood question indeed. As with Qt itself, one can write applications in a number of languages.20:14
apacheloggerC++ being the (most) native language, but also Ruby, Python and C# are options20:14
apacheloggerThere used to be Java bindings but I think they disappeared (actually I believe they are just unmaintained, so if someone wants to pick that up... I am sure there are plenty of people who would love to write KDE magic in Java :))20:15
RiddellI'm a big fan of Python20:15
RiddellPyQt is well maintained and supported, PyKDE is popular and easy to use20:15
Riddelland none of the caring about memory stuff you get in C++20:16
Riddellalthough it can be easier to trip yourself up since there's no compiler to check all the syntax20:16
apacheloggerAlso a number of Kubuntu and KDE tools are written in PyKDE.20:16
apacheloggerLike the Kubuntu installer, or the KDE print applet20:16
ClassBotbulldog98_konv asked: is kparts recomended for a new application or should I try not to use them?20:17
apacheloggerThat is a very good question indeed. For all those that do not know what a kpart is .... simply put it is a GUI plugin20:17
RiddellNokia dropped funding for the Java bindings so they're unmaintained indeed20:18
apacheloggerFor example the HTML view frame of Konqueror is a KPart and as such could be easily integrated into any application (without build time dependency on it).20:18
apacheloggerSo, while KParts are very powerful, as they move a couple of build time decisions to runtime, they are also a bit of a complicated thing.20:19
apacheloggerMy advise is to think carefully about the advantages.20:19
apacheloggerIf you have none, you should not use a kpart.20:19
Riddellmost applications don't need KParts, I remember when I was developing Umbrello we'd get occational suggestions to turn it into a KPart but nobody could tell us why it was just a buzz word20:20
apacheloggeryeah20:20
Riddellbut they're great for e.g. rekonq where you can embed okular to read PDFs or Calligra where you can embed a spreadsheet in a word processing document20:20
apacheloggerCreating a kpart is pretty easy, so turning things into a kpart as a use case arises is mostly no problem (given appropriate code design ;))20:20
ClassBotbulldog98_konv asked: is it also possible to develop in JavaScript like Plasmoids?20:21
apacheloggerI do not think you can write actual applications in javascript (not yet).20:21
Riddellyou can consider QML a form of javascript and write in that20:22
apacheloggerHowever, as Qt recently grew new GUI magic called QML (which is based on JavasScript) it is entirely possible that in the not too far future you can indeed create apps using javascript.20:22
apacheloggerAt this point if you were using QML you would not have the desktop integration advantages that KDE has over Qt-only software.20:22
apacheloggerthough, generally you can do it already as Riddell suggested20:23
ClassBotsera10 asked: what is the state of QT/KDE integration into the Gnome desktop? (gstreamer, notifications, unity, ...)20:23
apacheloggerNow, this might sounds silly ... but it is spelled Qt, and pronnouced "cute" :)20:23
apacheloggerQt (and thus KDE) can visually integrate into GNOME/GTK+ such as that you would not notice they are not actually GTK applications20:24
apacheloggerhttp://labs.qt.nokia.com/2008/09/05/qgtkstyle-now-part-of-qt/20:25
Riddellthat's a nice feature of Qt, it goes out of its way to integrate with gnome.  I wish the equivalent was true with GTK20:25
apacheloggerKDE and Canonical are working together on the notification API, unfortunately GNOME itself is not contributing to the effort (not yet anyway).20:26
apacheloggersera10: I hope this answers the question more or less, if not please ask more precisely :)20:26
ClassBotdpm asked: we've heard a lot about introspection in the GNOME world in this App Developer Week (GObject Introspection, PyGI, etc.). Is there any similar move planned in the KDE world?20:26
RiddellKDE's Plasma team created the status notifier spec to replace the old systray protocol, that got adopted by Canonical for Unity where it's called app indicators20:27
RiddellCanonical also worked on the dbus menu spec which it helped bring to KDE, so that's some nice cross desktop work20:27
apacheloggerI am not particularly aware of what GObject Introspection is20:28
apacheloggerRiddell: do you know?20:28
Riddellgstreamer is a library for audio and video, nothing directly to do with the desktop, it's used by gnome applications and is a backend to Qt's multimedia API Phonon, so that's shared too20:28
apacheloggerAh, so regarding GObject introspection :D ... https://wiki.ubuntu.com/MeetingLogs/appdevweek1104/GObjectIntrospection20:29
Riddellnotifications have had a shared spec for a while, canonical changed that a bit by removing action from it which has since been picked up by KDE so its notifications work when running on unity20:29
apacheloggerreading the first 3 lines I can say, KDE has sort of such a thing20:29
RiddellQt has had introspection for over 15 years, I'm glad that gtk is catching up :)20:29
apacheloggerit is called smoke and basically responsible for generating almost all available KDE language bindings20:30
Riddellwhen you compile Qt code the classes get read through a programme called moc which adds introspection, signals/slots and other handy features20:30
apacheloggerhttp://quickgit.kde.org/?p=smokegen.git&a=summary <-- smoke is actually based on C++, thus faster than runtime introspection which is what QObjects (the Qt object type) have20:32
ClassBotdpm asked: what are the main technologies I should know about if I want to get started developing in KDE?20:33
=== seidos is now known as saytwo
apacheloggerYou will of course have to know the language you want to program in :)20:33
apacheloggerAdditionally some basic stuff about Qt (such as signals and slots).20:34
apacheloggerhttp://doc.qt.nokia.com/4.7/signalsandslots.html20:34
apacheloggerOther than that I can't think of much you would need to know really.20:35
apacheloggerRiddell: anything you would like to add?20:35
Riddellwell it depends on what you want to code of course20:35
Riddellif you want to code plasmoids then you need to know the plasma widgets20:35
Riddellif you're using traditional widgets you want to know about designer to create the UI and the main classes from QtCore and QtGUI to do stuff with them20:36
Riddellthen you probably want to look at some of the KDE classes which add and improve on the Qt ones20:36
RiddellQt has many good tutorials on its docs site and there's plenty of KDE ones on techbase20:37
ClassBotsera10 asked: How should I make an app that integrates in both the KDE and the Gnome environment, regarding menu integration, notifications, default applications registered with mime-types, etc. ?20:37
apacheloggerDepends on the menu you mean, if you mean the application menus, then that is actually a specification from freedesktop.org and implemented in both KDE and GNOME alike, so as long as you obey the spec you are good.20:38
apacheloggerhttp://standards.freedesktop.org/desktop-entry-spec/latest/20:39
=== EvilPhoenix is now known as TheEvilPhoenix
apacheloggerIf you mean the in-application menu (which for example is dragged out of the application in Unity, then you need to be in luck currently. Generally on Ubuntu all GTK apps can do that in KDE and all Qt apps (including KDE ones) can do it in Unity.20:40
apacheloggerOn other distributions it might or might not work equally well.20:40
=== saytwo is now known as kevin4896
apacheloggerdefault applications registered with mimetypes is part of the aforementioned desktop entry spec (in addition KDE has an overriding initial priority system, as KDE in general supports a couple more keys outlined by this specification)20:41
apacheloggerAny more questions?20:43
apacheloggerVery useful resources for development using the KDE platform: tutorials: http://techbase.kde.org/Development/Tutorials the API documentat: http://api.kde.org/ Qt documentation and examples: http://doc.qt.nokia.com/4.7/index.html20:44
RiddellKDE is an exciting community to be in just now, you can read on planet.kde.org about Plasma Active which is the new inititive to take KDE software to all sorts of devices20:44
Riddelland with innovative technologies like Nepomuk and Akonadi finally coming to fruition there's a lot of nice features becoming available and useable20:45
Riddelland it's pleasingly stable to use as a developer and user, no rewrites are happening underneith you20:46
ClassBotsera10 asked: regarding Nepomuk, is there a standard spec for search in the works?20:47
apacheloggerI do not think so.20:47
apacheloggerI would imagine breaking search API down to a common denominator would be rather crippling, usually if you want to do search in an application you do not only want to search some random file on the user's file system20:49
apacheloggerat least I could not imagine a use case for that :)20:50
ClassBotbulldog98_konv asked: what’s about the exapmels module?20:50
apacheloggerI suppose you mean http://quickgit.kde.org/?p=kdeexamples.git&a=summary20:50
apacheloggerwhich is indeed a very great resource of examples regarding KDE and KDE related technologies.20:51
ClassBotThere are 10 minutes remaining in the current session.20:51
apacheloggerlike attica, which is a library for the open collaboration service20:51
apacheloggerhttp://freedesktop.org/wiki/Specifications/open-collaboration-services20:51
apacheloggerAnd as I mentioned earlier, the KDE techbase simply contains everything you would want to know.20:52
apacheloggerFor example how to contribute to the KDE community: http://techbase.kde.org/Contribute20:52
apacheloggerWhich is a worthwhile effort really :)20:53
apacheloggerWith 6 minutes left in this session.... any final questions?20:54
ClassBotbulldog98_konv asked: is DesktopSummit worth coming to learn about KDE and KDE programming?20:55
apacheloggermaybe20:55
ClassBotThere are 5 minutes remaining in the current session.20:56
apacheloggerThere are 2 days of talks, which are worthwhile if you already have an idea about Qt and KDE20:56
Riddelldesktop summit is more about getting involved in the community, knowing who all the faces are, and working on ideas for future development20:57
apacheloggergoing there without knowing anything about it is probably a waste of time though .... except you are bound to meet interesting, nice and possibly even famous people (somtimes they are even all 3 of them, such as Riddell :*)20:57
* Riddell bats eyelids at apachelogger 20:58
apacheloggerWell.20:58
apacheloggerThanks everyone for coming and have fun developing awesome new KDE software :D20:59
RiddellI belive m_conley is up in a few minutes20:59
RiddellThunderbird + Unity = Awesome, and How JCStypes Lets You Get to the Candy20:59
apacheloggerNext up is Mike Conley telling us about Thunderbird and Unity and how the combination of them results in pure awesomeness :)21:00
=== ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - https://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi || Questions in #ubuntu-classroom-chat || Event: Ubuntu App Developer Week - Current Session: Thunderbird + Unity = Awesome, and How JCStypes Lets You Get to the Candy - Instructors: m_conley
ClassBotLogs for this session will be available at http://irclogs.ubuntu.com/2011/04/12/%23ubuntu-classroom.html following the conclusion of the session.21:01
m_conleyhey everybody!21:02
m_conleyMy name is Mike Conley, and I work for Mozilla as a developer on the Thunderbird e-mail client.  I was hired about 3 months ago, so I'm still learning my way around the Thunderbird codebase, but I think I'm starting to get the hang of it.21:02
m_conleyI've never given one of these sessions before, so I'm just going to play it by ear.  I have my talk more or less planned, but I might run short, seeing as I don't really know how much written material fits into an hour.21:02
m_conleySo please, feel free to ask questions if you have any in #ubuntu-classroom-chat.  I'll try to answer as many as I can.21:03
m_conleyAlso, let me know if I'm going too fast or too slow.  I'll adjust my speed accordingly.  :D21:03
m_conleyFirst, I'm going to talk about what I've been working on over the past few months.  Second, I'm going to show you some of the code I've written, and walk you through how it more or less works.  Then I'll try to answer any questions you all might have.21:03
m_conley== INTRO ==21:04
m_conleySo, over the past 3 months, I've been working on ways for Thunderbird to integrate nicely into the shiny new Ubuntu Unity interface.  There are three integration points that I've been working on:21:04
m_conley1)  The Messaging Menu:  we want quick access to compose and address book functions here, as well as indications for when new messages arrive.21:04
m_conley2)  The Unity Launcher:  we want to display the number of new, unread messages overtop of the Thunderbird icon in the launcher.21:04
m_conley3)  Ubuntu One:  we want Ubuntu One contacts synchronization support baked into Thunderbird21:04
m_conleyFor additional reading, here's a blog post discussing my work for #1 and #2, in case you want to know a little more about those projects:  http://mikeconley.ca/blog/2011/01/11/starting-work-on-mozilla-thunderbird/21:05
m_conley#3 is a relatively new project, and I only mention it for buzz.  :)  I won't be covering it today.21:05
m_conley#1 and #2 are the furthest along, and the ones I want to focus on today.  Extensions to integrate those features are available in Mozilla Labs for you to try if you'd like:  http://mzl.la/unitylauncher  http://mzl.la/messagingmenu .21:06
m_conleyNote that both require Thunderbird 3.3, and assume that you're running Ubuntu Natty.  Instructions for installing Thunderbird 3.3 are here:  http://www.liberiangeek.net/2011/03/install-latest-version-thunderbird-ubuntu-10-10-maverick-meerkat/21:06
m_conley(I know the instructions are for Maverick, but they'll work in Natty too, once you get to the Software Center)21:06
m_conleyBefore I continue, it's possible that some of you might not know what an extension for Thunderbird is made up of.  I'm going to go through that real quick.21:06
m_conley== What is a Thunderbird Extension Made Of? ==21:07
m_conleyI'm going to blast through this.  More deep, detailed documentation is available here:  Thunderbird extensions: https://developer.mozilla.org/en/Extensions/Thunderbird21:07
m_conleyIt might surprise you to know that large parts of Thunderbird are written in Javascript and a mark-up language called XUL (which is strikingly similar to HTML), and styled with CSS.21:07
m_conleyThe Javascript/XUL/CSS is then executed/rendered by the C++ engine (called "Gecko"), and boom:  Thunderbird.21:08
m_conleyImagine my surprise when I opened up the Thunderbird source code and saw Javascript staring back at me.  :D  Not what I expected.21:08
m_conleyThunderbird extensions also use Javascript, XUL and CSS.  This means that if you have web development skills, chances are you can build a Thunderbird extension.21:08
m_conleyIt's also possible to add C++ code to an extension to access more low-level libraries (such as libunity, or libindicate-gtk).  That's how I started with my Messaging Menu and Unity Launcher extensions - I wrote chunks of C++, and launched them from the Javascript portion of my extension.21:09
m_conleyAs far as I knew, this was the only way to do things:  I mean, how else am I supposed to talk to C libraries from a Thunderbird extension?21:09
m_conley== Introducing:  JS-Ctypes ==21:09
m_conleyAnd here is where JS-Ctypes comes in: https://developer.mozilla.org/en/js-ctypes21:09
m_conleyJS-Ctypes allows add-on developers to access and call C libraries from within the safety of Javascript.  And of course, this is Chrome-level Javascript - not the Javascript that is executed on webpages.21:09
m_conleyDon't worry - we're not letting web-site owners access system libraries here - we don't want an ActiveX fiasco. :p21:10
m_conleySo now I'm going to show you how I interact with the Unity Launcher.  First, note the Unity Launcher API here: https://wiki.ubuntu.com/Unity/LauncherAPI .  I used the Python example as a skeleton in order to set up the way my Javascript implementation works.21:10
m_conleyThe basic idea is, get the launcher entry for a particular application, set properties on it (like the count), and make sure those properties are visible (set count_visible to true).  That's all it takes to get the count up on the Launcher icon.21:11
m_conleySo, next I'm going to show you some of the code I wrote...21:11
m_conleyThis is UnityLauncherLib.jsm:  http://www.pastie.org/178513121:11
m_conley(Note the .jsm extension - this is a Javascript Module.  See https://developer.mozilla.org/en/JavaScript_code_modules/Using)21:12
m_conleyUnityLauncherLib.jsm is responsible for wrapping up all of the C library stuff for me.  The init and shutdown function do (as you've probably gathered) the set-up and teardowns for the library connection.21:12
m_conleyYou can look at that stuff later - what I'm interested in showing you starts on line 71 (the _declare function).21:12
m_conleyThe first thing you need to do when working with JS-Ctypes is to declare the types you're working with. Using library calls like unity_launcher_entry_get_for_desktop_file and unity_launcher_entry_set_count means manipulating UnityLauncherEntry objects.  We have to tell JS-Ctypes about those objects in order to manipulate them - the same way you'd declare a struct or class in a C++ header.21:13
m_conleyBut that'd mean declaring every single member of every single object that we'd have to manipulate, right?21:13
m_conleyWrong!21:13
m_conleyThe good news is that, with the way the Unity Launcher API is set up, I just have to pass a pointer to a UnityLauncherEntry to various functions.  I don't need to do any direct manipulation of the UnityLauncherEntry - I just pass it around.21:14
m_conleySo on line 73 of http://www.pastie.org/1785131, I declare an empty StructType called UnityLauncherEntry, and then a pointer type called UnityLauncherEntryRef.  UnityLauncherEntryRef is all I'll be passing around.  I suppose I also could have also used the type ctypes.voidptr_t.  That probably would work too.21:14
m_conleyOk, now I can declare the various functions I'm going to use, like unity_launcher_entry_set_count.  Line 91 is where I declare that function.21:15
m_conleyThe structure for that declaration is: I provide the name of the function call, the type of function (we're not on Windows, so it's default_abi), the return type (void), and then the argument types (UnityLauncherEntryRef and an unsigned integer).21:16
m_conleyThe following is then possible inside Javascript:21:16
m_conleymLauncher = UnityLauncherLib.ULEntryGetForDesktopFile("/usr/share/applications/thunderbird.desktop");21:16
m_conleyUnityLauncherLib.ULEntrySetCount(mLauncher, 1234);21:16
m_conleyUnityLauncherLib.ULEntrySetCountVisible(mLauncher, true);21:16
m_conleyAnd that would display a count of 1234 overtop of the Thunderbird icon in the Unity launcher.21:17
m_conleySimilar manipulation can be done to show a progress bar over the Unity launcher icon.  It's easy to imagine a progress bar to show how far along inbox syncing is.21:17
m_conleyAnd that's how I can interact with things like the Unity Launcher from the safety of Javascript.21:18
m_conleyAny questions so far?21:18
m_conleyAm I going too fast?  Am I breezing past things that you all want to talk about?21:18
m_conleyNo?21:19
m_conleyOk.  :)21:19
m_conleySo that's an example of how I can interact with things like the Unity Launcher from the safety of Javascript.21:19
m_conleySo we can call C function from within Javascript - but can we call Javascript functions from C?  Yes we can!21:20
m_conleyWhen indicators in the Messaging Menu are clicked, we want a callback function to be run.  In C/C++ this is done by using g_signal_connect to connect a function to the "user-display" event for an indicator.21:20
m_conleyI was able to use JS-Ctypes to wrap several GObject functions, including g_signal_connect (which is actually just a macro wrapping g_signal_connect_data).  Here's the GObjectLib.jsm file:  http://www.pastie.org/178757321:21
m_conleyOnce again, the interesting stuff is in _declare.  On line 42, I am able to define what the structure of a callback function looks like, and I use that in the definition of GSignalConnectData.21:21
m_conleySo, in my Messaging Menu extension code, with my GObjectLib loaded, I'm able to do this:21:22
m_conleyvar myCallback = function myCallback(aInstance, aTimestamp, aUserData) {21:22
m_conley  alert("Hello, callback world!");21:22
m_conley}21:23
m_conleymyCallbackFunction = GObjectLib.GCallbackFunction(myCallback);21:23
m_conleyGObjectLib.GSignalConnect(indicator, "user-display", myCallbackFunction, null);21:23
m_conleyWhere "indicator" is some indicator that's been spawned using a wrapped indicate_indicator_new.  (See http://www.pastie.org/1787649)21:23
m_conleyNow, when that indicator is clicked, the Javascript callback will be fired, and we'll get our alert box.21:24
m_conleyThis is pretty powerful stuff.  You get the full power of the system libraries, while staying within the managed environment of Javascript.21:24
m_conleySo that's how I'm using JS-Ctypes.21:26
m_conleyI suppose I'll talk about my work integrating with Ubuntu One next.21:27
m_conleySo, a bunch of you probably know this already, but Canonical offers a service called Ubuntu One21:28
m_conleyAmong other things, Ubuntu One offers contacts synchronization support21:28
m_conleyCurrently, Thunderbird allows users to connect to LDAP address books, and local storage address books.  On OSX, there's a system address book that we also connect to.21:30
m_conleyI'm working on adding an Ubuntu One Contacts address book to Thunderbird, to show the contacts that are stored via the Ubuntu One service21:30
m_conleySo, imagine this:21:30
m_conleyYou've been using Thunderbird for a while now on your laptop, and you've built up quite a large address book, with all of your friends and workmates organized into their groups21:31
m_conleyand then you go and drop your laptop into a lake21:31
m_conleyThankfully, once we've got Ubuntu One contacts support baked in, all you'd need to do is log into your Ubuntu One account on your new computer (because you'd probably get a new computer after that...)21:32
m_conleymagic synchronization happens, and bam:  your contacts are back in Thunderbird.21:32
m_conleyThe other nice thing about Ubuntu One contacts, is that it's built for *sharing*21:32
m_conleyand by sharing, I mean, sharing between applications21:32
m_conleyEvolution, for example, has the option of storing contacts via the Ubuntu One contacts synchronization service21:33
m_conleyIf you want to migrate from Evolution to Thunderbird, you just need to make sure all of your contacts are synchronized, and that's it.21:33
m_conleyThunderbird will start up, find your Evolution contacts, and away you go.21:34
m_conleySo that's what I'm working on, for Thunderbird + Unity integration21:36
m_conleyGoing back to JS-Ctypes - this doesn't just work in Thunderbird21:37
m_conleyit works in Firefox as well21:37
m_conleyIn fact, JS-Ctypes has been shipping in Firefox for quite a while.  So, some pretty powerful extensions are now possible.21:38
m_conleyImagine, for example, connecting the download manager to an Arduino via JS-Ctypes21:39
m_conleyYou could get a big light to flash once all of your downloads are completed.21:39
m_conleyThat's just off of the top of my head.21:39
m_conleySo, I guess I'll go into the declaration of types for a little bit.21:40
m_conleySo, JS-Ctypes wraps up the platform-specific fuzziness of types, and gives you a set of platform agnostic ones:  for example:21:41
m_conleyctypes.unsigned_int is your basic unsigned integer.  Cross-plat.21:41
m_conleySimilarly, ctypes.unsigned_char is your basic unsigned_char.21:42
m_conleyYou can declare entire objects with JS-Ctypes too, for example:21:42
m_conleySuppose we're attempting to work with a C library that manipulates a struct called Person, with a Name and an Age21:44
m_conleywe can define this using:21:44
m_conleyvar Person = new ctypes.StructType("Person", [{'name': ctypes.unsigned_char.ptr}, {'age': ctypes.unsigned_int}]);21:44
m_conleyWe could then pass that structure to the library, and it'll treat it just like it would if it was called from C or C++21:45
m_conleyOf course, once we start dealing C / C++ libraries, we get back into the issue of memory management21:46
m_conleyIn my Indicator library, for example, I create indicators using indicate_indicator_new21:46
m_conleyAfter instantiation, I'm responsible for freeing that memory.  I therefore had to wrap g_object_unref in my GObjectLib21:47
m_conleyand it works as you'd expect - I pass it a pointer to something I've allocated for (using the handy ctypes.voidptr_t - which is the equivalent of void *), and it'll do the rest.21:48
m_conleyIt's also important to close the connections to the libraries once you're finished with them21:48
m_conleyFor example, if I open up libgobject, like so:  lib = ctypes.open("libgobject-2.0.so"), I have to close it via lib.close().21:49
m_conleyIt's again worth emphasizing that JS-Ctypes is cross-platform.  That means that you can connect to Windows libraries and OSX libraries as well.21:49
m_conleyI don't use OSX myself, and I don't imagine most of you either (this *is* #ubuntu-classroom afterall), but I thought this was kind of neat:21:50
m_conleyhttps://developer.mozilla.org/en/js-ctypes/Examples/Add_to_iPhoto21:50
m_conleyThis example is for a Firefox extension that adds a context menu item to images21:51
ClassBotThere are 10 minutes remaining in the current session.21:51
m_conleyThe extension makes it so that right clicking on an image gives you the option to send that image directly to the built in photo program.21:51
m_conleySomething similar could be done with F-Spot, for example - though you might not need JS-Ctypes to do it.  I'm not familiar enough with the F-Spot API (if it has one) to say for certain.21:52
m_conleySo that's my talk.  I'll stick around for the next 10 minutes to answer any questions you might have.  Thanks for listening/reading!21:53
ClassBotThere are 5 minutes remaining in the current session.21:56
m_conleyAlright, I'll assume there aren't any questions.  Thanks for listening everyone!  Enjoy the rest of the talks!21:59
=== ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - https://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi || Questions in #ubuntu-classroom-chat || Event: Ubuntu App Developer Week - Current Session: Story: Unity, hacking on a real-world app - Instructors: Trevinho
ClassBotLogs for this session will be available at http://irclogs.ubuntu.com/2011/04/12/%23ubuntu-classroom.html following the conclusion of the session.22:01
TrevinhoHi all!22:03
TrevinhoI'm Marco Trevisan, also known in the Ubuntu Community as Treviño or 3v1n022:03
Trevinhojust for giving few informations about me, I'm a 25 years old student in Computer Science and I'm an Ubuntu user since the release of (K)ubuntu Breezy Badger (well, I started as a kubuntu user in fact)22:04
TrevinhoMy first approaches to the hUbuntu core were done as a 3rd party packager: I started packagin a lot of extra software in my "3v1n0" repository22:04
Trevinhothat was also for a certain period of time the main community reference for the ubuntu Compiz (Fusion) packages and loader scripts.22:05
TrevinhoIn recent times I've been involved in projects like Openmoko, Freesmartphone and SHR (www.openmoko.org, www.freesmartphone.org, www.shr-project.org, all related to the free phone development), Enlightenment (http://enlightenment.org with some elementary widget library work), Vala (the new GObject based language).22:05
TrevinhoFew months ago when Unity was announced to be the future of Ubuntu, also for the "standard" distribution, I was so excited since for me it was the first great step that ubuntu was doing for becoming something of really different, but using an open way.22:07
TrevinhoThis decision surely shown a great courage of the "Ubuntu headquarters", but I found that it have to be supported by the community to become real22:08
TrevinhoNow, Unity of course can't be considered just as the simple "lp:"unity" branch that basically includes the Compiz plugin that is able to creat the deskopt environment that we all known as "unity"22:09
TrevinhoUnity is more22:09
Trevinhounity is a new ecosystem made of many applications and libraries which cooperates in various ways allowing to get what you see as an "united" interface.22:10
TrevinhoAlso if it should be quite known, the unity architecture is based basically on:22:10
Trevinho * Compiz, which is the basic windows manager upon the unity interface is built22:11
Trevinho * unity-window-decorator, the windows decorator based on libmetacity22:11
Trevinho * libindicator, which is a library that factorizes some common features of an indicator, allowing to load one or a set of indicators into the unity panel22:12
Trevinho* BAMF, the Application Matching Framework which allows to associate each window to an application witha related .desktop file (if it exists)22:13
TrevinhoGoing more in the deep you can see unity (the compiz plugin) as the painter of the items that its sub-libraries and services allows to manage and connect22:13
TrevinhoIf you look at the main parts of the unity interface you can consider the Panel, the Launcher and the Dash22:14
TrevinhoThe Panel is, in the current implementation, basically fully populated by indicators; excluding the window title and controls, in fact, that bar is populated with (when installed):22:15
Trevinholibappmenu (indicator-appmenu, the indicator showing the menu)22:15
Trevinholibapplication (the indicator which loads and shows all the libappindicator's)22:15
Trevinholibsoundmenu (indicator-sound)22:15
Trevinho libnetworkmenu (indicator-network)22:15
Trevinholibmessaging (indicator-messages)22:15
Trevinholibdatetime (indicator-datetime)22:16
Trevinholibme (indicator-me)22:16
Trevinholibsession (indicator-session)22:16
TrevinhoThe unity-panel-service (see unity/services) is the daemon which loads the indicators and tells to the unity pllugin tho to show them.22:17
Trevinhothe unity Launcher is used for showing the icons used both for loading the dash lenses and the new application instances by type22:17
TrevinhoIts role is quite easy to understand, but its implmenetation is quite complex due to the fact that in the X11 system there's not a direct link between an XWindow and a desktop file, or between more windows (of the same level / hierarchy) coming from the same application.22:19
TrevinhoHere's where BAMF comes.22:19
TrevinhoThat framework has been written to export any window to an higher level and to associate them to a desktop file and a "dummy" application object.22:19
TrevinhoAll the informations that BAMF catches and organizes are finally exported via DBus to be used bu the unity launcher to understand what is happening in the desktop and to draw/manage correctly the launcher items/icons22:20
TrevinhoFinally the dash is the place where any unity loaded lens is shown, but I won't go more in deep here since there are some other sessions related to it.22:21
TrevinhoNow, to go back to my story which entitled the session, I've to say that I'm an advanced PC user and so I need that the tools I use are able to do what I expect from them; that's why every time I find and interesting project that needs some tuning I work on it to get what I'm missing...22:22
TrevinhoThat's in practice my application of the Eric S. Raymond famous motto «Every good work of software starts by scratching a developer's personal itch» that he states in "The Cathedral and the Bazaar".22:23
TrevinhoFew montsh ago, my first "unity" related "itch" appeared when I found this article by OMGubuntu ( http://go.3v1n0.net/eMRF4l ) showing a way to customiz the ubuntu clock panel applet.22:24
TrevinhoSince I was (as I still am) a great fan of the application indicators, also in Maverick I always used the indicator-applet-complete gnome-panel applet, to reduce to the minimum the usage of the other gnome applets.22:25
TrevinhoSo, when I found this nice trick, I looked a way to get it working in indicator-datetime too... I knew that indicator-datetime would be the future, so I decided to improve it.22:26
TrevinhoI never hacked the sources of an Ubuntu internal project (excluding patches), so I had to learn something about it22:27
TrevinhoI generally I don't use too much IRC or mailing lists, until I don't need to do that (for issues, or for RFCs), so I started my work by my own22:28
TrevinhoSo, the basic of bazaar usage are here: http://go.3v1n0.net/fDRS9Q and I guess that everyone here knows how to use it22:29
TrevinhoSo after branching it, I just had to work on it... And the hack I wanted to do was very easy so in few hours everything was on my branch at http://go.3v1n0.net/gwJkLo22:32
TrevinhoFor you informations, thanks to this clock-label-improvements for indicator-datetime22:33
Trevinhoyou can use any date/time style, included the ones you find in the OMGubuntu! article posted before with commands like:22:34
Trevinhogsettings set org.ayatana.indicator.datetime time-format "'custom'"22:34
Trevinhogsettings set org.ayatana.indicator.datetime custom-time-format "'%a <b>%I:%M %p</b>'"22:34
TrevinhoHowever, after this hack... I found the process of the ubuntu development very quick and open to the community22:35
Trevinhoso I decided to continue in my path working on other things that I missed in "my" ubuntu....22:35
TrevinhoA great itch I had about indicator-sound was that I wasn't able to see in aprecise way the new volume level of my system when using the scrolling hweel over the indicator icon to adjust the volume.22:37
TrevinhoThat was a very common operation for me and since indicators doesn't support, by design, any form of tooltips22:37
TrevinhoI decided to implement it using a particular way, following what has already been done for the volume keys...22:38
TrevinhoBasically I made possible to show a notify-osd bubble showing the new volume level22:40
Trevinhowhen a scroll-event was registerd over the indicator-sound icon; more informations about this implementation are available at the merge proposal: http://go.3v1n0.net/gNy0Qj22:41
TrevinhoAll this work lead to me to a greater work22:43
Trevinhowhich made me understand a lot of the unity infrastructure related to ubuntu indicators22:43
Trevinhoor better, an ubuntu AppIndicator22:44
=== Trevinho_ is now known as Trevinho
ClassBotThere are 10 minutes remaining in the current session.22:51
TrevinhoOk I'm back22:52
Trevinhosorry I had a network outage22:52
Trevinhoand I wasn't able to get the permission to write back :P22:52
ClassBotjsjgruber89 asked: How do libapplication and unity-panel-service determine what to load?22:53
TrevinhoWell, libappapplication is used by applications that want to add an AppIndicator22:53
Trevinhounity-panel-service is a service as the name states, that waits incoming DBus calls. These calls are perfomed by libappindicators22:55
ClassBotThere are 5 minutes remaining in the current session.22:56
TrevinhoHowever going back to the story.... I was telling about the libappindicator work I did...22:58
TrevinhoPractically I added support for developers to catch the "scroll" events over an appindicator icont too.22:59
TrevinhoBut this work was quite complex as you can read in this bug report I did: https://bugs.launchpad.net/indicator-application/+bug/70818022:59
=== emma_ is now known as em
Trevinhobecause an indicator-application is really a set of indicators23:00
Trevinhoand there is a mix of DBus signals and methods and glib signals to perform operations from the lower level (the libindicator) to the higher one (the unity panel)23:01
ClassBotLogs for this session will be available at http://irclogs.ubuntu.com/2011/04/12/%23ubuntu-classroom.html23:01
=== ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - https://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi || Questions in #ubuntu-classroom-chat ||
TrevinhoSo, the hour is finished, but I'll use bit of extra time to end the story :P23:02
Trevinhoso, to make the long story short, Afther this first bounch of patches I continued with some others more unity related23:03
Trevinhowork with some patches23:04
Trevinhoto improve its look like23:04
Trevinhohttps://code.launchpad.net/~3v1n0/unity/fading-title (which cuts long window titles with fading, that then I've made also for metacity)23:05
TrevinhoAnd the intellihide / autohide support https://code.launchpad.net/~3v1n0/unity/autohide-intellihide23:05
TrevinhoHowever, I guess that you can read more about these patches in launchpad23:07
Trevinhothe important thing that I want to explain is how to get there... The first part is study the sources and army yourself with the grep and few others development tools like gedit and some gedit-plugins you like23:09
Trevinhofor managing the sources I've mostly used plain bazaar with the bzr-gtk plugin23:09
Trevinhoto use tools like "bzr glog", "bzr gcommit", "bzr gdiff" (and so on) commands which could speed up your sources versioning process23:10
TrevinhoBasically when you want to hack to an ubuntu project all you need to do is23:10
Trevinho* branch it wit bzr branch lp:<project_name>23:10
Trevinho* work on it with your tools23:11
Trevinhowhen you're ready just push it as  a your branch of that project with23:11
Trevinhobzr push lp:~YourLPname/<project_name>/<branch-name>23:11
TrevinhoSo you need to do a merge proposal23:12
TrevinhoAnd you can do it with launchpad powerful merging tools23:12
Trevinhothis is the key moment.23:13
TrevinhoI've to say that in my experience the reviewers were always very fast to approve, and I got very few corrections (just typos), but it could happen that you get rejected or you need to rewrite something23:14
Trevinhohowever the ubuntu developers are and I guess that will always be very open to the community contributions23:15
Trevinhoespecially with unity coming, that is the creation of something new from the basis.23:15
TrevinhoAbout contacting the developers, I'd suggest you to use the launchpad mails or the ayatana ML if you need to do augmented discussions, but for a very fast communication23:18
Trevinhoit's better to use new channels as are the microblogs like twitter or identi.ca23:18
Trevinhomany ubuntu developers are there (see https://twitter.com/list/3v1n0/ubuntu) and I think that it's the better way to keep them in touch.23:19
TrevinhoFinally I remember you that if you want to start to work in Unity and related projects23:20
Trevinhothe best way is to start from the bitesize bugs: https://wiki.ubuntu.com/Unity/Bitesize23:20
Trevinhoread that wiki and the many castrojo's blogs about them go get started23:21
Trevinhoand join the ubuntu development!23:21
TrevinhoIf there are no more questions (don't use the ClassBot, but just post them in #ubuntu-classroom-chat), I thank you all for the attention and who gave me this opportunity23:22
TrevinhoSorry for the network issues and my time overrun...23:23
Trevinho:)23:23
TrevinhoOk... Good bye all so :)23:26

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!