=== kdrsx is now known as kuadrosx [03:16] hey guys, is there are any way to get the app dev week stuff I'm going to miss this week? I've got a totally loaded week but there's some stuff I wouldn't (but have) to miss. Thanks! [03:18] Avo, there are IRC logs [03:19] And would that have all the important info? [03:19] everything is happening on #ubuntu-classroom or #ubuntu-classroom-chat [03:20] Ah cool, cool. That's what I'll do then. Thanks!! [03:20] you can find logs here: http://irclogs.ubuntu.com/ === uchobby is now known as uchobby_afk [05:22] hello === vorian is now known as v === v is now known as theMaster === theMaster is now known as v [05:35] join #ubuntu [05:37] can someone tell me how to protect ubuntu wiki pages from editing ? === purvesh__ is now known as purvesh === purvesh_ is now known as purvesh [15:53] 7 minutes until we start! [15:59] Hello [16:00] Hi everyone [16:00] welcome to day #2 of ubuntu application developer week! [16:00] Hi! [16:00] I hope everyone has had a good time so far [16:00] ok, so from now on please move all discussion to #ubuntu-classroom-chat [16:00] so that the speaker can present in here === 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: From vision to an Ubuntu application in 4 simple steps - Instructors: didrocks [16:01] first up today we have Didier Rocks, aka, didrocks [16:01] Logs for this session will be available at http://irclogs.ubuntu.com/2010/09/28/%23ubuntu-classroom.html following the conclusion of the session. [16:01] 4 steps to an ubuntu application [16:01] didrocks, ready? [16:01] jcastro: yeah o/ [16:01] thanks jcastro! [16:01] welcome everyone :) [16:02] can you raise your hands on #ubuntu-classroom-chat so that I can know how many people we have there? === PedoBear is now known as lol_bear [16:02] good, a lot of people there! [16:03] welcome to the session on "4 steps to develop your application for ubuntu" [16:03] this session will be mostly a basic presentation of Quickly, which is the application we started to develop one year and half ago for developping applications in ubuntu [16:04] do you know about Quickly?, please answer in #ubuntu-classroom-chat [16:04] (that will enable me to know what's the audience is :)) [16:05] ok, some people know about it, others don't :-) this session is really on basics of Quickly, let's start on it [16:05] so, some quick words of presentation first [16:05] my name is Didier Roche, I'm working in the ubuntu desktop team on updating GNOME and UNE (Ubuntu Netbook Edition) [16:05] I'm maintaining unity, that some of you probably heard of [16:05] also, as a spare time project with Rick Spencer, I'm hacking on Quickly [16:06] so, what is Quickly? [16:06] Quickly is to bring back fun in development! [16:06] Rick, the person who created the concept of Quickly, call it, among other things, an "Application Templating System" [16:07] the essence of the project is to provide you boiler plate for the kind of program you want to write [16:07] the boiler plate is the code that you would have to write for every program of a certain type gets generated for you [16:07] we have different boiler plates right now: [16:07] ubuntu-application, ubuntu-cli and ubuntu-pygame in lucid and maverick [16:07] some people seem to create new boiler plate, like vala and such [16:08] but Quickly is also a set of commands [16:08] the commands are designed to integrate with the Ubuntu Application infrastructure [16:08] things like bzr, launchpad, PPAs, etc.. [16:08] those are something hard to learn when you just want to develop for fun [16:09] and you have a lot to look at too [16:09] the commands are what make all that work for you! [16:09] The moto of Quickly is "Easy and Fun" [16:09] while I'll answer to the first set of questions, you can install it (not mandatory to follow the session): sudo apt-get install quickly [16:09] doktor777 asked: do you know any popular app developed with quickly? [16:10] some applications on ubuntu are using Quickly [16:10] like bughugger, pytask, lernid [16:10] (maybe some of you are using lernid to follow the session btw) [16:10] there are others apps like photobomb and such that are develop with Quickly [16:11] you can find them at http://theravingrick.blogspot.com/ [16:11] but Quickly isn't made to create huge applications, it's more for what most of 1 person team will do [16:12] so, it fits most of the needs we can have, I guess [16:12] Kruptein asked: so is quicly a programing language on it self or does it use an other language? [16:12] Quickly is a set of templates and commands [16:12] that means, the templates contains the code [16:13] I'll discuss about that later on, but the templates I presented before are made of python [16:13] but there is a incoming vala template [16:13] and theorically template (and commands) can from every languages you want [16:13] hernejj asked: Does quickly help with packaging as well? [16:13] yeah, and this is the goodness :) [16:14] in one command, you can create a release, get a package, uploading the tarball to launchpad, create a milestone, get a changelog and push your project in your ppa [16:14] no need to harrass to create the package manually [16:14] or to file the dependencies :) [16:14] doktor777 asked: how stable/mature it is? [16:14] Quickly has been launched in may 2009 [16:15] so, it's more or less one year and half [16:15] it's quite mature, contains a lot of code [16:15] and we handle upgrade and such of your project [16:15] zinga24 asked: what templates does it deliver? gui-templates? [16:15] so, with Quickly, on ubuntu, you have 3 templates: [16:15] ubuntu-application: is a template creating a gui application [16:16] (I'll present it in more extends later on) [16:16] ubuntu-cli is for command line application [16:16] and ubuntu-pygame for small and fun games using pygame [16:16] you can hav some examples on the link pasted before [16:16] Kruptein asked: so can I pack my python programs in quickly to generate the packages only? [16:16] right, and some people did that as far as I know of [16:17] you just have to create some files like a .quickly file as root with some parameters [16:17] we can help you with that if you jump to #quickly on freenode [16:17] doktor777 asked: what do you mean by "and we handle upgrade and such of your project" ? [16:17] for instance, in Quickly 0.4, we introduced apport support [16:18] and launchpad integration as well you know, the "ask a question/report a bug" in the help menu of default ubuntu application? [16:18] we thought it would be good for application which were created with Quickly 0.2 to get those 2 things on upgrade [16:18] and so, it's optionnaly added to people upgrading [16:18] that's what I meant by on "upgrade" [16:19] ok, no more question in the queue [16:19] let's continue then :) [16:19] so, first, what *is not* Quickly [16:19] Quickly is not an IDE [16:19] but you can use whatever IDE you want [16:20] it's a command line tool and there is some API for people wanting to bind it to an IDE [16:20] So, the title of the classroom was "4 steps to create your application" [16:20] let's begin for step 0, before the first one :) [16:20] think what you want to achieve with your application [16:21] try to not NIH (Not Invented Here) and reinventing the whell [16:21] why people want to install and then use your futur application instead of existing one? [16:21] so design is the most important step in my opinion :) [16:22] and no rush to step 1 until then! [16:22] step 1 is creating your application [16:22] which Quickly, it's fairly easy [16:22] $ quickly create ubuntu-application foo [16:22] this will create a "foo" ubuntu-application in a "foo" directory [16:23] you will have all what's needed with an application, like: [16:23] preferences integrations, menus, about box, easter eggs :) [16:23] so, quickly create launch your application and you can see the boiler plate [16:24] of course, you have all internationalization support and some icon/desktop file as well for people wanting to use it [16:24] the most important part is that there is no dependency on Quickly itself for your application [16:25] all is based on well known technology, but your application is then independent (in other words, Quickly isn't a framework) [16:25] and that's by design [16:25] so, for people running it during the session, you can see in the folder a lot of files have been created for you [16:26] in the ubuntu-application template, you have: [16:26] - python as a language to develop in [16:26] - glade for editing the GUI [16:26] - gedit as default editor (you can override this by exporting the EDITOR variable) [16:26] - pygtk for the toolkit [16:26] - desktopcouch for storing persistent data [16:26] - launchpad integration [16:26] all is chosen for helping you starting with your app [16:27] - (and bzr for revision control) [16:27] then, if you are confident enough and know what you need, you can remove each block you don't want and replace by yours [16:27] or create your own template even! [16:27] the idea is really to drive development and help opportunistic developer to know "where to start" [16:27] rather than beeing lost in choices [16:27] for helping starting development too, we have a complete tutorial: [16:27] $ cd foo/ [16:28] $ quickly tutorial [16:28] this will bring you up the tutorial for the ubuntu-application template [16:28] Quickly has a lot of shell completion goodness [16:29] depending on where you are, it will suggest the right command on the right time [16:29] so, do not hesitate to press tab tab :) [16:29] also I heard that an "ubuntu developer manual" is on the way :) [16:29] this one will use Quickly as well and will be a good documentation reference [16:30] let's see to some questions before moving to step 2 :) [16:30] doktor777 asked: and how do you upgrade, there's a command for that? [16:30] $ quickly upgrade [16:30] but it's launched for your each time Quickly is upgraded on your system and your application isn't transitionned [16:30] so nothing to worry about :) [16:31] gaberlunzie44 asked: does quickly templates accept user input to customise/personalise apps? [16:31] sure, once the application created, it's yours! [16:31] so, as I said, you can customize every part of it [16:31] and there is no dep on Quickly, you can use qt instead of gtk for instance :) [16:31] blackrock asked: Can I use git instead of bzr? [16:31] ah, the traditional questions :) [16:32] well, git isn't integrated to launchpad as well as bzr [16:32] and a lot of people are telling "I want to use git with Quickly" [16:32] well, you can create a ubuntu-git-application template :) [16:32] and change the commands to use git [16:32] but you will surely loose a lot of integration I'll explain afterwards [16:33] and ideally, if you only use Quickly, you don't need to know which versionning system is used for you [16:33] (for instance, you don't bzr commit, but you quickly save) [16:33] doktor777 asked: hmm, I'd prefer to launch a command myself, can the auto-upgrade be easily disabled? [16:34] no, but you can create a template which doesn't have upgrade [16:34] we changed the format sometimes and we bzr commit before and after the upgrade [16:34] so you still can revert [16:34] ok, no more question, let's move on step 2 then! [16:34] once you know what you want to do [16:35] and how to do it (the tutorial), with some base (the app you created), it's time to personalize your application [16:35] this can be done with: [16:35] $ quickly design [16:36] this commands fires up glade to edit your user interface [16:36] glade is a tool for building gtk-based UI [16:36] (old screenshot of it: http://glade.gnome.org/images/glade-main-page.png) [16:36] so, you can there add widgets [16:36] change your window size [16:36] labels and such [16:36] you choose your components and draw them on the application area [16:36] the quickly tutorial explains the basic of this [16:37] in fact, Glade is a UI editing tool, that creates the XML you need to describe your windows and widgets [16:37] don't worry because the quickly template totally handles keeping the code and the XML hooked up [16:37] if others templates, like if kubuntu comes, we assume it won't use glade, obviously :) [16:37] hence the "design" command to launch it and not "glade" [16:37] so here are some tips for using Glade if you are new to Glade [16:38] first, adding widgets works like a fill tool [16:38] you click the widget you want in the toolbox, and then click where you want it to be on the window [16:38] the widgets will then fill the space alloted to it [16:38] to layout the form, you use HBoxes and VBoxes [16:38] an HBox handles Horizontal layout, and a VBox handles vertical [16:38] so you will find yourself putting lots of boxes within boxes [16:38] when you add a widget to a window, you can select it in the "inspector" tree if it is hard to select in the window itself' [16:39] boxes can be hard to select in the window, for example [16:39] if a widget is in a box, use the position property in the "Property editor" window in the "packing" tab to change the order [16:39] you can also add new dialogs with Quickly: [16:39] 1. close glade [16:39] 2. run: quickly add dialog [16:39] 3. quickly design [16:39] and you will see the new dialog opened for you in glade :) [16:40] then, once you have done that, you want to create some kind to use your new widgets and dialogs [16:40] for that: [16:40] quickly edit [16:40] it will fire up gedit in the ubuntu-application template (and derivatives) [16:41] it will configure it to use spaces instead of tabs and spaces to behave like tabs [16:41] it opens every files you need to work with [16:41] so, that's where the hard work should take place :) [16:41] but don't take that too hard and test regularly which will be our step 3 after I answer some questions [16:42] as told previously, you can take some snapshot of your code with: [16:42] $ quickly save [16:42] or even: [16:42] $ quickly save implement a fantastic dialog to make cow to moooo [16:42] if you want to give a reason of what you have done :) [16:42] blackrock asked: How do you create new template (like ubuntu-cli, ubuntu-application)? [16:42] really easy [16:43] ubuntu-cli and ubuntu-pygame are basically 0 line of code! [16:43] yeah, 0 :) [16:43] the commands are the same that in ubuntu-application [16:43] we just ship a different boiler plate [16:43] for that, Quickly support inheritance [16:43] which means "imports commands from" [16:43] so, ubuntu-cli imports all commands from ubuntu-application [16:44] if you want to create your own template, you can start by an existing one [16:44] like [16:44] $ quickly quickly ubuntu-application my-new-template [16:44] and it will create my-new-template in ~/quickly-templates, importing by default all commands from ubuntu-application [16:44] you can also create your own template in /quickly-templates [16:44] ~/quickly-templates, [16:45] I've documented that in my blog, which is down right now as I'm moving, sorry :) [16:45] but for further reference: [16:45] http://blog.didrocks.fr [16:45] (once up again) [16:45] ozalexo asked: Why XML? And why not YAML? [16:45] ask that to glade people :) [16:46] Kruptein asked: I'm using wxPython and have actually already created my project in python, why would/should I use quickly? or should I better stay with what I have right now [16:46] well, let's see the packaging part and we will discuss that :) [16:46] so, quickly on step 3 :) [16:46] which is testing! [16:46] to run your application from trunk [16:46] quickly run [16:46] this will enables your, taking all the right paths for you, to test it extensivily [16:47] if you want some people to test it, you can share a small first package with them [16:47] quickly share [16:47] it will upload to your ppa a packaged snapshot of your application [16:47] and so, people can test [16:47] quickly debug [16:47] is for debugging your application in winpdb [16:47] ok, so, now, the step your are all expected is release! [16:48] when you really want everyone to see your apps in a shiny stable version! [16:48] we took days and days to think about the name and the command to use :) [16:48] and finally, we ended up with: [16:48] quickly release [16:48] :) [16:48] this commands does a lot for you [16:49] it's packaging your application, changing some path for you to use system libraries (if present) [16:49] it detects all the dependencies needed [16:49] and put that into the package [16:49] it will create a gpg key for you if you don't have one on launchpad [16:49] same for ssh key [16:49] it's pushing your code in the trunk in launchpad, tagging it as stable [16:50] also, it detects all the ppa you have access too and push to it [16:50] also, it collects all messages you put in quickly save, and create an annoucement with that [16:50] publish through launchpad rss feed [16:50] also, it takes your upstream tarball, sign it with the gpg key, create the launchpad milestone and attaching everything for you [16:51] and finally, it exports the translations for you to launchpad so that people can translate your application [16:51] (in next version, it will import them for you as well :)) [16:51] *phew* just that for one shiny little command :) [16:51] the release command just use the ubuntu way of creating version [16:52] like YY.MM [16:52] so, if you release this month [16:52] it will be 10.10 [16:52] oupss [16:52] 10.09 [16:52] (living in futur, it seems :)) [16:52] if you release again tomorrow, it will be 10.09.1 [16:52] and so on… [16:52] ok, seeing a lot of questions, let's go back to them [16:53] ozalexo asked: can I just create a deb package without putting it to launchpad? [16:53] and the answer is… yes! [16:53] quickly package :) [16:53] this will create a .deb that you can install locally [16:53] gabri_biolab asked: I've allready developed a project in C++ Qt ITK VTK as external libraries, is there a way to easy move my existing project to quickly? [16:53] current templates are made of python [16:54] but we just count on people to extend and create new templates! [16:54] the core (the part common to templates) is in python, but templates and commands can be in whatever language of your wish [16:54] louis-nb asked: why is postfix a dependency? [16:54] ahah, good one! [16:55] (this is in Quickly itself, not in your applications) [16:55] well, Quickly is pulling a lot of developers tools for you [16:55] to be able to create a package and such [16:55] one of them in ubuntu-dev-tools [16:55] which has a lot of deps [16:55] and one of those deps (devscripts if I remember correctly) is depending on postfix [16:55] that's something I want to fix [16:56] patch devscripts in ubuntu and debian [16:56] to make postfix optional [16:56] but it's taking time! [16:56] I've already had a look some months ago [16:56] but being sidetrack :) [16:56] Kruptein asked: you said: it will push to every ppa you have access too, but why would I want to push "foo" to "bar" if I have both access to "foo" and "bar" which do not have to do anything with eachother [16:56] by default, it's picking the older one [16:57] but you have commands to configure that [16:57] already a complicated command name [16:57] quickly configure [16:57] so [16:57] quickly configure ppa my-ppa-name [16:57] (use tab completion, you will see what you can configure with) [16:57] quickly configure [16:57] in bahs [16:57] bash* [16:58] also, think about the help on commands [16:58] quickly help [16:58] will bring you the correct command help depending on the context [16:58] to see you command you can have help… [16:58] shell completion again! quickly help [16:58] ok, let's quickly wrapping up [16:59] so, for references: [16:59] https://wiki.ubuntu.com/Quickly#Other Resources [16:59] you can see we got some press review, this is not exhaustive [16:59] we also welcome everyone on #quickly on freenode :) [17:00] and welcome contributions, a lot of people are contributing to quickly as well as in quickly-widgets === 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: SHOWCASE: Pytask - Instructors: nisshh [17:00] (the latter is definitively a project you should look at) [17:00] yeah, just in time! [17:00] Logs for this session will be available at http://irclogs.ubuntu.com/2010/09/28/%23ubuntu-classroom.html following the conclusion of the session. [17:00] thanks everyone [17:01] thanks didrocks! [17:01] nisshh, you're up! [17:01] yep [17:01] ok, hello everyone! [17:01] my name is Ryan Macnish, and this session is about my app called Pytask [17:02] which is created and maintained with Quickly [17:02] can i get a show of hands to see who is here right now? [17:02] in -chat of course :) [17:02] ok, looks like a fair few [17:03] right [17:03] i created Pytask way back in the middle of last year [17:04] i wanted to get going with Python and GTK back then, and Pytask was the first thing that came into my head [17:04] link to Pytask on launchpad: https://launchpad.net/pytask [17:05] back when i first started the project, i was writing it in pure GTK [17:05] sorry pure pyGTK [17:06] TobiS asked: Do you have a website of your project with some information? [17:06] see my link to the project page on launchpad above [17:07] sometime later that year, i discovered glade, so i started using that to develop the GUI [17:07] fastforward to about march this year [17:07] and thats when i discovered the hidden gem that was Quickly [17:08] but anyway, thats enough story :) [17:09] basically, Pytask uses a combination of Quickly, Quickly-Widgets (which ill talk about in a sec) and CouchDB [17:09] Currently Pytask is such a simple application [17:10] it consists of just the Quickly generated code, plus less than 100 lines of code that i added in [17:10] thats right, LESS than 100 lines of code [17:11] it was possible to do this because i used Quickly and Quickly-Widgets [17:12] Quickly-Widgets is basically a convenience [17:12] it makes it much, much easier to create and modify certain widgets [17:13] such as Treeviews, Couchgrids (which i will talk about in a sec), and popup yes/no/ok dialogs [17:14] before i continue are there any more questions? [17:14] no? [17:14] ok [17:15] moving on, now ill talk about Couchgrid :) [17:15] Couchgrid in quickly-widgets is really awesome [17:16] with Pytask, it basically allowed me to do 3 things very, very easily: [17:16] 1) create and show an editable treeview [17:16] 2) easily modify the contents and arrangement of that treeview [17:17] 3) sync the tasks in the treeview with Ubuntu One [17:17] oh [17:17] for those of you who dont know, Pytask is a todo list management app [17:17] similar to Getting Things Gnome [17:19] number 3 is especially cool, since it allows me to sync tasks with Ubuntu One, with just a few lines of code :) [17:19] gaberlunzie44 asked: what quickly commands are used for widgets and db connectivity? [17:19] very good question [17:19] for the db connectivity, there are no quickly commands [17:20] i simply had to import quickly widgets into my Pytask code [17:20] and create the db itself, plus some keys [17:21] currently, the only release of Pytask that can Sync with Ubuntu One is 10.06.1 [17:21] (the latest one) [17:22] there is one little quirk though [17:23] originally, Rick Spencer named quickly-widgets Quidgets [17:23] so on launchpad, the project is Quidgets [17:23] but in lucid and maverick [17:23] the package is called quickly-widgets [17:25] as an added bonus of Pytask using quickly-widgets, i have worked with Rick Spencer to iron out many bugs from quickly-widgets, just for you guys :) [17:25] now, CouchDB :) [17:26] Couchgrid uses CouchDB to sync with Ubuntu one [17:26] and Couchgrid is included in quickly-widgets [17:27] couchDB makes it super simple to create, delete, edit, modify, etc [17:28] all your databases and database entries [17:28] gaberlunzie44 asked: link for quickly-widgets? (just to be complete) [17:28] https://launchpad.net/quidgets [17:28] thats quickly-widgets on launchpad [17:29] moving on [17:30] now, one awesome feature that i am working on for one of the upcoming releases of Pytask [17:30] is the ability to use tasks interchangeably between Pytask and Getting Things Gnome [17:30] this is made possible [17:31] because Getting Things Gnome has support for multiple backends [17:31] one of which is CouchDB [17:31] (the same one as Pytask uses) [17:32] so what will eventually be possible [17:32] is that you will be able to create your tasks in say, Getting Things Gnome, while using the CouchDB backend of course [17:33] then if you decide you like Pytask better, simply load it up, and force Pytask to use the same database as Getting Things Gnome [17:33] this isnt currently possible, even in trunk [17:33] but it will be very soon [17:34] the next version of Pytask will, feature Indicator support [17:34] which will just make it hideable on the desktop [17:35] before i go any further, do we have any more questions? [17:35] ok [17:35] moving on [17:37] the latest release of Pytask is always available in my PPA here: https://launchpad.net/~nisshh/+archive/pytask-releases [17:37] which currently wont work for maverick users [17:37] but is good to go for lucid [17:37] gaberlunzie44 asked: any plan for a graph/chart view, like a gantt? [17:38] no, not currently [17:38] when i created Pytask, i planned it to be more on the simple side [17:39] but, as time goes on, i may add features like that [17:39] that reminds me [17:39] another feature i am very excited to be adding in soon [17:39] is launchpadlib support [17:40] whats this you ask? [17:40] launchpadlib is a Python library that allows you to fetch objects from launchpad [17:41] things like bug titles, project names, etc [17:41] you can even write new data to launchpad with it if you wish [17:41] anyway [17:42] what i want to do is enable Pytask to fetch data from launchpad so it can be included in tasks [17:42] for example: [17:42] say i wanted to create a task reminding me to fix a certain bug in one of my projects on launchpad [17:43] i could either add the information manually (the bug number, title, and project name) [17:43] OR [17:43] i could do it the cool way [17:44] and use launchpadlib to quickly fetch the data from launchpad (anonymously, for those of you worried about privacy) [17:44] and have Pytask automatically add it to the task in question [17:44] sounds cool huh? [17:45] any questions about that before i move on> [17:45] ok [17:45] moving on [17:46] gaberlunzie44 asked: what about sharing? thru launchpad? [17:46] this, is interesting [17:46] if its what i think it is that your refferring to [17:47] sharing tasks through launchpad would not work really [17:48] although, im not sure how that would benefit anyway [17:48] ok [17:49] hackerswami asked: Couldn't sharing work via Ubuntu one support? [17:49] thats exactly what Pytask already does [17:49] Pytask saves tasks into a CouchDB database [17:50] which then automatically get synced through Ubuntu One [17:50] to any other computers connected to the same Ubuntu One account [17:51] that is why i love Couchgrid so much :) [17:51] also, after i push out the next release, ill be working with some people on the Ubuntu Desktop team [17:52] to get Pytask into the official repositories [17:52] for the uninitiated, that means you will be able to install it from the software centre :) [17:53] and471_42 asked: now that you have gone quite far in pytask, are there somethings that when you look back, you wish you had/hadn't done? [17:53] wow [17:53] you guys ask good questions :) [17:54] well, i certainly don't have any regrets [17:54] learning to program on Ubuntu and learning the tools of the trade, have taught me a lot [17:54] it's been an absolute joy so far :) [17:55] one thing i feel i should have done though [17:55] is started using Quickly sooner [17:55] it would have made my life much easier back then [17:56] ok, almost out of time onw [17:56] now* [17:56] are there any last minute questions? [17:57] apachelogger asked: does quickly include unicorns? [17:57] silly question [17:58] but, yes, quickly includes unicorns of awesomeness :) [17:58] ok, to wrap up [17:59] feel free to get in touch with me in #quickly on freenode [17:59] im nearly always there [17:59] SilentRock asked: how can i get pytask sir? [18:00] my PPA === 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: Unicorn sparkles with Qt development - Instructors: apachelogger [18:00] Logs for this session will be available at http://irclogs.ubuntu.com/2010/09/28/%23ubuntu-classroom.html following the conclusion of the session. [18:01] good morning everyone [18:01] while quickly comes with unicorn awesomeness Qt features unicorn sparkles and I hope you are ready for that :D [18:02] I'd like to welcome everyone to a (rather short) journey through the wonders and beauties of Qt development ... yay [18:03] first off let me make clear that by no means I intent to teach you Qt in this hour of fun [18:03] instead I would like ot motivate you to check out one of the many tutorials on Qt programmming and get to love the power and awesomeness of Qt [18:04] before we get started I would like to ask you to get the Qt SDK (that is if you want to take part in a live coding example later on) [18:04] You can get it from: [18:04] http://qt.nokia.com/downloads/sdk-linux-x11-32bit-cpp [18:04] or for 64bit: [18:04] http://qt.nokia.com/downloads/sdk-linux-x11-64bit-cpp [18:05] please note taht both are of considerable size (>422 MiB) but contain just about anything you will ever need for Qt development, and certainly is a good starting point for us so we do not have to worry about dependencies and what not [18:05] should you however wish to, you can also use ubuntu packages ... sudo apt-get install libqt4-dev libphonon-dev qt-creator qt4-demos phonon phonon-backend-xine [18:05] (if you are running gnome you might want to use phonon-backend-gstreamer instead of that xine thing at the ende there) [18:06] IN ANY CASE please make sure the package build-essential is installed [18:06] now then [18:06] let me start by answering the question that probably haunts you already.... [18:06] "What is this Qt that due is talking about?" [18:07] (yes I can read minds :P) [18:07] Qt is a cross-platform application development framework for C++. [18:07] that makes it totally clear, right? ;) [18:08] Qt is a vast collection of more or less generic software technologis you will most likely need and want to use to create feature rich applications of any sort [18:08] doktor777 asked: does it make sense to develop in Qt for Ubuntu (which is based on gtk)? [18:08] Yes it does [18:09] Among other things, Qt features very powerful integration into GTK and GNOME. [18:09] So if you develop something in Qt it will integrate well on Windows and OSX and KDE *AND* GNOME [18:09] Also Qt is a very powerful framework with lots and lots of functionality...., so ;) [18:10] Caagalar asked: Is that SDK come from QT Creator from ubuntu repositories? [18:11] The SDK is a self-contained package of all Qt components (that includes the regular development tools) and Qt Creator. [18:11] so basically evyerthing you will ever want [18:11] But let us continue on me informing you :D [18:12] Something important to note is that Qt, contrairy to what some people believe, is not a graphics toolkit!!!!!!elven*star* [18:12] It certainly features a lot of graphics technology that helps with creating graphical applications, but it is not limited to that. [18:13] In particular Qt is made up of many modules and you decide which modules you want to use. [18:13] Some important ones have names like QtCore QtGui QtWebKit and QtDBus [18:14] Now say you create an appliation using only QtCore you do not need a graphics stack at all [18:14] for example the IRC client Quassel can use a server application running on a proper server without graphics. [18:14] this is possible because the quassel server is written only using QtCore and QtNetwork (which both do not do any graphics magic) [18:15] SilentRock asked: why would i choose QT? [18:15] I hope to have answered that implicitly by the end of the talk, if not feel free to ask it again :) [18:16] So, you can create a lot of applications (both graphical and non-graphical), but also terrific is that you can deploy those applications on quite a bit of platforms. [18:16] Well, lets say operating systems... [18:17] Qt is available for quite a lot of them and say you write an application that only uses standard C++ and Qt you can compile and run it on Linux just as well as on Windows. [18:17] Qt is by design made cross-platform. [18:17] To be precise the following operating systems are officilly supported: [18:17] Linux [18:17] Windows [18:17] Windows CE [18:17] Mac OS X [18:18] MeeGo (i.e. Maemo as seen on the Nokia N900) [18:18] and Symbian [18:18] On top of that there are partially experimental third part portations available for: [18:18] OpenSolaris [18:18] *BSD [18:18] Haiku [18:18] OS/2 [18:18] Android [18:18] iPhone [18:18] Amazon's Kindle [18:18] and probably many more [18:19] I did not convince you yet? [18:19] Well then. [18:19] I said that Qt is a framework for C++ [18:19] that is true, but also a bit limited... [18:20] In Qt 4.7 you can also officially use JavaScript (or rather ECMAScript) ... that would then be called QML [18:20] BUT [18:20] additionally to that there are some language bindings available [18:20] to my knowledge there are bindings for: [18:20] Ruby [18:20] Python [18:20] C# [18:20] Java [18:20] Ada [18:20] Lua [18:20] Common Lisp [18:20] PHP (yes the web PHP) [18:20] R [18:20] ... [18:21] doktor777 asked: and what if I use something like pyQt? the portability gets worse? [18:21] well, Qt itself is still portable the bindings however might not be... I am quite certain that pyQt however runs on all 3 major platforms though [18:22] SilentRock asked: what about D? [18:22] I don't think there are bindings for D, maybe someone wants to do them? ;) [18:22] Now for some change, let us watch a video together, shall we? [18:23] A very nice intro on Qt http://www.youtube.com/watch?v=p0xiKBEx8RA [18:27] rooliganLernid asked: but where are the disadventages? [18:27] You might be asking the wrong person ;) [18:27] Well, one obvious disadvantage is that of course a Qt application has a bigger footprint than a standard C++ one [18:28] So using it for a hello world application that only uses QtCore and outputs to the console would not make sense ;) [18:28] Other than that I could not really think of disadvantages I personally experienced [18:28] Well then. [18:28] I hope everyone has finished watching the video. [18:29] And we already sort of ended up at the question "What can you really do with Qt?" [18:29] Let me put it this way: there is almost nothing you cannot do with it... [18:30] As I said earlier, Qt provides various moduels by default (note that all those modules and classes are essentially based on core functions of the QtCore modules, so one can just as well write own stuff) [18:31] those modules allow you ot create very richa nd advanced graphic user interfaces, embed multimedia content, draw custom 2D graphics, draw custom 3D graphics, make us of multiple CPU(core)s, embed web content, include scripting capabilities, connect to databases ranging from sqlite to postgresql and many many more things. [18:31] It is terribly difficult to comunicate something as extraordinary as Qt through writing, so I better adivse you to take a look at some Qt show cases. [18:31] http://qt.nokia.com/qt-in-use/ambassadors/showcase [18:32] With Qt you can not simply create dull graphical applications, you can create beauty. [18:32] And please keep in mind, this beauty is cross-platform. [18:33] Are we finished with downloading the SDK yet? [18:33] SilentRock asked: apache,thats a cliche,all programmers say the same about theyre favorite lenguage,how can you prove that hte possibilities of Qt are unlimitted? [18:34] That is a difficult one ... [18:35] I mentioned earlier that Qt in itself is based on its QtCore module (largely), so while you can already do all sorts of things out of the box, you can implement an indefinit amount of other new things using the existing solutions. [18:35] building up on them [18:35] In essence that is what KDE does. [18:36] KDE takes Qt and stacks a whole bunch of additionaly refined specified solutions on top of it that are necessary to create a coherent desktop environment. [18:36] But since only 30 mins are left we better continue ;) [18:36] With some coding [18:36] \o/ [18:36] yay [18:36] hooray [18:36] \o/ [18:36] those that do not want to take part right now, can continue watching videos [18:36] e.g. [18:36] Qt @ Embedded World 2010: http://www.youtube.com/watch?v=hq34gppsnzw [18:36] Qt Everywhere on All Platforms: http://www.youtube.com/watch?v=yh5Rt3cfuoQ [18:37] Or generally stuff from QtStudios on YouTube. One gets a very good impression of Qt from those videos. [18:37] SO. [18:37] After installing the SDK you should have Qt Creator opened [18:37] that is Qt's own IDE [18:37] We will use it to swiftly create an application that I like to calll Cappuccino [18:38] simply put: we are going to make a video player \o/ [18:38] On Qt creator .... [18:38] in the menubar.... [18:38] File -> new project [18:39] We will make a Qt C++ Project [18:39] in specific a Qt Gui Application [18:39] that should be default already [18:39] click choose [18:39] then give it our cool name and select a path where to place the source [18:39] next -> next -> finish [18:40] we now have a very basic application already if you hit CTRL+R you should get a plain window already [18:40] (instead of CTRL+R you can also press the green play icon thingy) [18:41] in qt creator you should have a very strange view right now [18:41] with loads of elements and a plain window in the middle [18:41] that is our designer [18:41] here we can compose simple things using drag and drop [18:41] so lets do that [18:41] in the bar on the left hand side filter for "widget" [18:42] an drag a "Widget" onto our window [18:42] next filter for "push" [18:42] and drag a push button below the widget in our window [18:43] now right click on empty bakckground space of the window and choose Lay out -> lay out vertically [18:43] that should have brought things into order already [18:43] now lets tweak around a bit [18:43] first click on the button [18:44] on the right hand side there is at the top a list of our widgets in the window (which is rather uninteresting right now) and below an editor for the properties of the currently selected widget [18:44] so lets change the button around a bit [18:45] filter for 'flat' (or scroll to the very bottom) and check the checkbox there [18:45] now filter for 'text' and remove the text [18:45] now filter for 'icon' and [18:45] well [18:45] let me get a URL real quick [18:45] http://people.ubuntu.com/~apachelogger/uadw/09.10/data/play.png [18:46] download that and place it somewhere you can find it [18:46] e.g. your home directory [18:46] now back in qt creator [18:46] if you select the icon property there is an arrow next to the value field, click that arrow and choose from file [18:47] select the play.png [18:47] also while we have a filter on 'icon' set the icon size to 48x48 [18:47] now lets do something to the widget [18:48] right click on the widget and choose "promote to" [18:48] that is somehwere in the middle of the context menu [18:48] at the bottom of the dialog we'll add a new class [18:48] class name: Phonon::VideoWidget [18:48] header file: Phonon/VideoWidget [18:48] [x] global include [18:49] then clik 'add' and finally 'promote' [18:49] save and close the file (using the x in the upper right corner) [18:49] you should now find a projects overview on the left hand side [18:49] there open the Cappuccino.pro file [18:50] there you should find the following line: [18:50] QT += core gui [18:50] just append 'phonon' to that [18:50] QT += core gui phonon [18:50] like that [18:50] save and close again [18:50] in the sources folder of the projects overview you will find a mainwindow.cpp file [18:51] there we will now create the application logic of our player [18:51] first add a couple of includes at the top [18:51] #include [18:51] #include [18:51] #include [18:51] now within the curly brackets of MainWindow::MainWindow we do everything that follows [18:51] first we create a phonon media object [18:52] phonon is the multimedia magic of Qt and a media object is the thing that will hold a video file or an audio file [18:52] Phonon::MediaObject *media = new Phonon::MediaObject(this); [18:52] as easy as that ;) [18:52] now we attach this media to our widget in the window [18:52] Phonon::createPath(media, ui->widget); [18:52] we would also like some audio [18:52] so we create an audio output [18:52] Phonon::AudioOutput *audioOutput = new Phonon::AudioOutput(Phonon::VideoCategory, this); [18:53] and also attach our media to that output [18:53] Phonon::createPath(media, audioOutput); [18:53] finally we make our button invoke the playback [18:53] connect(ui->pushButton, SIGNAL(clicked()), media, SLOT(play())); [18:53] now [18:54] if you are still following, because I am quite fast because we were chit chatting too much earlier :P.... [18:54] if you hit CTRL+R (or that green play icon thingy) you should get a window [18:54] and if you hit the play button it should start playback [18:54] or not... ;) [18:54] something we forgot was to define a media source [18:55] i.e. the actual thing that we want to play back [18:55] so just add this [18:55] media->setCurrentSource(Phonon::MediaSource("http://people.ubuntu.com/~apachelogger/uadw/09.10/humanity.ogv")); [18:55] then try CTRL+R again and hit the play button again and now you should get a video [18:56] of course now the button is useless after you hit i once, so we will just hide it once hit [18:56] connect(ui->pushButton, SIGNAL(clicked()), ui->pushButton, SLOT(hide())); [18:56] now we have a pretty decent video player [18:57] in case you got stuck: http://people.ubuntu.com/~apachelogger/uadw/09.10/Cappuccino/ [18:57] here is my source [18:57] also you can find me in #kubuntu-devel where we can continue making it work for you too [18:57] Where you can and should go now... [18:57] Take a look at the getting started guide [18:57] http://doc.qt.nokia.com/latest/gettingstarted.html [18:58] and the examples http://doc.qt.nokia.com/latest/all-examples.html [18:58] your Welcome page of Qt Creator already contains all examples so you can easily try them and explore the real power of Qt [18:58] some Examples I can recommend: [18:58] Animated Frameworks -> Animated Tiles [18:58] Graphics View -> Elastic Nodes [18:58] Main Windows -> Application [18:58] Items View -> Puzzle [18:58] And last but not least join #qt ;) [18:59] Any question that I can answer in one minue? [18:59] *minute [19:00] Well. === 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: Using the indicator stack in your Python application - Instructors: sense [19:00] Thank you everyone, you were an amazing audience [19:00] Logs for this session will be available at http://irclogs.ubuntu.com/2010/09/28/%23ubuntu-classroom.html following the conclusion of the session. [19:01] thanks to apachelogger for a great and very filled session and welcome to everyone attending this session on Indicators! [19:02] This session I want to talk you through two code examples of two types of indicators, using them to explain how the indicators work. The rest of the time I will try to answer questions about using indicators. If you want to use an indicator in your own application, save your questions [19:03] The first example is code of an Application Indicator, the second of an application registered in the Me Menu. [19:04] I will not explain how to let your application use the Me Menu, since that is not extensible, and I will only briefly touch the Sound Menu during the section about the Messaging Menu. [19:04] The two code examples can be found at , the .desktop file is for the Messaging Menu. [19:05] First, let us talk about the Application Indicator. Everyone, open http://people.ubuntu.com/~sense/uadw/appind-example.py if you want to read along. I'll try to copy crucial code into the chat. [19:05] Everyone's got the file? [19:06] Skip past the license to read the first line of interest: [19:06] import appindicator [19:06] This line of Python code tells we want to use the Application Indicator library. [19:06] If you don't have the package 'python-appindicator' installed you want to install it before testing this example/ [19:07] Skipping past a function we will come back to later, and past the creation of a GtkWindow we see the second line of interest: [19:07] ind = appindicator.Indicator ("example-simple-client", [19:07] "indicator-messages", [19:07] appindicator.CATEGORY_APPLICATION_STATUS) [19:08] This is the most important call we make: here we register the application with the Application Indicator 'server'. [19:08] The first argument is the (unique) ID of your application. You probably want to use the same name here as you use for your package and icon names. [19:09] The second argument, 'indicator-messages' is actually the icon name. [19:09] The third argument is the category of the Application Indicator. [19:10] There are five different categories: [19:10] APP_INDICATOR_CATEGORY_APPLICATION_STATUS [19:10] APP_INDICATOR_CATEGORY_COMMUNICATIONS [19:10] APP_INDICATOR_CATEGORY_SYSTEM_SERVICE [19:10] APP_INDICATOR_CATEGORY_HARDWARE [19:10] APP_INDICATOR_CATEGORY_OTHER [19:10] In Python you call them differently: [19:10] appindicator.CATEGORY_APPLICATION_STATUS [19:10] appindicator.CATEGORY_COMMUNICATIONS [19:10] appindicator.CATEGORY_SYSTEM_SERVICE [19:10] appindicator.CATEGORY_HARDWARE [19:10] appindicator.CATEGORY_OTHER [19:12] The first category is used by applications to show their status, the second by communications-related applications, the third by system-related applications and the fourth by... hardware related applications (think Bluetooth indicators and such). The fifth is 'miscellaneous', but shouldn't really be used unless there really is no other option. [19:13] In the future the developers of the Application Indicators project can use these categorise to alter the way different types of applications are shown. [19:13] ozalexo asked: How can I check that my application name (first parameter) is unique at this time? [19:15] ozalexo: You cannot be sure, of course. There is always a small chance the name is not unique. That won't crash your system, but please try to check if an application using the name already exists before using it as an ID. That's related to choosing a name for your application, though, so it should be done when starting your project. [19:16] The two lines of code after the initial call to the appindicator library are interesting: [19:16] ind.set_status (appindicator.STATUS_ACTIVE) [19:16] ind.set_attention_icon ("indicator-messages-new") [19:17] The first line sets to the status to 'active'. When the status of the application indicator is 'active', it is shown. By default it is 'passive', then it is hidden. [19:17] The next line is related to the third status. It sets the 'attention-icon'. The attention-icon is displayed when the status is set to 'attention'. [19:18] You can use that status when you want to grab the attention of the user. [19:18] appindicator.STATUS_PASSIVE and appindicator.STATUS_ATTENTION are the Python names of the other two statuses. [19:19] The next few lines of code in the example are for creating the menu. Once you've got your menu (as you can see, you can connect signals just like you would do with a regular menu), you need to tell it should be associated with the application indicator. [19:20] In our case, the line of code to do that is: [19:20] ind.set_menu(menu) [19:20] This is a short overview of the Application Indicator code example. Are there any questions so far? [19:22] Alright then! [19:22] Lets take a look at the Python code that registers an application in the Messaging Menu! [19:23] You need the code example at for this, and the .desktop file at . Place both files in the same directory. [19:24] If you don't understand a piece of the code, be it code related to the messaging menu, or other code, don't be afraid to ask! [19:24] Here we need to import the libindicate library: [19:24] import indicate [19:25] After that initial line of library importing there are two functions that are used as callback functions and then the first line of interesting code: [19:25] mm_server = indicate.indicate_server_ref_default() [19:25] mm_server.set_type("message.mail") [19:25] mm_server.set_desktop_file(os.path.join(os.getcwd(), "example.desktop")) [19:25] mm_server.connect("server-display", server_activated) [19:26] The first line of the four I just pasted into the chat creates a reference to a new 'server' entry in the indicator server. This is the general representation of our application in the Messaging Menu, and the main way of interacting with it. [19:26] The second line sets the type: in our case it is a 'mail' application. [19:28] Please refer to for an overview of the different types. [19:28] Here also comes the note on the Sound Menu: [19:28] Actually, libindicate isn't just for the Messaging Menu. Our application will show up in the Messaging Menu, but only because we've set the type to 'message.mail'. [19:29] But libindicate also registers applications with other indicators, like the Sound Menu. Rhythmbox uses the same code, but sets its type to 'music.rhythmbox'. [19:29] This has the consequence that applications only have to register themselves at one place, and that then libindicate will make sure they are represented as they should be. [19:30] Of course, in order to be shown in the Sound Menu you also need to have an MPRISv2 interface available, but that is out of the scope of this session. [19:30] Back to the four lines I pasted into the chat. [19:31] The third line of those four is also important, it is actually a required step. [19:31] Here you register your application's .desktop file. Thanks to this it is possible for users to launch an application from the Messaging Menu after it was closed. [19:32] The fourth code line is just a registration of a callback function, executed when someone clicks on the main ('server') entry in the messaging menu. [19:32] Am I understandable? [19:33] In the next part of the code example you can see a 'for' loop, used to quickly create three different entries, 'mail boxes' in this case. [19:35] You see that we start with creating a new 'Indicator' object. This is the unfortunate terminology for the subentries of applications in the Messaging Menu. [19:35] http://people.ubuntu.com/~sense/uadw/messmenu-example.py [19:35] box = indicate.Indicator() [19:36] Please note that in order for a subitem to stay around you need to keep a reference. [19:37] The next part of the code inside the for loop is for setting the properties of our subitem: [19:37] box.set_property("name", "Mailbox %d" % i) [19:37] box.set_property("count", str(i)) [19:37] box.label = "Mailbox %d" % i [19:37] box.connect("user-display", mailbox_activated) [19:38] We set the indiator's name, which will be used for the label of the subitem in the Messaging Menu and the 'count'. That 'count' can be used for showing the number of unread mails in your mailbox. [19:39] Chat clients can use other properties when they want to show the time since someone e.g. mentioned your name in a conversation. [19:39] The last line in the pasted code connects again a callback function, which is executed when the user clicks the subitem. [19:40] You have to call box.show() on the subitems to make them be displayed. [19:40] The same is true of the main item: mm_server.show() [19:41] Are there questions about what I previously said? [19:41] Actually, mm_server.show() is not required. [19:41] You just need to make sure you let the subitems show, by calling the show() function on them. [19:42] Any questions about what I've said so far? [19:42] ozalexo asked: Is it possible to use any own icons in the menus? [19:43] ozalexo: Good question! I forgot to mention that the Messaging Menu sets the icon using the desktop file provided to it. [19:43] In the file 'example.desktop' you see the following line: [19:43] Icon=applications-email-panel [19:44] The Messaging Menu reads that line and uses the applications-email-panel icon. [19:46] Is there anyone reading who is using an indicator in his or her application? [19:46] Any questions about that? What do you think of the technology? [19:47] jiga asked: is there a simple way to do the baloon notifications too? [19:48] jiga: Notify OSD is Canonical's implementation of the Notification Specification, and is part of Ayatana. However, the libraries used for creating notification bubbles are not developed by Canonical, since they were developed together with the standard. [19:49] Let me show you a few lines of code to help you along. [19:49] jiga: I think that this is a reasonable example: [19:50] Generally, you need pynotify [19:50] ozalexo asked: Is it possible to implement smth like Chrome's menu? [19:52] ozalexo: It is not possible to have special menu items like that in the Messaging Menu or the Application Indicators' menu, because that is custom interface. We're only using the standard GTK+ interface toolkit, and on top of that, we don't provide the functions to the application developers to do it themselves. In case of the Application Indicator we put the provided menu in some sort of pseudo-menu structure before passing it over DBus to th [19:52] e server, which deconstructs it again, and then rebuild it. But that only works for regular menus. The messaging Menu even provides less options for customisation. [19:53] rooliganLernid asked: How to change the icon in the first example? There is no .desktop file. So what to do? [19:54] rooliganLernid: For application indicators you provide the general icon name as the second of the three arguments you give to the initialisation function. [19:54] ind = appindicator.Indicator ("example-simple-client", [19:54] "indicator-messages", [19:54] appindicator.CATEGORY_APPLICATION_STATUS) [19:54] In this case the icon is 'indicator-messages' [19:54] You can also set a special attention icon, which is shown when you set the status to appindicator.STATUS_ATTENTION [19:55] rooliganLernid asked: So just edit it to "/home/user/blah"? [19:55] rooliganLernid: You cannot provide a direct path to an icon, but in the regular constructor you give the icon name. [19:55] The icon is then searched for in the theme. [19:56] However, you can set the icon theme path, to extend the search. [19:57] rooliganLernid: Does that make sense to you? === asd is now known as Guest88731 [19:58] The function for setting the icon theme path is '.set_icon_theme_path('/icon/theme/path')' [19:58] Any other questions, remarks, suggestions? [19:59] No? [19:59] alright sense! good job! [19:59] In that case I would like to thank you for your attention and point you to jcastro for the next session! === 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: Building your package daily - Instructors: jcastro [20:00] Awesome, thanks for coming everyone [20:00] Logs for this session will be available at http://irclogs.ubuntu.com/2010/09/28/%23ubuntu-classroom.html following the conclusion of the session. [20:00] This session is going to be about daily builds [20:00] and how you can set them up for your project [20:00] So before we start, I'm going to link you up to some documentation that you can follow along with [20:00] https://help.launchpad.net/Packaging/SourceBuilds [20:01] ok so first off, what is a daily build? [20:01] this is your software, pulled out of version control and built every night in launchpad [20:01] COntrary to popular belief, daily builds aren't about getting you the latest crack, it's about getting testing of specific features and bugs tested. [20:02] also, feel free to ask questions at any time [20:02] so, imagine you have a program, that is at version 1.0 [20:02] you report a bug and then the developer fixes it [20:02] and commits it [20:02] but, until the developer release 1.1 (or whatever), it's hard for you to test [20:02] because unless you're an expert, you may not know how to build the software from source [20:03] so, daily builds allow the developer to say "here try this PPA, let me know if the bug is fixed" [20:03] and then you can easily try it, say yes! or no! and then be on your merry way [20:03] we call this "tightening the feedback loop between developers and users" [20:03] getting feedback back to developers quicker [20:04] and developers getting stuff for users to test quicker [20:04] so, in order to do this, the launchpad team have made it easy for just about any project to fire up daily builds [20:05] (Note, this isn't a software development class, so if you're unsure on why your project should have dailies, a trunk that builds at all times, etc. please see other documentation on the internet) [20:05] ok, so, I'm going to show you an example of how to take a project [20:05] import it into launchpad [20:05] and then fire off dailies [20:05] since this is a Launchpad feature, we need two things to make the debs [20:05] we need [20:05] 1) The upstream source code [20:06] 2) the packaging [20:06] now, I am lazy, so there's no way I'm going to go figure out how to package shotwell [20:06] however .... https://code.launchpad.net/~ubuntu-desktop/ [20:06] as it turns out the ubuntu desktop team keeps all their packaging in version control [20:06] wow, that's handy! [20:07] Now, I know what you are thinking... "Jorge, are you telling me I can just reuse the existing packaging and spit out debs of whatever I want?" [20:07] yes and no [20:07] First off, not every team in Ubuntu is using bzr for packaging (yet) [20:07] but we're well on our way [20:07] and, there's no guarantee that taking packaging for something in the distro will Just Work(tm) on a pure upstream source. [20:08] So .... I went and tried it! [20:08] ok so from looking at that list, I find shotwell's packaging [20:08] https://code.launchpad.net/~ubuntu-desktop/shotwell/ubuntu [20:08] there it is [20:08] this is basically the debian/ directory of the package the desktop team uses in ubuntu [20:08] Now we need the source code from upstream! [20:09] I can quickly google that [20:09] http://yorba.org/shotwell/install/ [20:09] aha, there it is.... [20:09] $ svn co svn://svn.yorba.org/shotwell/trunk shotwell [20:09] is what they tell us. [20:10] But they're using subversion, and I'm using Launchpad .... [20:10] so, I can tell Launchpad to import the Shotwell svn repository [20:10] by requesting a code import: https://code.launchpad.net/+code-imports/+new [20:10] code imports work for cvs, svn, and git [20:11] there is currently a limitation with the git import (no submodule support yet) [20:11] but the bzr team is working hard on that so more git using upstreams can use this feature [20:11] then launchpad goes and imports it and sends you a mail [20:11] how long it takes depends on the import [20:12] In the mail it tells me it's imported shotwell into launchpad here: https://code.launchpad.net/~jorge/shotwell/trunk [20:12] any questions so far? [20:12] so far we've imported shotwell into launchpad, and found the packaging branch the desktop team uses for shotwell [20:12] ok, so we've got the 2 parts we need [20:13] now we're going to tell Launchpad to shove it all in a blender and spit out debs! [20:13] we do this by using what we call recipes [20:13] https://code.edge.launchpad.net/~jorge/shotwell/trunk [20:13] and you can click "Create a packaging recipe" [20:13] but, I've got done done already [20:13] https://code.edge.launchpad.net/~jorge/+recipe/shotwell-daily [20:13] there it is [20:14] now, this recipe is where the magic is [20:14] and covered in greater detail here: https://help.launchpad.net/Packaging/SourceBuilds/GettingStarted [20:14] so let's look at it [20:14] # bzr-builder format 0.2 deb-version 1.0+{time} [20:14] lp:shotwell [20:14] nest shotwellpackaging lp:~ubuntu-desktop/shotwell/ubuntu debian [20:15] these three lines are basically "we're building shotwell, the version is 1.0+$whatever_time_it_is, grab the source code from lp:shotwell, and then mush the packaging branch from lp:~ubuntu-desktop/shotwell/ubuntu and make a deb" [20:16] when I create the recipe I can choose which PPA to send it to [20:16] as you can see, I sent it to my "Daily test builds" PPA I made [20:17] https://code.edge.launchpad.net/~jorge/+archive/dailies/+packages [20:17] you can find the .deb there. [20:17] or NOT, because it failed. [20:17] hmm, I must have missed something. [20:17] right, I forgot to test my recipe to see if it even worked! [20:18] now, everytime I set up a daily build, this uses up resources [20:18] and the last thing we need is daily builds contributing to the heat death of the universe [20:18] so ... we first need to test the build locally [20:18] to make sure we've shaken out the bugs [20:19] this also means that you can also use your own machine to make daily builds [20:19] so if you have your favorite project and want to just set that up locally, you can totally do that [20:19] https://help.launchpad.net/Packaging/SourceBuilds/GettingStarted#Testing locally [20:19] this has instructions for how to test them locally, using bzr-builder, and pbuilder [20:19] any questions so far? [20:20] no questions? This can't be that easy! [20:20] ok [20:21] so, let's see what we can do with these things [20:21] let's use the amazing server team as an example on how they use daily builds [20:22] they maintain a whole bunch of these [20:22] https://edge.launchpad.net/~ubuntu-server-edgers [20:22] what we've got here is a collection of daily builds for all sorts of projects [20:22] apache, mysql, nagios, puppet, samba, varnish, etc. etc. [20:22] the list goes on and on [20:23] so, the team uses daily builds so people who are deploying these applications can test /the very latest/ code, right as it's committed [20:23] this leads to better bug reports, and better testing (remember what I said earlier about tightening the feedback loop) [20:24] ok so we've set up shotwell for dailies now (that was just an example, I haven't actually helped the shotwell guys set up dailies, but we're getting together this week to do it) [20:24] now, theoretically, launchpad goes off and builds the debs and publishes them to a PPA I've designated [20:25] This happens on the launchpad build farm: https://launchpad.net/builders [20:25] this is where you can see packages being built for both the distro and PPAs, in every supported arch [20:25] when you set this up launchpad mails you when it starts to build these, and it does a good job of telling you if it fails or something [20:26] ozalexo asked: Is it possiblt to make my daily-builds hidden from people? What if I hezitate to show it, but I need to test it? :) [20:26] this is a good question [20:26] so in the example I set everything up in my little launchpad space, which is why the url's all have ~jorge in them [20:26] chances are no one cares about those too seriously [20:27] however, when you're ready to go public, you can put them in a more canonical place [20:27] https://launchpad.net/shotwell [20:27] they will eventually show up here ^^^ [20:27] but yeah, when I am playing with them and they are broken I put them under ~jorge [20:28] one thing some projects fear is that users will use daily builds instead of releases [20:28] because we're maniacs everyone loves to have the pure hotness delivered every day [20:28] how you handle that is up to your project [20:29] and launchpad has facilities to ensure that you're not being spammed by bug reports from package versions that aren't in the archive [20:29] however if you have a dedicated group of people who know how to test, dailies bring a bunch of benefits [20:29] which I think outweigh the downsides [20:29] ok so wow, I type way faster than I should, any other questions? [20:30] another question I hear often is "If I am building trunk every day what if I break something! OMG anxiety!" [20:31] the simple answer to that is in a world with distributed version control and branching and merging you can do all sorts of development in a branch and then merge it into trunk when it's ready and works [20:31] and since we let you make as many recipes and branches as you want [20:32] there's nothing stopping you from making myapp-newfeature daily builds until you're ready to merge it [20:32] I forsee a world where application developers can just spit out .debs for individual fixes, so users can confirm it fixes their bug, and then the dev just rolls that into trunk and moves on\ [20:34] any other questions? [20:35] abentley: any comments? [20:35] Aaron has been working on this feature all cycle! [20:36] jcastro: seems like a good introduction. Did you mention that we also support imports from Mercurial? [20:36] nope, I didn't know that! [20:36] and CVS still too I assume? [20:37] jcastro: yes, we still support CVS. [20:37] someone asked about git: yes, as I said earlier the only gotcha is we don't support importing projects that use submodules [20:37] but the bzr team is working on fixing that [20:38] ok so unless there's any more questions I guess smoke if you got 'em, next class starts in about 20 minutes! [20:38] or not ... I was last today wasn't I? [20:38] jcastro: Another small thing-- not only does building locally avoid contributing to the heat death of the universe, but it also helps you avoid running out of quota. [20:38] oh, there's a quota? [20:38] tell me about it, that sounds sneaky. :) [20:38] jcastro: You have five builds per recipe per distroseries per 24 hours (yes, sliding window). [20:39] ah ok, so as long as I test before hand and don't spam the system with builds I should be ok? [20:40] ok so that's it for today, make sure to join us tomorrow [20:40] here's the schedule! http://people.ubuntu.com/~nhandler/classroom.html [20:42] jcastro: yes. [20:42] sinisterstuf asked: can anyone add their pc to the build farm? [20:42] ooh, time for one more [20:43] the answer is No. [20:43] For security reasons we don't allow untrusted machines in the build farm [20:45] The PPA-targetting machines in the build farm are as locked-down as we can manage. They run virtual machines and can't talk to anything on the net except the buildmaster. [20:47] Since building packages means running arbitrary code, people who contributed their machines to the build farm would be running a grave security risk for themselves. [21:00] Logs for this session will be available at http://irclogs.ubuntu.com/2010/09/28/%23ubuntu-classroom.html === 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 || === ghostcube_ is now known as ghostcube === yofel_ is now known as yofel