=== Mrokii_ is now known as Mrokii [08:31] exit === caglar is now known as Guest77758 === 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: Catch that bug Quickly! - Debugging Quickly apps with pdb - Instructors: Abd4llA [15:01] ok about ready? [15:01] Day 4, keep up the energy! [15:01] take it away Abd4llA! [15:01] Thanx jcastro [15:02] Ok guys good afternoon [15:02] As you all know today we'll be talking about debuging python apps, [15:03] specially Quickly apps [15:03] Well there're tons of python debuggers out there [15:04] but I'd say in 90% of the cases, you'll be using "pdb" [15:04] pdb comes by default with the python installation [15:05] As its name shows, it stands for "Python DeBugger" [15:05] You can use pdb to track your program execution, [15:06] do post-mortum debugging [15:06] and pretty much anything a decent debugger should do :-) [15:08] So lets get rolling quickly with pdb === MSK61 is now known as MAfifi [15:09] So to start with, lets see how a normal pdb session looks like [15:09] just in the terminal issue the command "pdb" [15:10] You'll see that it accepts normal scripts as an argument [15:11] so we can pretty much launch pdb normally [15:11] pdb [15:11] that'll launch a pdb debug session for your script [15:11] starting at the first line, from there you can set your break points...etc then get rolling [15:12] or you can inject an explicit call to pdb from within your python script [15:12] so lets see how can we do that [15:12] First, as I said, this is about debugging quickly apps, but most of what we'll say today can be applied to any python scripts/programs [15:13] So, lets start by creating the sample quickly ubuntu-application template application [15:13] from your favourite workspace dir, issue create a quickly app by issuing the command [15:14] quickly create ubuntu-application DummyApp [15:14] And let me know what you see :) ? [15:15] Now as you see, this is the default template app for the ubuntu-application quickly template [15:16] It's pretty dummy, so lets try adding some "yea, dummy" functionality [15:16] there u'll find a "save" item in the "file" menu [15:17] so lets call some function when we click save [15:17] close your DummyApp [15:17] then navigate to the dummyapp dir [15:18] there, issue the command: [15:18] quickly design [15:18] That'll launch "Glade" [15:18] now click on the file menu [15:18] and click on the "save" [15:19] in the properties panel on the right [15:19] click the "Signals" tab [15:20] You'll find a subitem called "activate" under "GtkMenuItem" [15:20] There we'll write down the name of the method to call when we click save [15:20] lets call it "save_me" [15:21] so write down "save_me" in the "Handler" field of the item "activate" [15:22] so [15:22] now make sure to save [15:22] ctrl+s [15:22] close your glade [15:23] now we need to write down that method [15:23] so in your terminal, issue the command [15:23] quickly edit [15:23] that'll open all your source files [15:23] in gedit [15:24] now go to the file dummyapp [15:24] That's our main file [15:24] we need to add our save_me method to the DummyappWindow class [15:25] so navigate there, maybe under the "on_destroy" method [15:25] add the following method [15:26] def save_me(self, widget, data=None): [15:26] introduce_bug() [15:27] Now as you see, we're calling a method called introduce_bug [15:27] we'll add that function to helpers.py [15:27] so go to the top of the dummyapp file [15:27] and import it as follows [15:28] from dummyapp.helpers import introduce_bug [15:28] we'll write that function ourselves [15:28] Now navigate to helpers.py inside your gedit [15:29] and at the very bottom, write down that method [15:30] def introduce_bug(): [15:30] name = "bug" [15:30] print "I am a " + name [15:30] print "I am a healthy line" [15:30] then save your gedit [15:31] Keeping up so far? [15:31] Now save gedit, then close [15:31] then run our app by firing [15:31] quickly run [15:32] and click "save" [15:32] in your terminal you should see [15:32] I am a bug [15:33] I am a healthy line [15:37] Make sure your import line [15:38] is under the line [15:38] from dummyapp.helpers import get_builder [15:38] so at the end it'll look like [15:38] from dummyapp.helpers import get_builder [15:38] from dummyapp.helpers import introduce_bug [15:38] Now run again [15:38] quickly run [15:38] click save [15:38] test [15:38] all good ? [15:39] Now that's a bug over there [15:39] We need to hunt it down [15:39] there're several ways [15:39] but lets choose the easiest [15:40] from your command line [15:40] issue the command [15:40] pdb bin/dummyapp [15:40] Now we're starting a pdb session [15:40] it started at the first line of your script [15:41] pdb accepts commands [15:41] so issue [15:41] h [15:41] that should show the help [15:41] now we need to add some breakpoints [15:41] we know that the method save_me is the one that gets called when clicking save [15:41] so lets add a breakpoint to it [15:42] the comman b is used to add breakpoints [15:42] (Pdb) b dummyapp:134 [15:43] this way we added a breakpoint to the file dummyapp [15:43] line number 134 [15:43] you should match the line number of your def save_me [15:44] my method is defined at line 134 [15:44] so now we have a breakpoint there [15:44] let's run the code ! [15:44] c [15:44] that'll continue execution untill the first breakpoint [15:44] Good? [15:45] notice the command "c" [15:45] now we notice that it'll stop when it reads the function definition [15:46] that's not what we want [15:46] we wanna stop when it starts executing [15:46] so lets try that again [15:46] close the app [15:46] run it inside pdb [15:46] pdb bin/dummyapp [15:46] now this time, lets make the breakpoint at the introduce_bug() method call line [15:46] the first line of the "save_me" function [15:47] (Pdb) b dummyapp:135 [15:47] now lets continue execution till first breakpoint [15:47] (Pdb) c [15:47] you'll see that the application shows [15:48] and now we need to click "file-> save" [15:48] there you'll see pdb stoping at the break point [15:48] Good ? [15:49] now lets try some pdb commands [15:49] (Pdb) l [15:49] that'll list the code [15:49] (Pdb) w [15:49] stack trace [15:50] Now we can either execute the next line using "n" or step into the method "introduce_bug" [15:50] using s [15:50] so lets see [15:50] (Pdb) s [15:50] we're there now [15:50] (Pdb) n [15:50] will go to the next line [15:51] (Pdb) l [15:51] list the code there [15:51] now I see that the "print "I am a " + name" line is the one that introduces a bug and I wanna skip it [15:51] (Pdb) j 50 [15:52] That way we jumped to the next line [15:52] (Pdb) c [15:52] will continue execution without the buggy line and will print "I am a healthy line" only [15:52] Good ? [15:53] Lets try another way to trace that bug [15:53] close your session [15:53] and edit your code [15:53] quickly edit [15:53] go to dummyapp file [15:54] in save_me method [15:54] add the following line before the call to "introduce_bug" [15:54] import pdb; pdb.set_trace() [15:54] so the final method will be [15:55] def save_me(self, widget, data=None): [15:55] import pdb;pdb.set_trace() [15:55] introduce_bug() [15:55] now run the app [15:55] quickly run [15:55] go to file->save [15:56] you'll see that a pdb session will start @ the termincal [15:56] *terminal [15:56] that's another way to launch ur pdb , from within the code [15:56] now type args [15:56] that prints the arguments [15:57] (Pdb) args [15:57] also there's u and d [15:57] (Pdb) u [15:57] that goes to the upper frame [15:57] (Pdb) d [15:57] That goes to the lower one [15:57] now [15:57] (Pdb) s [15:58] step into the introduce_bug method [15:58] (Pdb) n [15:59] now you can alter your name variable [15:59] (Pdb) name = "Not a bug" [15:59] That was a quick introduction for Pdb guys :) [15:59] So thanks alot guys , more time would've been convenient :) [16:00] but hopefully it was fun :-) === 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: Making your application translatable in Launchpad - Instructors: dpm [16:01] Thanks Abd4llA, and hi everyone! [16:01] Welcome to this session on setting up your project for translations in Launchpad. [16:02] My name is David Planella and I'm the Ubuntu Translations Coordinator, where I work with our translations community to bring you a localized operating System. [16:02] I also tend to help with any topics related to translations and Launchpad, and that's what we're going to talk about today :) [16:02] That's a really exciting topic to me, as Launchpad makes it really easy to make your applications translatable and available to everyone in almost any language, and I hope you enjoy it as much as I do. [16:03] Translators are really awesome people! [16:03] Anyway, let's get started, shall we? [16:03] = Assumptions = [16:03] I will start with an application ready set up for translations, so I'm not going to go into much detail there. [16:04] My intention is to focus in getting you started with exposing your project's translations to everyone for translation. [16:04] In any case, if you've got questions on this, feel free to ask either during or at the end of the session, and I'll be more than happy to answer them [16:04] We're going to be using these tools: [16:04] bzr [16:04] quickly [16:04] python-distutils-extra [16:04] In particular quickly, which we'll use to start with a nearly ready-made project with translations set up [16:05] (You can install it by running the 'sudo apt-get install quickly' command or you can get it from Applications > Ubuntu Software Center) [16:05] [16:05] = Creating the project and setting it up for translations = [16:05] [16:06] We'll use quickly to create a project called 'fooby', and then we'll set up the last touches needed to configure translations. [16:06] So if you've got all those tools installed, you can simply fire up a terminal window (Applications > Accessories > Terminal) and run the following command: [16:07] quickly create ubuntu-application fooby [16:07] This will create an application named 'fooby' [16:07] and give you some information about it on the first run [16:08] then change to the fooby folder: [16:08] cd fooby [16:08] And finally run: [16:08] python setup.py build_i18n [16:08] That should have finished the last bits to set up translations [16:09] in particular it created the po folder to contain the translations template and the translations [16:09] you can see the template: [16:09] ls po [16:09] have a look at it: [16:09] gedit po/fooby.pot [16:10] It's important to get a bit familiar with it, but you don't have to remember the whole format [16:10] you should simply know what it is for now :) [16:10] A few words on translation templates: [16:10] * Gettext: They follow the gettext format: http://is.gd/fC8p6 [16:11] * Name: They are generally named after your project, with a .pot extension. E.g. fooby.pot [16:11] * One template per app: Generally applications need only one template [16:11] * Layout: They generally live in the po/ folder, along with the translations [16:11] * Content: They are text files which contain: [16:11] * A header with metadata [16:11] * A set of message pairs: msgid are the original strings extracted from the code and exposed to translators, and msgstr are the placeholders for the translations, which are always empty in the templates. [16:12] * Launchpad import: They are imported into Launchpad and exposed for translations for all languages in https://translations.launchpad.net/$YOUR_PROJECT [16:12] * Updates: You update the template whenever you have new strings in your app and you think they are stable for translation (generally shortly before release) [16:12] * Tools: you update templates with gettext based tools: [16:12] * generally intltool -> 'cd po && intltool-update -p' [16:13] * or increasingly python-distutils-extra for python projects -> 'python setup.py build_i18n -p' [16:13] You don't have to remember all of this [16:13] But at least you should know how that you must update the template from time to time [16:13] and the command to do it [16:13] You'll see that your project still does not contain any translations, but let me give you a quick overview, so you know what we're talking about: [16:14] A few words on translations: [16:14] * Template-based: They are created from the template and share the same gettext format [16:14] * Name: They are named after the $CODE.po scheme, where $CODE is an ISO 639-2 code. E.g. ca.po for Catalan, de.po for German. Some have an optional country specifier. E.g. pt_BR.po (Portuguese from Brazil) [16:14] * Layout: they are all in the same directory as the POT template. So: [16:14] * po/fooby.pot [16:15] * po/ca.po [16:15] * po/pt_BR.po [16:15] * ... [16:15] * Creation: Launchpad creates them for you the minute someone translates the first message online [16:15] * Code integration: you can let Launchpad commit them to a branch of your choice or you can export a tarball containing them all [16:16] Anyway, let's continue. Now that you've added the template to your code, you can commit it: [16:16] You can run the following commands: [16:16] bzr add po [16:16] bzr commit -m 'Created my first ever awesome .pot template. Go translators, go!' [16:17] And let's publish it in Launchpad (note that you'll have to change the Launchpad URL to your user name instead of 'dpm'): [16:17] bzr push lp:~dpm/fooby/translations [16:17] Nothing particularly hard to understand on the naming scheme above: dpm is my user name, fooby is the project and translations is the branch name [16:18] Ok, so that completed the first step! [16:18] Next: [16:18] [16:18] = Setting up code hosting = [16:18] [16:18] We want our project to be available to everyone to translate, so we'll need to publish it in Launchpad. [16:18] That's beyond the scope of this session, so we'll continue from the already registered fooby project in Launchpad: [16:18] https://code.launchpad.net/fooby [16:19] In case you are interested, though, registering a new project in Launchpad is as easy as going to https://launchpad.net/projects/+new [16:20] Some of the URLs will not allow you some of the pages due to permissions, so if you have your own project in Launchpad, just substitute the 'fooby' part in the URL with your project's Launchpad id [16:20] The first thing we'll have to do in our project is registering a bzr branch, [16:20] so we'll simply go to the Code tab in Launchpad, choose the "Configure code hosting" link [16:21] and then on the "Link to a Bazaar branch already on Launchpad" you can enter the branch we published earlier on (~dpm/fooby/translations) [16:21] A shortcut is to simply go to: [16:21] https://code.launchpad.net/fooby/trunk/+setbranch [16:21] to do this [16:21] So now we have all we need to start setting up translations. [16:22] You see that all components in Launchpad are integrated, so you set up a branch to be linked to translations [16:22] Just as a recap, you can see and explore the resulting code from here: [16:22] https://code.launchpad.net/fooby [16:22] Feel free to browse it (http://bazaar.launchpad.net/~dpm/fooby/translations/files) [16:23] or download it (bzr branch lp:fooby) and play with it [16:23] Ok, so code hosting setup: (./) Finished! [16:23] [16:23] = Setting up translations in Launchpad = [16:23] [16:24] Now we come to the most interesting part [16:24] 1. Telling Launchpad where translations are hosted [16:24] The first step it to tell Launchpad that we want to host translations there. [16:24] On your Launchpad's project, just click on the Translations tab, or go to this URL: [16:25] (remember to change 'fooby' to your project's name) [16:25] https://translations.launchpad.net/fooby/+configure-translations [16:25] Then choose the "Launchpad" option to tell Launchpad translations will be done there, and click on "Change" [16:26] That was an easy one, wasn't it? [16:26] 2. Configuring permissions [16:26] Now we are going to tell Launchpad how we want our translations permissions to be (i.e. who and how can translate it), [16:26] and which branch translators should focus on. [16:27] Simply go to the Translations tab again and click on the "Change permissions link" [16:27] Or here's the direct link: https://translations.launchpad.net/fooby/+settings :) [16:27] I recommend the following setup: [16:28] Translations group: Launchpad Translators [16:28] Translations permissions policy: Structured [16:28] Translation focus: trunk (or choose your branch here) [16:29] Assigning the translations to a translation group will make sure a team for each language will review translations before they are submitted, ensuring the quality of translations [16:30] A translations group is a group of teams, one per language, that takes care of translations in their language [16:31] They can be specific to a project or generic. I recommend the Launchpad Translators group because it contains a set of already established and experienced teams: [16:31] https://translations.launchpad.net/+groups/launchpad-translators [16:31] as per the Structured policy [16:32] This gives you a good balance between openness and quality control: [16:32] Only the team members of an established team will be able to translate your project [16:33] And for languages without a team it will allow everyone to translate, facilitating the barrier of entry to translators at the expense of QA [16:33] The other extremes are Open or Restricted [16:33] You can learn more about these here: [16:34] https://help.launchpad.net/Translations/YourProject/PermissionPolicies [16:34] It's the project maintainer's call, but I personally discourage them to use Open [16:34] Ok, we're nearly there, next step: [16:34] 3. Setting up what needs to be translated [16:35] You need to also tell Launchpad what needs to be translated. That's again quite easy. On the Translations tab again, choose the trunk series and specify your branch there [16:35] Direct link: https://launchpad.net/fooby/trunk/+linkbranch [16:35] Another easy one [16:35] 4. Configuring imports and exports [16:36] That's for me the most interesting bit [16:36] The settings on this section basically enable Launchpad to do the work of managing translations for you [16:36] You can tell Launchpad to import your translation templates automatically whenever you do a commit [16:37] So you don't have to upload them manually [16:37] If you are migrating a project with existing translations, you can tell it to import them too [16:37] And finally, you can let Launchpad commit translations automatically to a branch of your choice [16:38] I find that just awesome [16:38] So for the imports, on the Launchpad page, on the "Import translations from branch" section: [16:39] I recommend choosing "Import template files" and then "Save settings" [16:39] For exports: look at the "Export translations to branch" section and then click on the "Choose exports branch" link [16:40] So that was it! [16:40] 4 easy steps that should not take you more than a few minutes to set up, and your app is ready for the world to translate! [16:40] Just a few final words: [16:40] [16:40] = Play with translations = [16:40] [16:41] As a developer, it might be interesting to see how translators do their work. [16:41] Exceptionally (remember how I advised not to use Open permissions, tough :) I've set the translations permissions on the fooby project to Open [16:41] So you can submit translations [16:41] and get a feel for the work that translators do [16:42] As a developer, it will give you an understanding on how they work. It is always interesting to get to know other workflows [16:43] and it's always good to have an insight on all areas of contribution related to your project [16:43] You can start translating fooby here: [16:43] https://translations.launchpad.net/fooby [16:43] [16:43] = Summary = [16:43] [16:43] Most of the steps described here today you'll only need to do once, unless you need to change the settings. They were: [16:44] 1. Setting up code hosting (in case you hadn't already) [16:44] 2. Setting up translations in Launchpad [16:44] 2.1. Telling Launchpad that it's hosting your translations (https://translations.launchpad.net/fooby/+configure-translations) [16:44] 2.2. Configuring permissions: recommended -> Structured, Launchpad Translators (https://translations.launchpad.net/fooby/+settings) [16:44] 2.3. Setting up the translations branch (https://launchpad.net/fooby/trunk/+linkbranch) [16:44] 2.4. Configuring imports and exports (https://translations.launchpad.net/fooby/trunk/+translations-settings) [16:45] So really, once your project is set up for translation, the only things you'll have to remember are: [16:45] to update the template before a release, [16:45] announce to translators that they can start their work, [16:45] and merge the translations to your main branch. [16:45] If you are using the same branch for translation imports and exports, you won't even have to do that! [16:46] So here's a reminder on how to do these steps: [16:46] Updating the translation template [16:46] --------------------------------- [16:46] python setup.py build_i18n -p # To update the template [16:46] bzr commit -m"Updated translation template" # Commit your local changes [16:46] bzr push # Push changes to the remote branch [16:47] [16:47] Call for translations [16:47] --------------------- [16:47] Just send an e-mail to launchpad-translators(at)losts(dot)launchpad(dot)net or to the list where the coordination of your project's translation is happening [16:47] [16:47] Just to finish, you'll find more information on the topics covered in this session here: [16:48] * https://help.launchpad.net/Translations/YourProject [16:48] * https://help.launchpad.net/Translations/YourProject/BestPractices [16:48] So that was it! I hope you enjoyed it and that I can soon see your projects up for translation in Launchpad [16:49] Does anyone have any questions? [16:49] MAfifi asked: What about non-python based projects? [16:49] The Launchpad part is the same for those. Let's take a C project, for example [16:50] the only differences between languages, or rather between build systems, is how you update the template [16:50] In a GNOME application in C using autotools, for example, you'd just go to the po folder [16:51] and call intltool-update -p [16:51] MAfifi asked: What if I want to submit a translation in a language no team exists for? [16:51] It all depends on the permissions you've set up for your project [16:52] With Open and Structured permissions, the translations would just be accepted [16:52] With Restricted, they'd be marked as suggestions, but would not be included in the project [16:53] until there is a team which reviews them [16:53] As the maintainer, you can bypass that and do a manual upload of the translations for which there isn't a team [16:53] But I'd rather avoid bypassing translation teams [16:54] and try to find someone that can review the translations before them being accepted [16:54] oh, MAfifi meant for translators [16:55] As a translator, the same as above applies, only that you cannot bypass translation teams as a maintainer can do [16:55] so for Structured, it there is not a team, you'd be able to submit translations, the same as in Open [16:56] For Restricted, you'd be able to submit suggestions, which are recorded in Launchpad, but would not make it into the project until a team for the language is created [16:58] Any more questions? [16:59] apachelogger asked: how do I make my plasmoid translatable? [16:59] nice question, I don't think I can answer in the last minute, but we can continue on #ubuntu-translators [16:59] As an exchange, you get an intro: [17:00] ok, bye everyone, I hope you enjoyed the talk. now let's leave the room for the always awesome apachelogger and his talk on "Widgetcraft <3" === 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: Widgetcraft <3 - Instructors: apachelogger [17:00] Aloha! [17:01] thank you dpm for your talk and the intro :) [17:01] welcome to an intro on Widgetcraft (imagine scary music) [17:01] ... also known as the art of creating Plasma Widgets (imagine not so scary music but thunder ;)) [17:02] My name is Harald Sitter, and I am opporunistic by design. [17:02] First please make sure you have the dependencies: sudo apt-get install kdebase-workspace-bin kdebase-runtime [17:02] Also you will need a common editor. [17:03] There is a Plasma specific sort-of IDE in the works, but it has yet to see a release that I would call usable. [17:03] Please write DONE in the -chat channel once you are done installing [17:03] so I know when we can do fun things. [17:04] any more people who are not DONE yet? ^^ [17:04] I think we can skip the intro and do useful things then ;) [17:05] but first let me at least outline some basics [17:05] Plasma is the technology underneath KDE's workspace components (mostly called desktop) [17:05] it comes in currently (I think) 3 favors, proper desktop, netbook sort-of desktop and mobile (yes for mobile phones) [17:06] Usually Plasma Widgets writen natively for Plasma are called Plasmoids. [17:06] Plasma can also run Apple Dashboard widgets and Google Gadgets for examples... but only Plasmoids are the real deal ;) [17:06] You can write them in either JavaScript or C++ or Ruby or Python. [17:07] However only the former two are guaranteed to be available on every system, so I recommend those. [17:07] Hence we will also use JavaScript today. [17:07] Any questions thus far? [17:08] Very well. [17:08] coding \o/ [17:08] yay [17:08] hooray [17:08] woohoo [17:08] :D [17:09] A basic routine that you will almost always need when starting off with a new Plasmoid is the following: [17:09] NAME=doctor-questionmark # Set a shell variable [17:09] mkdir -p $NAME/contents/code/ # Create everything up to the code dir. [17:09] touch $NAME/metadata.desktop # Create the metadata file, which contains name and description... [17:09] touch $NAME/contents/code/main.js # Create main code file of the plasmoid. [17:09] You can copy this verbatim into a terminal to get started with our little example. [17:10] This will create the basic outline for any JavaScript based Plasmoid. [17:10] For other languages it is basically the same, just that the file extension of the main.js would be different :) [17:11] First let us set up the meta data. For that open the metadata.desktop file and fillit with content. [17:11] You can copy the stuff from here: http://people.ubuntu.com/~apachelogger/uadw/09.10/doctor-questionmark/metadata.desktop [17:12] As you can probably tell from looking at that file, the meta data bascially just defines name, comment, icon, author and other not all that useful information. [17:12] BUT whenever you create a new plasmoid, do not forget to change the 'Name' and 'X-KDE-PluginInfo-Name' values [17:13] those 2 get used to identify the plasmoid internally, so if you forget to change one it can easily happen that your plasmoid does not show up or loads inproperly etc. etc. [17:13] Is everyone done with the metadata.desktop? [17:14] Splendid. [17:15] And you know what, that was already all the politics ;) [17:15] We all know what comes after the politics... the code ;) [17:15] So please save the file and close it. [17:15] And open contents/code/main.js instead. [17:16] This sweet apple pie of an empty file will soon contain our beautiful code, of which I am not yet sure what it will be... [17:16] How about starting with a simple hello world?... [17:17] I will indent code lines so they are easier visible for you. [17:17] // First create a layout we can stuff things into [17:17] layout = new LinearLayout(plasmoid); [17:18] what is probably noteworthy at this point is that 'plasmoid' thing there, it is part of the initial environment we get in a plasmoid and by having it in brackets it becomes 'parent' of our layout [17:18] the term parent here relates to live time mostly, if the parent of an object in a plasmoid explodes, all its children will too [17:19] // Then create a label to display our text [17:19] label = new Label(plasmoid); [17:19] I hope until now it is still barable complicate [17:19] // Add the label to the layout [17:19] layout.addItem(label); [17:20] Now here is an inherted goodness, since Plasmoids are based on KDE which is based on Qt we have cool layouting features, which means for simple things we do not have to worry about layout very much. [17:20] We simply create such a layout and add items to it... [17:20] Of course something is still missing for our hello world. [17:20] Text ;) [17:20] // Set the text of our Label [17:20] label.text = 'Doctor ?'; [17:20] // Done [17:21] (for the record: I do like doctor who better than hello world ;)) [17:21] You can now run this using plasmoidviewer $NAME (if you still have your terminal open) or plasmoidviewer PATHTOPLASMOIDFOLDER [17:22] Does everyone has a working plasmoid? [17:23] Also, there is a new trick I would like you to tell about. If you are on KDE 4.5 (default for Kubuntu 10.10) you will have a new command called 'plasma-windowed' using this command you can run most Plasmoids just like any other application in a window, is that not superb? [17:23] You can try that with our new plasmoid right now. [17:23] Or if you have the facebook plasmoid, try that [17:23] plasma-windowed facebook [17:24] Pretty neat feature. [17:24] So, lets build up on this example. [17:24] How about a button? Buttons are cool! [17:25] Just continue in the main.js [17:25] // Create a new button [17:25] button = new PushButton; [17:25] // Add the button to our layout [17:25] layout.addItem(button); [17:26] I personally have made it a habit to immediately after creating add objects to a layout. [17:26] Especially in large projects it can easily happen that you forget that and suddenly there is a button floating around somewhere where it does not belong [17:26] // Give the button some text [17:26] button.text = 'Do not EVER click me'; [17:26] *save* the file [17:27] and try it again [17:27] It looks a bit silly, does it not? [17:28] The layout placed the button next to the text... not awesome at all... I would really like it to be below the text. Easy to do. [17:28] We just tell our layout to align stuff vertically, rather than horizontally (which seems to be the default). [17:28] // Switch our layout to vertical alignment [17:28] layout.orientation = QtVertical; [17:28] *save* and try again [17:29] * apachelogger finds it much more attractive now [17:29] everyone done? [17:31] We are pretty fast today so I am pondering a coffe break... or maybe better not. [17:32] Of course our button does not do anything (well, other then be there, sometimes that is already a lot ;)) [17:32] Now what could we do to improve the situation a bit? [17:32] How about a nice image? [17:32] There is nothing like a good picture to spice up things a bit :D [17:32] First let us get the picture. [17:33] For that we will create an own 'images' folder and place our image in there, so everything stays nicely structured. [17:33] If you are still outside the doctor-questionmark folder in a terminal you can use the following command to do that: [17:33] mkdir -p $NAME/contents/images/ [17:33] wget -O $NAME/contents/images/troll.png http://people.ubuntu.com/~apachelogger/uadw/09.10/data/troll.png [17:33] If not, just go to your contents folder, create the images folder in there and download the picture http://people.ubuntu.com/~apachelogger/uadw/09.10/data/troll.png into that folder [17:34] Now for the code: [17:34] // Labels can also contain images, so we will use a label again [17:34] troll = new Label(plasmoid); [17:34] // But this time we set an image. The image path is constructed automatically by us telling it in what directory it is and what name it has [17:34] troll.image = plasmoid.file("images", "troll.png"); [17:35] So, we do not only have a well structured folder setup, it also makes our code more readable. [17:36] (also in case you should notice, I did intentionally not add the label to our layout, in case you have not, nevermind) [17:36] // So that our image fits in we need to tell the label to consume as much space as possible and necessary [17:36] troll.sizePolicy = QSizePolicy(QSizePolicyMaximum, QSizePolicyMaximum); [17:37] Usually Plasmoids will try to consume as little space as possible, this of course is a problem with a big image because then it would get cut off. [17:37] By telling our troll to try to use as much space as possible we can solve this 'problem'. [17:38] // We only want to show the image after the user dared pressing the button, so we set it not visible and also do not add it to our layout [17:38] troll.visible = false; [17:38] Here is the reason I did not add the image to our layout. [17:39] Instead the behaviour should be like this: user starts plasmoid, plasmoid looks nice, user is foolish enough to press button, troll comes up, user falls off chair. [17:39] What is left to make that happen is making our button actually o things. [17:40] An for that we will use a very cool feature of Qt calle signal an slot (only in a simpler version). [17:40] The basic iea is that most objects in Qt emit a signal when certain things happen. [17:40] Our button for example will emit one when it is clicked. [17:41] And those signals can be attached to so-called slots, which are basically just functions. [17:41] So we want that when the button is clicked a specific function is to be executed. [17:41] // First add a function to handle clicking on the button [17:41] function onClick() [17:41] { [17:41] // Once our button gets clicked we want to show an image. [17:41] troll.visible = true; [17:42] // We add the new image to our layout, so it gets properly aligned [17:42] layout.addItem(troll); [17:42] (keep in mind, our layout is putting items below each other, so our troll will be appearing at the very bottom right now) [17:42] // To prevent problems we set the now useless button to not visible [17:42] button.visible = false; [17:43] } [17:43] ^ do not forget this curly bracket there, to indicate the end of the function [17:43] // Now we just tell our button that once it was clicked it shall run our function [17:43] button.clicked.connect(onClick); [17:43] *save* and run again [17:45] Since bulldog98 just pointed out that the window does not resize... [17:45] Yes, that is a bug (or maybe intentional) with plasmoidviewer, the plasmoid as seen in Plasma will resize properly. In fact if you resize the plasmoidviewer window the plasmoid will look just fine. [17:46] Now since we are running out of time let us stop hacking and prepare a packge we can use to distribute our newly made Plasmoid. [17:47] Well, package is maybe a bit of an overstatement, they really are just zip files with .plasmoid as file ending. [17:47] The crucial thing that makes it work is the folder set up we used at the very beginning. [17:47] So creating a packge we can share with people we want to scare is as easy as creating a zip. [17:48] For example using the following command: [17:48] cd $NAME && [17:48] zip -r ../$NAME.plasmoid . && [17:48] cd .. [17:48] That again will only work if you still have the terminal with NAME set of course :) [17:48] otherwise just create a zip of the content of our folder and change the file ending. [17:49] It is however curcial that you only package the content, not the folder [17:49] You can find a finished plasmoid and the code at http://people.ubuntu.com/~apachelogger/uadw/09.10/ [17:50] This .plasmoid file can either be installed via the Plasma GUI ways (i.e. like you would usually add a plasmoid) or by using the command line tool plasmapkg [17:50] e.g. [17:50] plasmapkg -i $NAME.plasmoid [17:50] either way the plasmoid should then show up in your widgets list and be ready to use \o/ [17:51] So where to go from here? [17:51] Obviously this was but a simple introduction to Plasmoid programming [17:51] and also not very fancy I must say [17:52] You can however try http://people.ubuntu.com/~apachelogger/udw/10.07/trollface-6/ this plasmoid. [17:52] It basically does a very similar thing to ours but introduces fancy animations and a way to get rid of the image again. [17:53] Also at http://people.ubuntu.com/~apachelogger/udw/10.07/videos/ I created some videos which show case some basic plasmoids. [17:54] At this point I should mention that Amarok, the music player, also uses plasmoids, so it is not all that difficult to get the same plasmoid with no code changes into Amarok and Plasma at the same time (if that makes any sense) [17:54] You can find a lot more information at the Plasma community page at http://community.kde.org/Plasma [17:54] There are pointers to tutorials for all supported programming languages as well as ready to go examples. [17:55] Also, if you want to pursue writing Plasmoids in JavaScript you will need the API reference at http://techbase.kde.org/Development/Tutorials/Plasma/JavaScript/API [17:56] JavaScript is cool for simple plasmoids, but should you feel too limited by it, you can try Ruby or Python, they are not more complicated but give you greater control. [17:56] bulldog98 asked: can I simply convert your template to C++? [17:56] That depends on what you mean by convert. [17:57] You basically can use the very same program logic but you will have to adopt it to C++ code constraints. [17:57] e.g. a Plasmoid in C++ is contained within at least one class [17:57] Also you cannot do things like label.text = 'foo'; [17:58] Instead you will use setter methods, like label.setText("foo"); [17:58] So direct conversion is not possible, because the languages are just too difficult. [17:59] Also if you need help or have further questions feel free to drop into the Plasma IRC channel #plasma [17:59] That is it. [18:00] Good luck with creating your brilliant Plasmoids and have fun with steveire who is going to tell you about a magical thing called grantlee in a bit :) [18:00] I wonder what grantlee is anyway.... [18:00] Hehe, you will soon find out [18:00] Hello everyone and welcome to my talk. === 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 Grantlee to create application themes - Instructors: steveire [18:00] I am Stephen Kelly, lead developer of Grantlee and part of the KDE community, mostly working on kdepim. I am a full-time employed Qt consultant and I write and maintain Grantlee in my spare time [18:00] So what is Grantlee ? [18:01] I assume that any of you here attending the talk have done some googling to find out what it is and what it does, as the talk title is low on details. [18:01] Grantlee is a string template system. Such systems are common in web frameworks See more here: http://en.wikipedia.org/wiki/Template_engine_%28web%29 [18:01] You can see in the comparison table at that link that Grantlee supports all features of most other comparable systems. [18:01] The only missing feature is i18n support, which should be available in a few months. That is the only open bug against Grantlee :) https://bugs.kde.org/buglist.cgi?product=grantlee [18:02] Grantlee is actually based on the design and syntax of the Django template system (but does not depend on Django itself) [18:02] It is fully implemented in QtCore and QtScript, so it can be extended with C++ and with javascript [18:03] It can even be used in gtk applications just by linking to QtCore and QtScript becuase Qt can run the gtk event loop [18:03] Packages are available for Lucid and Maverick: http://packages.ubuntu.com/search?keywords=grantlee [18:03] String template systems are used in web frameworks to create html markup to send to clients that request it. The template is a file containing the html that should be sent back to the browser, but with place holders for things like your username, your messages, the color that you have chosen in your profile etc. [18:04] Websites often use such systems for scalability and code resuse [18:04] On the desktop, we don't have web servers to generate html, but it is common for applications to create themed output using html. For example, Evolution email client can render the email viewer with different themes. This is done by generating different html with different css for each theme. [18:05] KMail also allows theming using various styles. [18:05] The problem with an approach like that is that the html is often hardcoded into the source code, making it difficult to change existing themes or add new themes. [18:06] KMail had that exact problem, and in the past there were only 6 hardcoded themes available [18:06] If a theme needed to be fixed or a new theme added, the application needed to be changed, compiled, packaged, and reach the distros before the fix became available to the users [18:07] During Summer of Code 2010 Ronny Yabar ported KMail and Akregator the RSS feed reader to use Grantlee. http://ronnyml.wordpress.com/2010/08/26/gsoc-final-report-messageviewer-kmail-and-akregator-ported-to-grantlee/ === SergioMeneses_ is now known as SergioMeneses [18:08] The project was a very useful step in the development of Grantlee becaus it shows what is possible, including sharing themes among users using GetHotNewStuff [18:09] Soon it can be used to create distro specific themes, such as a theme for the fluffy kde distro [18:09] With this change it becomes easier to fix existing themes if they are broken, and it becomes easier for third party developers to create and share themes without having to send them upstream and have them compiled into the application. [18:10] kde-look.org can be used to share themes already: http://kde-look.org/index.php?xcontentmode=46&PHPSESSID=ee7d4bf311c5da8621c927303587bbc3 [18:10] There are not many available, but it shows the infrastucture is in place which is already to familiar to artists and users (opendesktop.org) [18:11] As a side note I would also like to say that Grantlee can generate not only HTML, but can generate any kind of text based markup - even computer code. [18:12] A developer could create templates for getting started creating plasmoids for example. [18:12] In the Grantlee examples there is an application which can generate code for IDEs in C++ python and ruby languages: http://steveire.wordpress.com/2010/04/06/using-grantlee-for-code-generation/ [18:12] For application theming though, the more interesting use case is html generation. [18:13] Another application in the Grantlee examples is the books example: http://grantlee.org/apidox/examples.html [18:13] We can get started by installing grantee through a package manager [18:14] sudo aptitude install libgrantlee-dev [18:14] After that we can download the grantlee source so that we can build the examples: apt-get source libgrantlee0 [18:15] Once that is finished we can start navigating to where the examples are [18:15] cd grantlee-0.1.1/ [18:15] cd examples/ [18:16] cd books [18:16] The books example is derived from the books example available in Qt: http://doc.trolltech.com/4.7/demos-books.html [18:16] To build it we create a separate build directory. [18:16] mkdir build [18:16] cd build [18:16] cmake .. [18:16] make [18:16] There is no need to install it [18:17] The books example uses sqllite to manage a database of books. Grantlee makes it possible to create a html page from the table of data and theme it in any possible way. [18:18] After it is build you can run the example by executing it on the command line [18:18] ./books [18:18] The top of the application shows the books in the database, and allows managing the authors, the genre, the rating etc. [18:19] Near the bottom of the application you can choose a theme to use when exporting the books to a html file and an export button for doing the actual exporting. [18:20] If you click the export button it will ask for a location to save the html file (default to ~/book_export.html) [18:21] Try the export and open the file in a web browser. You will see the same data that is in the application now in the html file. [18:21] Try changing some of the data, like the rating or a genre and export again. You can then refresh the browser to see an updated html page [18:22] A html export feature like that is common in applications allowing you to export contacts for example or notes. [18:22] KJots has that feature too and actually uses Grantlee already for the export. [18:23] If you're not following along, in the screenshots you can see the generated output from a plain theme, a colored theme, and a theme that regroups the output by Author. You can also see I am not a talented artist :) [18:24] Using the combobox in the application you can also try out the different available themes. [18:24] The regrouping is possible because of a powerful system of tags and filters in the template system. [18:24] Grantlee has all of the same features as Django templates have, so all of the same tags are available: http://docs.djangoproject.com/en/dev/ref/templates/builtins/ [18:25] Just so there is no misunderstanding, Grantlee does not depend on Django or on Python. Grantlee depends only on the Qt4 framework. All tags and filters are written in native Qt4 code. [18:25] Just like Django, Grantlee can be extended by third partes by writing new tags and filters [18:26] The tags and filters can't be implemented in python (yet), but can be implemented in either Qt C++ or in Javascript [18:26] The wide range of tags available and the fact that there are many existing developers with Django experience means that really compelling themes can be created. [18:27] So what does a theme file look like? There are some examples in the documentation and the links I have already given. [18:27] We can walk through some of the features of theme files now: http://grantlee.org/apidox/for_themers.html [18:28] The first example shows all the basics of template files. [18:28] It is possible to make comments with {# comment tags #} [18:28] It is possible to put placeholders into the template with {{ curly_braces }} [18:28] And it is possible to have more complicated structures like {% if %} condtions and {% for %} loops. [18:29] {% this %} is the extensible tag part of the template syntax [18:29] The {% for %} tag is used to loop over the book objects in the book example. http://www.gitorious.org/grantlee/grantlee/blobs/master/examples/books/themes/simple.html [18:29] In that template snippet, we have {% for book in books %}. books is a list of books from the database. Notice how the for loop is similiar to a python for loop, so it is familiar to people who have used python, and it is intuitive even for those that have not [18:30] For each book, we create a html row with tags, and put attributes of the book into the placeholders, such as {{ book.title }} and {{ book.author }} [18:31] This, as you would expect replaces the placeholders with the actual title and author for each row. [18:31] In this case book is an object, and {{ book.title }} calls the title method on the book object and puts the returned value into the placeholder. [18:31] Other structures apart from objects are supported, such as QHash (like a python dictionary) and QList (like a python list). For more details of what is possible see http://grantlee.org/apidox/for_app_dev.html [18:32] For the advanced coders, there is now even greater flexibility in the types of objects Grantlee can handle : http://steveire.wordpress.com/2010/09/29/grantlee-pairs-up-with-the-other-template-system/ [18:32] Grantlee also supports advanced features like template including and inheriting. That allows sharing of snippets within a theme or with other themes. [18:33] All of the themes in the books example share a common base template which sets up the structure of the output so that all the themes are consistent [18:34] We can see that one in grantlee-0.1.1/examples/books/themes/base.html [18:35] It defines a simple html structure with a html element and a element [18:35] It also contains several elements I have not mentioned before: {% block %} elements [18:36] block elements are the basis for the template inheritance and reuse system. [18:36] The base template defines some placeholder blocks which the inheriting themes can fill, and reuse the rest [18:37] http://www.gitorious.org/grantlee/grantlee/blobs/master/examples/books/themes/base.html [18:37] Looking again to the simple theme : http://www.gitorious.org/grantlee/grantlee/blobs/master/examples/books/themes/simple.html [18:37] At the top it declares that it extends the template called "base.html". [18:38] In a complex system there could be many possible base templates to inherit from with a different structure in each. [18:38] The simple theme too has some block elements. [18:39] These ones are used to fill the place holders defined in the base.html [18:39] Some of them also use the keyword {{ block.super }} [18:40] This tells Grantlee that the block in the base template should be reused, not overridden [18:41] So the "My Books" part of the header is defined in the base template, and the name of the theme is defined in simple.html, and they are combined into the title as you can see in the screenshot. [18:41] A theme could of course decide not to use the {{ block.super }} keyword, and not get the "My Books" part. [18:42] It is optional to override all or no blocks in the base template [18:42] We can make some simple edits to the theme now. [18:43] Start by editing the base.html so that the title line looks like {% block title_row %}AuthorTitleGenreRating{% endblock %} [18:44] You can then re-export without rebuilding or even restarting the books application, refresh the browser and the displayed html will be updated wiht a blue background [18:44] See the other theme files for more simple examples of changes that you can make to the generated output. [18:45] Adding such a capability to an existing application is ver easy. [18:46] It uses the Qt QVariant and QMetaType system and supports all the basic Qt types. [18:46] It is actually quite similar to the way QtQuick QML is used. [18:47] Apart from KMail and KJots it is also used in several other code generation projects, and in a proof of concept twitter application by Ryan Paul: http://steveire.wordpress.com/2010/05/20/grantlee-in-use/ [18:48] That's all I have prepared. I hope it was informative for you and you can consider using Grantlee for your next application theming or code generation needs. [18:49] The grantlee community hangs out in the #grantlee channel on IRC [18:49] And is also reachable through the kdepim mailing list if you have any questions [18:49] kde-pim@kde.org [18:50] Some more useful links to get started on understanding and using Grantlee: http://www.gitorious.org/grantlee/pages/Home http://steveire.wordpress.com/2009/06/27/some-clarifications-regarding-grantlee/ http://grantlee.org/apidox/ http://www.djangobook.com/en/2.0/chapter04/ http://steveire.wordpress.com/ [18:50] Any documentation relevant to Django is also relevant to Grantlee, so there are lots of ideas to find on the web :) [18:52] Thanks for attending the talk. In a few minutes there will be a talk about enriching applications with zeitgeist data. Don't miss it :) === 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: Enriching applications with Zeitgeist data - Instructors: seiflotfy [19:18] ok, looks like Seif is having connection problems [19:18] We might need to bump this class until tomorrow, please stand by! [19:22] ok since Seif can't get online we'll take a break until the top of the hour [19:22] so smoke if you got em! === mhall119_ is now known as mhall119 === MSK61 is now known as MAfifi === 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 Quickshot to collect screenshots" in multiple languages for s - Instructors: flan [20:01] Well, I guess that means it's time. [20:01] First time I've done anything like this, so please let me know if I'm getting off-topic. [20:02] Okay, so, this is a presentation on using Quickshot, a program designed to help you write better documentation by making it easier to get screenshots. [20:04] It's still not in Ubuntu's standard library, but it should be packaged and available by 11.04. For now, we have PPAs and Bazaar access. [20:04] We'll be using the latter of those options for today, if anyone wishes to follow along with the client itself. [20:04] To begin, you'll need to instal bzr, if you haven't done so already. [20:04] I'd imagine most of you have, for some reason or other. [20:05] If not, though, it's a simple matter of "sudo apt-get install bzr". [20:05] Around the 10th, Quickshot will be formally packaged into its final PPA form, but we're still working through last-minute changes and bug-fixes, so it's best to work with source right now. [20:06] I'm going to assume everyone's got bzr now. [20:06] If not, please stop me. [20:06] So the next step is to pull the client's source from Launchpad, where we're hosting it. [20:06] Oh, before that, I should mention who "we" are. [20:07] jenkins and I are Quickshot's principal authors. [20:07] Please feel free to ask us anything after the session is over. [20:07] To pull its source, use the command "bzr branch lp:quickshot". [20:07] This will create a quickshot/ directory under your current path. [20:07] You can delete it once this is done. [20:08] This lesson, I mean. [20:08] There's a lot of revision history, so it may take a minute or two. [20:08] I'll use that time to spam you with information about what Quickshot it. [20:08] is* [20:08] It's the screenshot-capturing tool created for the Ubuntu Manual project (http://ubuntu-manual.org/); it addresses a critical issue we encountered in preparation for 10.04: our inability to capture and catalogue thousands of screenshots in a limited timeframe. [20:08] We needed something that could ensure that we'd be able to capture screenshots in a consistent manner across languages, always have them available to drop into the documentation's build process, and allow for volunteers to help out with very little training. [20:09] Our solution was to create a client-server system that would centralise rules and data, which formed the basis of the original Quickshot: a bunch of simple PHP scripts, text files, and a monolithic Python client cobbled together in a couple of weeks. [20:09] The new version is far more robust. [20:09] The server is implemented using Pylons and has the ability to scale to any number of hosted projects and languages. [20:09] The client is Python with Glade, designed to work with any number of servers (and with plans for full internationalisation support for the next iteration). [20:09] There's a decoupled client library that allows anyone to programmatically interact with the server, to script screenshot captures as part of a controlled build process. [20:10] Contributor credit is logged on a per-project basis, so volunteers don't have to be anonymous if they don't want to be. [20:10] The server provides a means of allowing any number of owners to review and accept screenshots submitted by volunteers. [20:10] And progress reports are neatly broken up by language and stage, making gauging performance in large projects easy. [20:10] Initially, I'd like to have everyone play the role of a volunteer, capturing a screenshot or two to learn how the process works in case you want to deploy Quickshot to support your own projects and need to train users. [20:11] (If you never use it again, maybe you'll be able to mention it to someone who will need something like it) [20:11] After that, anyone who's interested will be invited to hold the role of owner over what we've done today, letting you see the other half of the system. [20:11] While we're waiting for any remaining pulls to finish, does anyone have any questions? I'll entertain them in either channel. [20:13] Okay, I'm going to continue. [20:13] Before I have any of you run the client, a disclaimer is in order: there is a lot of code and it has not been thoroughly peer-reviewed. [20:13] If you do not feel comfortable trusting that what you've just downloaded is safe, you are not obligated to execute it, and you can still benefit from this lesson. [20:13] If you're in the doesn't-fee-safe-running-unsigned-code group, please follow with the discussion and jump in again when we get to the server-management part. [20:13] feel* [20:13] For those willing to actively follow along, please let me know what you get when you type "echo $LANG". [20:14] I'll add your languages to the server so you don't get any "language not supported" messages. [20:14] google-fu asked: I've tried Quickshot a while ago and from what I remember, in order to use the program you have to create a new user and log in to that user for the program to work. I find this thing annoying, is this still required? [20:14] No, not for this demonstration. [20:14] That's still a requirement for our parent project, the Ubuntu Manual Project. [20:15] But it's now fully optional, and can be toggled on a per-project basis. [20:15] Same with screen resolution. [20:15] We won't be changing any of that stuff today. [20:16] TobiS asked: whats the line to pull Quickshot from the remote repository? [20:16] bzr branch lp:quickshot [20:18] Okay, I'm going to continue. [20:18] Please paste the following command: "wget http://flan.uguu.ca:5000/appdevweek/10-10/%5Bappdevweek%5D10-10.qsproj" [20:18] This will download a "qsproj" file, which is really just a chunk of text that tells Quickshot about a project. Live details are always pulled on connection. [20:18] When done, type "cd quickshot/source", followed by "bin/quickshot". [20:19] You will see some WNCK-related warnings. These are entirely benign, so don't worry about them. [20:19] Browse for the file you just downloaded in the "Local files" section of the Quickshot window, then click "Get started!" [20:19] Where to issue wget? [20:19] In any terminal. [20:20] In any directory? [20:20] Sorry. I should have been more clear. [20:20] Yeah. It just downloads a file. [20:20] You may wish to join #ubuntu-classroom-chat. There's more discussion going on there. [20:21] After a brief moment, you should see a list of six screenshots. [20:21] If you see a message about the connection to the server timing out, that's not entirely unexpected (the server we're using today is single-threaded). Just retry or click "Reload" when you see the empty list. [20:21] This presumes you've pointed Quickshot at the .qsproj file. [20:21] Just in case anyone missed that part. [20:21] You'll all also see another window in front of the list of screenshots. Feel free to enter any information you'd like, or use "anonymous@example.org" and leave the other fields blank. [20:21] This window will only appear once. If you wish to change your settings, you can access the window under the "Edit" menu. [20:22] Okay, now please resist the temptation to click anything. [20:22] And let me know if I'm going too quickly. [20:22] I'd like a volunteer who is using a non-English Ubuntu environment to help get us started. [20:23] So, serapophis has volunteered. Yay. [20:24] serapophis, please pick the 'gedit' screenshot by either double-clicking it or highlighting it and clicking 'Forward'. [20:24] You'll be presented with a list of steps on the left and a message on the right saying "No reference screenshot available"; the rest of you will see something similar soon. [20:24] Quickshot uses any accepted language's version of a given screenshot as a reference for future captures, but nothing's been accepted yet. [20:24] Once you're comfortable with what you've been asked to do, click "Capture". [20:24] At this point, I'd like to ask everyone else to either click the "Quickshot progress" link on their clients or visit http://flan.uguu.ca:5000/appdevweek/10-10 [20:25] You'll all see three progress bars, one for 'en', which includes 'en_US' and 'en_GB', and one for the language of our brave volunteer. And daker's crazy language. Il est fou. [20:25] Quickshot automatically reduces languages into a parent if no specialization was declared. [20:26] If we created en_CA, Canadian screenshots would be captured independently of American ones. [20:26] This is for languages that have significant differences between dialects. [20:27] Okay, so, getting back on topic, serapophis, please foloow any on-screen instructions. [20:27] All you should see is a message telling you you have three seconds, after clicking 'OK', to give gedit focus. [20:27] It'll automatically look at the last-activated window and try to use that if you don't explicitly give focus to any window. [20:28] Please let us know once you're presented with a window that asks you to confirm that everything looks good. [20:28] The rest of you will be doing this soon. [20:28] Except you'll have the benefit of reference screenshots. [20:29] Okay, serapophis, just click 'Submit'. [20:29] Everyone else, reload the page I asked you to open. [20:29] You should see progress in the de_DE field. [20:29] ...Or maybe you won't. [20:30] i was about to say the same :) [20:30] Have you been returned to the screenshot list, serapophis? [20:30] Okay, it might just be taking a while to upload. [20:30] I guess I'll need to work on that. Sorry. [20:31] The interface is supposed to freeze during the upload process, but I figured it would be graceful. [20:32] Okay... I was able to upload an English one without issue... [20:32] serapophis, what sort of connection do you have? [20:34] i guess we can carry on with the en one I will try and work out what if it is just serapophis connection [20:37] 13:37 <+flan> Okay, so we're a little off from where we should have been, but can I get everyone else to try taking a screenshot for gedit now? [20:37] You should now all see a reference screenshot on the right side of the window. [20:38] jenkins, please take the IRC screenshot so I can let them see it, too. [20:38] will do [20:38] If you click this reference screenshot, you'll see a full-size (but JPEG-compressed, for transmission speed purposes) version of what was captured. [20:39] done [20:40] Okay, for our German users, try capturing the IRC screenshot. [20:40] You'll now see what everyone else is seeing with Gedit. [20:40] Feel free to take whatever screenshots you want for the next couple of minutes. [20:41] In the meantime, I'd like everyone's OpenID. You should have one from Launchpad. [20:41] Mine is https://launchpad.net/~red-hamsterx ; yours will be similar, only with your name at the end. [20:41] The Quickshot server doesn't use passwords, opting instead for OpenID. The virtues of this system are the subject of another lesson, though. [20:41] Other OpenID providers are okay, too, of course; Launchpad's probably just something you've probably all used. [20:43] Okay, for anyone who's offered their OpenIDs, you can now log in at http://flan.uguu.ca:5000/appdevweek/10-10 [20:43] The field's in the top right. [20:43] It should be the same process as with any other OpenID-enabled site. [20:44] You provide your URL, your provider tells Quickshot that you're really you, and you get access. [20:44] WARNING: Quickshot, like almost every program, has the ability to run arbitrary commands on your system. In a moment, your peers will be able to control the commands it runs. Please be sure to check the command to be executed before you capture a screenshot. [20:44] I don't think anyone here's malicious in the slightest, but it doesn't hurt to be paranoid. [20:45] Once you've logged in, you'll notice that there's now a new bar in the top right that says "Manage version". Each language will also be clickable. [20:45] First, click any language with progress. You'll notice that some screenshots are in the "pending" state, which means that they can be approved or rejected. [20:45] Please feel free to play around, but show a little restraint, since the server is, again, single-threaded, so you don't want to choke out anyone else. [20:46] Also, this is actually running on a home connection, so please refrain form clicking the 'download archive' links; I need my bandwidth for other things. [20:46] So, yeah, just click around. [20:46] Submit multiple versions of pending screenshots and see what happens. [20:47] This is what people who are managing Quickshot projects will see, allowing them to collaboratively decide what to accept and what to reject. [20:47] (We're very open to feedback on how to make it simpler, if there's room for improvement) [20:47] As you accept screenshots, the credit report on the project page will also be filled out. [20:49] Once you've played around with that stuff to your satisfaction, go back to http://flan.uguu.ca:5000/appdevweek/10-10 and click 'Manage version' in the upper right. [20:50] You can use this itnerface to add new languages (like fr_CA, for crazy Quebec types), change screenshot details, change the order of screenshots, and add new screenshots. [20:50] Your changes will be immediately reflected on every Quickshot client. [20:50] There's also a feature that allows to you translate a screenshot's steps, but we won't be playing with it today. [20:51] You'll notice that 'en' doesn't appear in this section. [20:51] That's because it's actually a property of the parent project, http://flan.uguu.ca:5000/appdevweek [20:52] This means that every Quickshot project that's a part of AppDevWeek needs to support English. [20:52] But de_DE and fr_FR are specific to this one week. [20:52] Oh. Please do not toggle the username or resolution settings. [20:52] We don't want to force anyone to create a new user account for this demonstration. That would just be mean. [20:53] Anyway, please feel free to keep playing with the system for the next little while (I'll leave the project active for a couple of hours). [20:54] I don't really have anything else to say or add, but I do hope you've found this informative and know that, yes, there is now a tool that exists to make putting screenshots into big documentation projects a not-so-daunting task. [20:54] It just involves getting a bunch of volunteers together. [20:54] We'll be launching production-ready versions of the client and server shortly after the next edition of the Ubuntu Manual is out, around the 10th of October. [20:55] The code, and a set-up guide for the server (and maybe a brief user guide for the client) will be available at http://quickshot.org. [20:55] If you have any questions, please ask either myself or jenkins. [20:55] If you want to know how something was built, please ask me. [20:55] If you want to report a bug or usability enhancement, please ask jenkins. (He's better at handling criticism. =P) [20:57] If you know of any projects that could benefit from Quickshot, please let them know about it,. [20:57] apport will still sent the logs to launchpad with out a hard crash iirc [20:57] And let them know what we can always be found in #ubuntu-manual. [20:57] that* [20:57] And now I clear the stage for the next session. [20:57] Thank you for your patience and interaction, everyone. [20:58] Okay, so I've got the channel to myself, to bend to my twisted, evil whims. [20:58] Excellent. [20:58] Now I just need some twisted, evil whims. [20:58] Anyone else want server access? [20:59] Just costs an OpenID URL. [20:59] (Your OpenID provider retains rights to your soul and banking information) === 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 || [21:11] byebye === yofel_ is now known as yofel