didrocks' blog

apt-get install -f cerveau

Aller au contenu | Aller au menu | Aller à la recherche

jeudi 19 novembre 2009

UDS Lucid Jour 3

C'est parti, un peu en retard, pour un résumé plus rapide de la 3ème journée de l'UDS.

Après avoir fait un petit tour la veille dans une limousine (photo needed :)), le 3ème jour a commencé avec une discussion sur les applications par défaut intégrées dans Lucid. Quelques changements ici, car, même si la plupart ne le savent pas, les programmes installés par défaut sont vraiment vraiment difficiles à faire tenir sur un CD et le passage à un DVD par défaut n'est pas envisagé. L'idée est que "moins, c'est plus"[1]. Donc il y a aura la suppression de quelques jeux dans GNOME games par défaut et surtout, de The Gimp, qui n'est pas vraiment un outil considéré grand public. Quelques développements seront faits pour intégrer Eye of Gnome avec fspot pour répondre aux besoins les plus courants. Le Software Center va gagner une nouvelle catégorie où l'on pourra mettre des applications considérées comme avancées et professionnelles et on y retrouvera The Gimp.

La session suivante a été sur l'intégration des technologies à venir dans la future release de GNOME, voir comment concilier une LTS, stable et les changements upstream. Vincent Untz et Ryan Lortie ont pu donner quelques conseils sur ce qui se doient d'être intégré et ce qui ne sera pas assez stable pour une LTS.

Ensuite, une session sur les nouveauté de l'applet indicateur s'est tenue et a permi de voir ce qui allait être fait dans ce secteur (unifier les menus par clic droit et clic gauche et permettre aux applications de créer leur propre menu dedans).

J'ai assisté à la session intitulée "Ubuntu One Music Store". Une intégration avec Rhythmbox permettra aux utilisateurs d'Ubuntu d'acheter de la musique sans DRM et intégrée avec leur environnement, synchronisée sur chaque ordinateur Ubuntu de l'utilisateur et d'accéder à leur bibliothèque de manière transparente.

Après les 4 sessions plénières (Edubuntu, tenir les temps dans un process de développement et présentation du ReleaseSchedule de Karmic, Freescale et comment créer des interfaces agréables et utiles à l'utilisateur).

J'ai ensuite assistée à une session sur comment développer launchpad. Session intéressante mais il faudra pratiquer pour vraiment rentrer dans le code :)

Enfin, la session de deux heures que je tenais sur Quickly. Nous avons discuté des futures évolutions de la 0.4 et pris quelques décisions sur le futur fonctionnement de l'importation de commande entre templates. La mauvaise nouvelle est que nous n'avons pas eu le temps de couvrir tous les sujets, mais beaucoup de personnes intéressées étaient venus.

That's all folks!

Notes

[1] less is more

jeudi 8 octobre 2009

NotifyThis 0.1: notify everything easily!

In our French ubuntu party organized by ubuntu-fr, we have approximately 20 free and ready to use computers for people to be able to try ubuntu on their own (we have someone around to help new users).

But that's a lot of wasted space for advertising our conferences, scheduled demonstrations, lessons we have during the party! So, the idea was to create a daemon notifying this, resulting in: example.png

notifythis192.png NotifyThis is here to fulfill this need. It's a desktop daemon (no pid file) using dbus for single instance and actions like pausing, stopping, forcing configuration file reload[1]

Source file is in XML (default in /etc/notifythis-data.xml):

 <?xml version="1.0" encoding="UTF-8"?>
 <notifythis xmlns='http://launchpad.net/notifythis' xml:lang='fr'>
   <notiftypes>
       <type>
           <name>lesson</name>
           <priority>low</priority>
           <icon>/usr/share/icons/Humanity/apps/22/gnome-terminal.svg</icon>
       </type>
       <type>
           <name>conference</name>
           <priority>low</priority>
           <icon>/usr/share/icons/Humanity/stock/22/stock_people.svg</icon>
       </type>
       <type>
           <name>demos</name>
           <priority>low</priority>
           <icon>/usr/share/icons/Humanity/places/22/user-desktop.svg</icon>
       </type>
       <type>
           <name>miscellaneous</name>
           <priority>low</priority>
           <icon>http://awesomeurl/dialog-warning.svg</icon>
       </type>
   </notiftypes>
   <notifevents>
       <event>
           <title>Beginners lesson</title>
           <content>Lesson for beginners in 10 min</content>
           <type>lesson</type>
           <time>2009-09-27 12:33</time>
       </event>
       <event>
           <title>Advanced lesson</title>
           <content>Advanced lesson starting in 15 min</content>
           <type>lesson</type>
           <icon>http://unexistingurl/stock_dialog-warning.svg</icon>
           <time>2009-09-26 22:01</time>
       </event>    
       <event>
           <title>Awesome conference</title>
           <content>An awesome conference on Ubuntu will start in 5 min.\nKeep it hot!</content>
           <type>conference</type>
           <time>2009-09-27 23:54</time>
       </event>
       <event>
           <title>End of the event</title>
           <content>Well… I guess you will have to leave NOW!</content>
           <type>miscellaneous</type>
           <icon>/usr/share/icons/Humanity/status/22/stock_dialog-warning.svg</icon>
           <time>2009-09-27 23:55</time>
       </event>
   </notifevents>
 </notifythis>

What can I do in this notifythis namespace?



You associate an event instance (in notifevents/event ) to a notifytypes/type/name declared in the file. Types enables you to set some default priorities and icons to events. <Icon> refers to a path to an icon, which can be local to your computer or distant served by your preferred web server (http://…). In the latter case, NT will cache it for you locally. Consequently, using multiple times the same icon in different types or events will download it only once.

Title is used as… notification title and content as… content :) <time> is used to specify when the event will be notified. Categorizing your event is just a way to avoid multiple icon/priority definitions, but those two values can be overridden for a particular event simply specifying corresponding tag (<icon> for instance). If it can't be found, event type icon will be shown. If this one doesn't exist/can't be reachable either, a warning is spawn in log file and no icon will be displayed.

So, you can for your event, but it can be bound with any kind of other things like calendar, TODO items, and so on…

But well, as unscheduled event changes may happen[2], you surely want to upload your xml file online and reload it in all NotifyThis daemon dynamically. It's possible too (and what we will do during our party).

In /etc/notifythis, you can set where the xml file is:

 # time in minutes beteen two xml file reloading, default is 30 minutes
 DELTA_BETWEEN_XML_RELOAD=30
 
 # xml files (separated by ';') by order of preferences.
 # It can an absolute or a relative path to this file.
 # It can be a network path (http://) too
 XML_FILES=notifythis-data.xml

You can even specify multiple XML_FILES and first found one will be use (like in XML_FILES=http://my/central/xml/file.xml; /usr/local/mybackupfile1.xml;notifythis-data.xml). XML file will be reloaded every $DELTA_BETWEEN_XML_RELOAD min (30 min if not specified) in each daemon. If no xml file is found, previous working configuration is preserved and a retry is done every minutes then.

By default, NotifyThis is a desktop daemon[3] launched with a classical .desktop file in /etc/xdg/autostart/. Log are in ~/.local/share/notifythis/notifythis.log

Well, NT uses Quickly to simplify project handling. I guess we should investigate in a desktop-daemon template, making properly the double forking, using dbus instead of a pid file and dbus communication to reload configuration file, stop, pause… this can be handy! We can perhaps add a way for a template to reference another template to avoid redefining same commands twice and gives an easy way to call them (without having specifying --template ubuntu-project, for instance).

Well, if you want to give it a try, NotifyThis 0.1 is out and is available in my ppa.

Notes

[1] --help is your friend

[2] and will certainly happen actually

[3] you can launch it interactively as well, with --no-daemon and set different verbosity levels

vendredi 25 septembre 2009

Build your application quickly with Quickly: Inside Quickly part 9

We are now almost ready to land! Here is the last part of this long suit of blog posts about Quickly.

Packaging your project

It's the last, but not the least issue when you are writing your software: once your application is functional, you surely want to enable other users to install it. Well, you can give it into a tar.gz and run from a trunk, but what about creating a nice package, containing all dependency information for you[1]? Let's see how to achieve this automagically.

Build your project locally

First good idea (even if it's not compulsory) is to try to build it locally. Just issue this command for that:

$ quickly package

It will creates a debian binary package (deb) from your project. The first time, quickly package creates the packaging too. Before running the package command you can edit the Icon and Category entry of your <project_name>*.desktop.in file.

Note that if you didn't run quickly release, quickly share or quickly change-lp-project you may miss the name, email and some other entries in setup.py file. So, you won't have those metada in your package. You can edit them if you don't want to use any of these commands afterwards. Those changes are not mandatory at all for testing purpose.

Quickly package will retrieve all dependencies on your project for you and then build the package locally. You will get a .deb file in the upper folder of your project directory and can install it for testing purpose.

In addition to giving a lot of hints to setup.py, default ubuntu-project enables you to have some automation to specify a data directory that works both from trunk or specified location. If you know a little about python packaging, you can build and install your own local version with python setup.py build -homedir </usr/local/...> (or -rootdir) and this (and any other path) is taken into account at build time.

Debian package description is taken from setup.py where you can change them by editing

description='UI for managing …',
long_description='Here a longer description',

licensing

Stop! Before packaging and making it available to whole world, you really should license your project

Hum, I know what you think "licensing is boring, I never know what I must do and ship in my package" (how many upstreams never shipped the GPL vanilla file in their tarballs). That's an old story with Quickly. Just launch

$ quickly license

to create a GPL-3 project, shipping all desirable headers to all files as well as the right LICENSE and AUTHORS file.

It will warn you that you should modify "# Copyright (C) YYYY <Your Name> <Your E-mail>" in Copyright file if you "$ launch quickly license" the first time before launching "$ quickly share" or "$ quickly release" (in the other case, all files are licensed automatically with GPL-3 and name/email are taken from Launchpad). So, edit it manually in the former case.

But well, you are going to tell me that you don't want to license under GPL-V3? Shell-completion will reveal your all supported licenses by Quickly:

$ quickly license [Tab][Tab]
BSD     GPL-2   GPL-3   LGPL-2  LGPL-3

Quickly always ship the right files and put the header in an according form. Be aware[2] that you can relicensed your project with another license once if you have already licensed it. It will just override your previous license and clean all files accordingly.

If you want to put your own Quickly unsupported License, put your own license text in Copyright file between the tags ### BEGIN AUTOMATIC LICENCE GENERATION and ### END AUTOMATIC LICENCE GENERATION. Then "$ quickly license" does the trick and will add your personal license to every files.

Adding new licenses is really easy, if you think that another license ought to be included in ubuntu-project, do not hesitate to open a bug against Quickly.

So, no more mess when licensing your project. It also updates setup.py and next "$ quickly package" (or "$ quickly release/share) will update the Debian packaging too.

sharing

I guess that your are now ready to enable the world to discover an early beta of your application without publishing this version (or intermediate release) as stable one?

Launchpad ppa are great for that and avoid releasing an official version. It's as easy as:

$ quickly share

It updates your PPA with the the latest saved project changes.

So, before running "$ quickly release", you should: create your account on http://launchpad.net and add a PPA to your launchpad account. Quickly will check that you have an ssh and gpg key. We hope to be able to add advanced support to that in later release.

The first time the command is issued (and that "$ quickly release" was not issued before), it will ask to open a webpage for identifying your Launchpad account so that you can bind Quickly with Launchpad. This is done once by machine (that is to say, all projects on a host share the same launchpad account).

Then name, email and version setup.py will be automatically changed. Version will be <current_release~publicX> where X is incremented at each "$ quickly share" execution before a new release is done.

If "$ Quickly package" was not issued before, it will run it. Same for licensing, updating name, email, license to every part of your project. No more unlicensed file.

Then, it pushes a source package to your ppa. Just wait for Soyuz (in Launchpad) builds your package and you can make your friend discover your project!

releasing

Well well well, when you have tested throughly your package, it's time to release it, isn't?

$ quickly release <release_number> notes about changes

<version> and <description of the release> are optional. Let's see first without them:

$ quickly release

This command first ask for a Launchpad account if you didn't run "$ quickly share" before in any other project. Then, it will propose you to bind your project with an existing Launchpad project, search it with some keywords and then enter the number corresponding to your project. That will be done once per project and finally, if you didn't packaged it previously (neither with quickly package, nor with quickly share), it will do it (same with license issue).

If you didn't put any release version, Quickly will then release it with current number in setup.py (0.1 when you create your project and then, incremented by +0.1 each time the command is issued). If you previously used "$ quickly shared" publicX will be dropped to release <current_release> version (as <current_release>~publicX is less than <current_release> in packaging world).

If you feel the current version is an "0.8" release (without respecting the +0.1 order), your can launch:

$ quickly release 0.8

to enforce this value.

Then, Quickly will save the current state (with the optional notes about changes commit message), add a tag to it and bind your bzr branch with the corresponding project in Launchpad (pull and push). Finally, it will create the source package and upload it to your ppa before bumping the revision (+0.1), ready for next changes.

Of course, some setup.py values are updated too like setting project url, pushing it to debian/control, and so on.

And that's it, you have now a new rocking release, updated with all licensing and packaging issues done for you. Enjoy!

Change Launchpad project

If you want to unbind and bind again your project with another Launchpad one, you can issue this simple command:

$ quickly change-lp-project

It enables you to set or change the Launchpad project binded with the current ubuntu project.

Summary:

Ok, that's it for the tour, I hope you enjoyed it and it gave you some desire to use Quickly for your own project, develop new templates, and give new ideas!

In a nutshell, in two commands:

$ quickly create ubuntu-project myproject
$ quickly release

you can have a release of your project, licensed, packaged, under proper revision control. Easy and quick isn't?

Get Things Done Right and... Quickly!

More info on Quickly:

  • Previous part of the tour:
  1. Part 1: introduction
  2. Part 2: general concepts, core and templates
  3. Part 3: getting help
  4. Part 4: shell-completion
  5. Part 5: miscellaneous core stuff
  6. Part 6: creating templates
  7. Part 7: ubuntu-project template presentation
  8. Part 8: ubuntu-project template code editing

Press review:

Notes

[1] thanks to distutils-extra and amazing pitti's work

[2] that is to say, take care about legal form there

mercredi 23 septembre 2009

Build your application quickly with Quickly: Inside Quickly part 8

You have now your amazing and remarkable new Quickly "ubuntu-project" templated project but don't know how to start hacking on it? Here are some tips for you, just there, keep on!

Modifying your ubuntu-project

edit command

Quickly edit is a convenient command to open all of your python files contained in your project in your default editor, ready for editing. Just run:

$ quickly edit

anywhere in your project tree.

It will most likely open them on gedit, apart in case you put other values in EDITOR or SELECTED_EDITOR environment variables. Consequently, if you previously configured your editor with sensible-editor, this one will be chosen[1].

glade command

This command enables you to open all generated UI files in Glade, so that you can modify your interface. UI files are where your interface is described and Glade is here to give you some handy way of defining it.

$ quickly glade

Note that If you just run Glade from the Applicatons menu it won't work with Quickly. Indeed, what Quickly does is assume that there is one UI file for each Python class for each window type instead of a single big ui file that defines all of the UI for the whole project. This allows each class to derive from window, and most importantly from Dialog. Quickly needs to generate some xml files to tell Glade about these classes and if you just load Glade from the Applications menu, Glade doesn't get to see those UI files and won't load the UI files rather than risk corrupting them.

dialog command

This command helps you to create a new dialog into your project.

$ quickly dialog <dialog_name>

where <dialog_name> is one or more words separated with underscore.

This will create:

  1. A subclass of gtk.Dialog called DialogNameDialog in the module DialogNameDialog.py
  2. A glade file called DialogNameDialog.ui in the ui/ directory
  3. A catalog file called dialog_name_dialog.xml also in the ui/ directory

The default opened file is the main window for your application. You can switch to others under the "Projects" menu.

save command

Ok, you should rather save your project at regular interval, using a revision control system (enabling you to revert back to any point in time, to share with other your code and merge their work into your). Quickly save enabling taking this kind of snapshot of your project:

$ quickly save notes about changes

where "notes about changes" is optional text describing what changes were made since the last save.

It basically commits all changes since the last save to bzr, using a default text if you don't specify one. If you need revert or otherwise use the revision control, use bzr directly.

Note that it does not push changes to any back up location.

Well, that's almost it. You can now really begin to work on your project using all the Quickly goodness. Next subject will be the last one: sharing your finished product and packaging it as easy as pie.

Notes

[1] bryce told me "I was surprised that for once, I had my files opened with emacs" :-)

lundi 21 septembre 2009

Build your application quickly with Quickly: Inside Quickly part 7

We previously saw the general concepts around Quickly and more particular its core.

So, now, it's time to dive into the different commands of the first Quickly template which is ubuntu-project.

What brings me ubuntu-project template?

To make programming easy and fun, we've made some opinionated[1] choices about what tools, apis, etc.. to use.

In a nutshell:

  • Python for the language
  • pygtk for the UI framework
  • Glade for the UI editor
  • Gedit for the code editor (though this is easy for you to change if you choose another one)
  • bzr for version control
  • Launchpad for code hosting
  • desktopcouch for storage/database (!)

ubuntu-project template adds some glue there to all those technologies to lower the barrel and facilitate the learning curve.

create command

The first command you will certainly use is to create an ubuntu-project "templated" project. You can just execute the following line to get a working project directory:

quickly create ubuntu-project Myproject

This causes a bunch of info to be dumped to the command line, but ends with the application being run. What Quickly does is to copy over basically a sample application, and do some text switcheroos to customize the application with the name provided.

Here is the obligatory screenshot of a newly created Quickly application without any change:

Quickly default image

Note that in addition to the main dialog, you get a preferences and also an about dialog.

Under the hood, the command initiate a bzr repository and make a first commit to your project, this will enable you to track your changes and revert them later if needed, sharing the code on Launchpad, and so on... So, here it is, your project uses all previously described technology and is under revision control. You also have a nice .desktop file for showing your application in desktop menus for free. Enjoy! \o/

Then, we considerate that all subsequent commands will be run from a ubuntu-project "templated" project folder.

run command

If you've closed the application and want to run it again, change to your project directory, and use:

$ quickly run

This will run your project as a subprocess.

tutorial command

This command gives you the definitive must-have tutorial to know, indicating you what to do once your project is created, what can be changed, how to build it, etc. It goes also in some desktopcouch-db tweaking.

$ quickly tutorial

It will launch your default web browser and point you to a bunch of documentation to realize a successful ubuntu application.

Note that you can launch this command outside any project[2] too by spawning:

$ quickly tutorial ubuntu-project

or:

$ quickly -t ubuntu-project tutorial

That's enough for today. It was rather short, but you have now plenty of stuff to discover by yourself: you can now create your own project and play with it. We won't cover here what lines to change into the default code of your project or how to add new couchdb storage as all of this is already described in the tutorial. We will rather focus on commands.

Next stop will be on how to edit/change the content of your software, and save your stuff at regular interval.

Notes

[1] *very* opinionated would say Rick Spencer ;)

[2] just a quick reminder for those who didn't follow previous parts ;)

vendredi 18 septembre 2009

Build your application quickly with Quickly: Inside Quickly part 6

This post will make a little pause in Quickly features reviewing to focus on the template creation. Ever wanted to create your own Quickly template, or to modify slightly the existing ubuntu-project template to make different choices? This part is for you!

If you aren't interested, we will begin the ubuntu-project template description next week, see you there!

Quickly Templates

General stuff

Templates can be written in whatever language you want. They are just a set of commands in a directory, containing commands to copy images, documents and interacting with the user.

Adding a command is quite easy: just drop it into the root template directory and make it executable. Quickly will know by this way that the current file is a command that Quickly Core can launch. Consequently, if you need additional internal commands that can be launched only by your own commands, just create a subdirectory in your template and add it there!

Ready to see how to create a template? Remember than template can be created for everything: generating advanced music list, managing LaTeX files, doing anything without any project (just having all commands that can be launched outside project), etc. You can even create a template with commands written in C to help users design a perl application. :)

Template paths

Quickly will retrieve template in multiple paths. To know which template paths are detected, you can use:

$ quickly --version
Quickly 0.2.3
  Python interpreter: /usr/bin/python 2.5.2
  Python standard library: /usr/lib/python2.5

  Quickly used library: /home/didrocks/Projets/quickly/quickly
  Quickly data path: /home/didrocks/Projets/quickly/data
  Quickly detected template directories:
          /home/didrocks/quickly-templates
          /home/didrocks/Projets/quickly/data/templates/

Copyright 2009 Canonical Ltd.
  #Author 2009 Rick Spencer
  #Author 2009 Didier Roche
https://launchpad.net/quickly

quickly comes with ABSOLUTELY NO WARRANTY. quickly is free software, and
you may use, modify and redistribute it under the terms of the GNU
General Public License version 3 or later.

What is interesting for us are the following lines:

  Quickly detected template directories:
          /home/didrocks/quickly-templates
          /usr/share/quickly/templates/

/usr/share/quickly/data/templates/ is what you should see if you installed Quickly with your package management system. That is the default location for templates.

If you built Quickly yourself and add some options like home= or root= (standard distutils options to specify a different home), your will find them in $your_targeted_directory/templates.

The first path (in my home folder), only appears if you have installed at least one template. This is the place for your personal templates that you don't want to share with user, or just for experimentations.

There are additional checks and possibles paths for people using trunk too, but that's not the point. :)

Create a template from scratch

The best way is to declare your template under ~/quickly-templates by creating a directory into it, like "my-awesome-template".

In it, create scripts/executable files and they will became commands. Easy, isn't it? :) The command name is the command script name without the extension (if present): foo.py becomes foo command, bar.sh will be bar, foobar remain foobar command.

Create a template from another template

But if you are found of an existing Quickly template but you disagree on the choice of a particular technology and want to modify it to apply it to your needs, there is an easy way to achieve this.

You don't have to copy yourself the corresponding templates, but instead, run:

$ quickly quickly <origin template> <new template>

So, for instance:

$ quickly quickly ubuntu-project kubuntu-project

It will create (if it doesn't already exist) ~/quickly-templates, the corresponding subdir and makes some additional checks.

The most important thing is that templates aren't binded: you can modify it independently than the one used at creation time. It's an easy and convenient way to start from existing work.

Little brain breaker

How to complicate it a bit? Oh well, if you really understood the previous parts, you can know how to do that differently:

wherever/you/are $ quickly -t ubuntu-project quickly kubuntu-project

or:

quickly/project/dir $ quickly quickly kubuntu-project

to copy the template associated with current project.

Quickly Core does the hard work for you

If you are using python or not to create your template, Quickly Core does already some part of the work for you. This enables you to relax and know that you are always launched in good conditions. Let's see what's automated.

If you didn't understood part 3, I urge you to read it again, you will need it to follow the next 2 sections :-)

Command launch context

By default, all template commands (contrary to builtin ones) can be launched only in a project "templated" with your project. I guess you remember that there is some additional attributes that you can specify to change that behavior.

All the little black magic is in the commandsconfig file that has to be in the root directory of your template (its presence is not compulsory). Here is the example for the ubuntu-project template

# define parameters for commands, putting them in a list seperated
# by ';'
# if nothing specified, default is to launch command inside a project
# only and not be followed by a template
COMMANDS_LAUNCHED_IN_OR_OUTSIDE_PROJECT = tutorial
COMMANDS_LAUNCHED_OUTSIDE_PROJECT_ONLY = create
COMMANDS_FOLLOWED_BY_COMMAND =

As in every configuration files, you can add comments with #, and use ATTRIBUTE = value format. Quickly Core supports as well list in this format : ATTRIBUTE = command1; command2; .... Of course, we are quite tolerant about the format (extra spaces, comments on the lines, etc.)

So, in that example, I can launch "quickly create ubuntu-project ..." outside a Quickly project only. As it's a template command that can be launched outside a project, it's a project followed by template (read chapter 3 again to see what it implies).
All unlisted commands have the defaults: command not followed by a command nor a template and they can be launched inside a project only.

Also, COMMANDS_FOLLOWED_BY_COMMAND is almost self explanatory. Think about the help builtin command presented in part 3. (Not sure if any other command will need it, but well, all the logic is implemented in a generic way, so, let's get it available if some people need it) :)

Then, Quickly Core will do every checks to ensure that the command is in the good context and has the right parameters to be launched (or to propose this template if not specified for this command, etc.).

Shell completion

Basic one

The good news if you followed the previous section is that you have nothing to add. Shell completion automatically understands if the command should be available or not considering the current context (inside a project or not, a template already provided with the --template option on the command line, etc.) and propose you what you can use.

Same for templates proposal if you are executing a command out of a project. It will as well propose another command if you specified the right attribute. Also, if a command name is in more than one template, it will automatically fetch to show you what is available to the user as previously described in part 4.

Add advanced completion

Ok, but I know, you want more than basic completion for your awesome template. For instance, the license command in the ubuntu-project template display available licenses.

Here, the logic is "logically" outside of Quickly Core as it shouldn't integrate template-specific stuff. So, once the basic completion will give no more solution (that is to say, context is ok, templates are specified, commands too if needed...), it will launched the script with shell-completion as the first argument, and then, what has been specified on the command line.

Let's take an example:

$ quickly -t ubuntu-project licence [Tab]

(Note that -t ubuntu-project is not compulsory if you are in a ubuntu-project "templated" project)

It will launch licence.py of ubuntu-project template project with shell-completion "" parameters.

$ quickly foo bar test [Tab]

It will launch foo script with shell-completion bar test ""

$ quickly foo bar tes[Tab]

However, this latter will launch foo script with shell-completion bar tes. (as last parameter isn't empty, you know on which word tab completion is launched). But you still can show all candidates, like "you, should, test, it" and Quickly shell-completion script will fetch with current parameter (to choose here "test", only candidate which matches "tes").

Ok, but how to tell Quickly that "those results are values that can be used in shell-completion"? Easy, just print it! In the previous case, you can just execute in your code: print "you should test it" (or echo, or printf depending on the chosen language...). a blank space is needed but no order is required (it will be reordered automagically with TabTab)

So, keep in mind that we can launch script with shell-completion parameter each time the user spawn shell completion. Conseuqnetly, design your commands accordingly (see later for a tools to help you with that if you are writing your template in python)

Help to figure out help

The help system use a similar feature. You just have to print the help when Quickly Core call your command with help parameter. Again, a convenient function will be described later for Quickly templates in python.

Command line treatment

Quickly Core is stripping all known options and arguments like templates (when following command like in command followed by templates without the -t option or not in a Quickly project) to have always the same state for the command.

With this, you are assured to have your own parameters to treat, not Quickly specific ones and no context to deal with. Focus on template coding, don't deal with this mess, Quickly Core does it for you :)

Special option that we saw in previous chapter is provided on commodities function for python (see below) or in environment variable. For instance, there will be a staging string in QUICKLY environment variable if the user used the --staging option or exported directly the variable. Same system is used for verbose mode. Quick reminder: multiple values are separated by ":".

Launching from root project directory

You can always consider your command is launched from project root directory, even if the user is in a subsubsubdir (or even deeper in the directory tree hierarchy) of the project. Quickly Core in all its cleverness and goodness guide your script to change their current working directory. :)

The only restriction is for commands that can be launched outside a project and that are actually launched in this context (outside of any project). This is a normal behavior, as they are specifically design to be launched outside a project. :)

This is the case, for instance, for the create command in the ubuntu-project template: there is a pre-hook executed (see below) and then, we launch the template in the parent dir of the project directory. Be aware of that. :)

Hook system

Quickly supports some hooks. It enables to have some specific automation (part of code) executed before and/or after an execution of a command. They are Quickly Core builtin. Now, we just have one: pre_create, launched before any create function.

You can note that hooks aren't execute when calling the script for shell-completion and help.

pre_create creates the directory specified in the create command line and handle more complex cases like $ quickly create template folder1/folder2/projectname. Also, pre_create filters acceptable project names and populates .quickly file in the new project directory to put some generic parameters needed for Quickly Core compatibility handling.

So, if your template needs a Quickly project, you really should consider adding a create command which can be launched outside a project only. It will be a bad idea to create a project within an existing project, even if Quickly Core supports it. :)

.quickly?

This file should be located in the root project directory (it's how Quickly Core detects it, to be honest). The basic pre_create hook creates a file like that:

project = foo
template = ubuntu-project
format = 0.2.3

With that, we can store project name (which can differs with the folder case), template names, and Quickly format (corresponding to Quickly version) to handle migration.

You can add your own key/values pairs (again a convenient function is given if you develop your template in python) to help you in your template needs. The file format is the same than for quicklyconfig template file (comments, extra spaces, etc.).

tools to help you (if your template is in python)

Most of them are in quickly/templatetools and quickly/configurationhandler.

access and modify .quickly

configurationhandler is your friend for this one :)

The basic way is to import the module and load the content of the .quickly file:

from quickly import configurationhandler
if not configurationhandler.project_config:
    configurationhandler.loadConfig()

Here, we avoid to reload the configuration. You can do it if there are pending changes you want to forget. Then, you have an associated array called "project_config" and use it to retrieve some values:

print(configurationhandler.project_config['project'])

(if the key doesn't exist, it will return the usual no index found).

You can then add new values that you need in your own template by:

configurationhandler.project_config['foo']=bar

To save it, you can finally call:

configurationhandler.saveConfig()

All modifications will be stored by .quickly file within the current project.

handling easily help and shell-completion

For that, we have a handle_additional_parameters which takes function as optional parameters. Those functions should print help and handle shell_completion method. In the following examples, the functions are names "my_help" and "my_shell_completion", but that doesn't matter.

from quickly import templatetools
def my_help():
    print _("""Usage:
$ quickly change-lp-project

Enable to set or change the launchpad project binded with the current
ubuntu project.
""")
templatetools.handle_additional_parameters(sys.argv, my_help)

As you notice, some parameters are optionals. Here is the example will both functions:

def my_shell_completion():
    if len(sys.argv) == 3:
        print " ".join(get_supported_licenses())
def my_help()
     print("foo")
templatetools.handle_additional_parameters(sys.argv, help=my_help, shell_completion=my_shell_completion)
Get formated Quickly name of a project:

Very easy function to get your project name compatible with Quickly Core (this is the same one which is put in .quickly file)

from quickly import templatetools
print(templatetools.quickly_name(project_name))

An error is issued if the input is not supported currently by Quickly Core.

apply file permission to another file

This has been handy in the license command of ubuntu-project, it can interest others:

from quickly import templatetools
templatetools.apply_file_rights(fcopyright.name, fcopyright_out.name)

It applies to the second file path the permission of the first path file.

Launchpad and bzr

Disclaimer: we put support in Quickly Core itself for Launchpad and bzr, but nothing is loaded until you explicitly need it (and consequently, specify it) in your template. We will be happy to add other support from widely used system for template creator convenience. So, do not hesitate to propose your own binding.

We have some generic tools now for binding to launchpad project and creating/using credential so that template's developers don't become crazy if they want to use Launchpad in their template.

Basically, to setup launchpad credential and bind to a project (or use it afterwards), the code is:

# connect to LP (this create credential if needed, either, retrieve it)
from quickly import launchpadaccess
launchpad = launchpadaccess.initialize_lpi()

Once the user created his credential (or was connected automatically if it's not the first time it's called within Quickly), you have your launchpad python object to perform whatever you wish. It automatically targets staging if it was specified on the command line or by environment variable. It also setup bzr whoami if it was not done before.

All the "first configuration" step is done only once in Quickly: the credential is shared within every templates.

# get the project (choose and bind to one if not already done)
project = launchpadaccess.get_project(launchpad)

With that code, once connected to Launchpad, you will bind your project to a launchpad project. It will ask the user (the first time it's launched within a project) to what existing project he wishes to be bound, make a search with the string provided and propose some candidates to him. When done, you can play with the "project" python object in your template!

Staging stuff is also supported without any extra work. If you really need to know if you are on staging server, you can launch: ///launchpadaccess.lp_server/// (it can be "staging" or "edge"). No need to parse environment variable. :)

verbose mode

It's really easy to figure out if you are in verbose mode or not (specified by the user by environment variable or by using command line option):

from quickly import templatetools
if templatetools.in_verbose_mode():

in_verbose_mode() will be True of False, it's self-explanatory!

Well, Quickly Core is not so tiny as we can infer at first glance and a lot is covered under the hood too. It's not only a dummy command line parser as we are used to present it for simplicity, but you have been able to see that it has some advanced function as well.

Next week, we will see the first created template for Quickly. You already know some part of this one as I took it a lot of times as an example: yes it's the one called ubuntu-project! Back again to the user wave. :)

mercredi 16 septembre 2009

Build your application quickly with Quickly: Inside Quickly part 5

That will be the last part for user on the Quickly Core itself. Before jumping on the ubuntu-project description road, we will see miscellaneous stuff that I couldn't classified later.

Miscellaneous

Well, Quickly options are quite sparse for the moment (as we don't need more as of today), so, here are what can be useful for you:

Help

$ quickly --help

Of course, as the man page, this will give you the most important information you will certainly need :)

Version

$ quickly --version
Quickly 0.2.3
  Python interpreter: /usr/bin/python 2.6.2
  Python standard library: /usr/lib/python2.6
  
  Quickly used library: /usr/lib/python2.6/dist-packages/quickly
  Quickly data path: /usr/share/quickly/data
  Quickly detected template directories:
          /home/didrocks/quickly-templates
          /usr/share/quickly/data/templates/

Copyright 2009 Canonical Ltd.
  #Author 2009 Rick Spencer
  #Author 2009 Didier Roche
https://launchpad.net/quickly

quickly comes with ABSOLUTELY NO WARRANTY. quickly is free software, and
you may use, modify and redistribute it under the terms of the GNU
General Public License version 3 or later.

This one is very important: it gives you some internal and useful informations like Quickly version, python version, what paths for library are used by Quickly, template paths. Well, it's a good idea for every bug report to add those information. We are currently working on an apport hook to integrate it each time Quickly crashes.

Verbose mode

quickly --verbose <command>

This enables Quickly to be more verbose. It's pretty limited at this time, but will be developed later (for instance, we remove current glade warning about unknown icons). Verbose mode switch back default behavior. It will be neat if we will integrate more verbose debugging and verbose informations (planned for 0.4 release).

If you want to use verbose mode for more than one command without specifying each time a --verbose option, you can export QUICKLY variable and set it to verbose like this:

export QUICKLY=verbose

Then, all commands will be executed in verbose mode.

Specific values like staging launchpad server

Using --staging switch enables you to execute all related Launchpad stuff without reaching the real Launchpad server, but staging one instead. This is more focused on testing and is dedicated to specific command that needs Launchpad (share and release command, for instance, in ubuntu-project template). In a similar way, we can add support to other "staging" or equivalent system with that command.

As for verbose, you can export an environment variable to avoid specifying --staging in each command:

export QUICKLY=staging

But I want to use both of them

Don't panic! You can of course, add the two options like in every command line, but you still can export a QUICKLY environment variable. The field separator is ":" (as in PATH), so just add the two strings separated by it, like in:

export QUICKLY=verbose:staging

This will enable us to extend those functionalities in the near future if the Core or some templates needs it. We don't want to add too many clutter in environment variables, that's why we have only choosen QUICKLY environment variable and use IFS to separate values. Of course, that's only if you have a long suit of commands using this option, otherwise, using the corresponding option is a lot easier. All those values can be retrieved by templates: it's easier if you use a python based template, but it's transposed in environment variable whatever what was used (option or environment variable). We will detail that in next chapter.

Ok, that's it for the user side of Quickly Core. But I'm sure you have now an idea of an awesome template and you are eager to create it. You probably miss some information on that. Consequently, in next session, we will see how to create our own template. This will finish the Quickly Core tour itself. :)

lundi 14 septembre 2009

Build your application quickly with Quickly: Inside Quickly part 4

Yeah! It's already the 4th zoom of your Quickly trip and it's about shell completion.

Complete everything quickly

Quickly has an advanced shell completion tool. Currently, it's only binded to bash but plans are up to catch other shells (it's very easy, just call quickly shell-completion $0 from a script and perform little black magic to know the context).

You can reread part 2 if you want to understand every cases described below. Ensure as well you have Quickly 0.2.3.

After installation

Once Quickly is set up, you have to launch a new bash to get the bash completion working. This hasn't some workaround and it's the same with other tool (bzr, quilt...)

Ok, let's try a basic example:

Outside any project

quickly [Tab][Tab]
awesome commands    create      getstarted  help        quickly     tutorial

-> We get there all builtin and template commands which can be launched outside a project.

Here, commands, getstarted, help and quickly are builtin commands. Create and tutorial are ubuntu-project template commands.

Now, let's try a basic builtin command:
$ quickly commands [Tab][Tab]
<file list of my current folder>

Ok, that means that we have no parameter to specify or that the commands command don't support more advanced completion.

Testing a template command which can be launched outside a project:
$ quickly tutorial [Tab][Tab]
footemplate               ubuntu-project

This is because the tutorial command is (in my personal installation) present in two templates, so as this command can be launched outside a template, you need to specify a template.

Then, picking one template:

$ quickly tutorial ubuntu-project [Tab][Tab]
<file list of my current folder>

That means that tutorial command doesn't have advanced shell completion either

Note that you can also do:

$ quickly --template ubuntu-project tutorial [Tab][Tab]
<file list of my current folder>

This time, as you have already defined a template, Quickly Core won't bother you to propose a template after the tutorial command.

Advanced!

You should understand why this doesn't display more commands:

quickly -t ubuntu-project [Tab][Tab]
commands    create      getstarted  help        quickly     tutorial

What's the difference with the first example? There is no awesome command[1]! It only lists builtin and ubuntu-project commands that can be launched outside a project. So, awesome command is certainly from another template than ubuntu-project in this case.

Inside a project

Common case

Let's give it a try:

$ quickly [Tab][Tab]
change-lp-project  getstarted         package            save
commands           glade              quickly            share
dialog             help               release            tutorial
edit               license            run

The list is made from builtin and associated template (here ubuntu-project template) command that can be launched inside the project (for instance, the create command is not listed).

From another template

As for help and launching a command, I can see commands from others templates, being in the same directory, that I can launch:

$ quickly -t footemplate [Tab][Tab]
commandfoo  getstarted  package     run
commands    help        quickly     tutorial

Here, I get builtin and footemplate commands that I can launch inside a project. Easy!

Advanced completion

As previously said, some commands can have advanced completion.

Command defined

They can defined it themselves (apart from the template part and command which is automatically handled by Quickly Core).

For instance, the license command from ubuntu-project defines an advanced (optional) parameters which is the license, Using shell-completion enable to discover every available licenses supported by ubuntu-project template:

Inside a project:

$ quickly license [Tab][Tab]
BSD     GPL-2   GPL-3   LGPL-2  LGPL-3

Command followed by command (headaches inside)

Do you remember part 2? I discussed about attributes on commands and we see before command followed by templates. There are also commands followed by another command. As of today, only the help builtin command has this attribute. But remember: help command is also a command followed by a template. Seems to be an interested case for testing shell completion behavior, isn't?

Outside a project
$ quickly help [Tab][Tab]
commands        help            toto
getstarted      quickly         ubuntu-project

help completion propose you with what you can get some help:

  • directly builtin commands which can be launched outside any project
  • available templates (for later completion)
$ quickly help ubuntu-project [Tab][Tab]
change-lp-project  edit               license            run
commands           getstarted         package            save
create             glade              quickly            share
dialog             help               release            tutorial

Here you get help on all builtins and commands from ubuntu-project template (as see in previous part for the help command)!

For bonus point:

$ quickly -t ubuntu-project help [Tab][Tab]
change-lp-project  edit               license            run
commands           getstarted         package            save
create             glade              quickly            share
dialog             help               release            tutorial

Same thing than previously, but using the -t option.

Inside a project

In this cas, help command completion will behave as expected after reading last chapter:

$ quickly help [Tab][Tab]
change-lp-project  edit               license            run
commands           getstarted         package            save
create             glade              quickly            share
dialog             help               release            tutorial

You have there all builtins and ubuntu-project template commands (given the fact that you are in a ubuntu-project "templated" project).

Bonus, for people who likes to complicate their life:

$ quickly -t footemplate help [Tab][Tab]
awesome     commands    getstarted  package     run
commandfoo  create      help        quickly     tutorial

Here, you are in a ubuntu-project "templated" project and you get help on all builtins commands and those from footemplate.

Miscellaneous

Option completion

Option benefit of course from completion:

$ quickly -[Tab][Tab]
-h          --help      --staging   -t          --template  --verbose   --version
Template completion

In addition to previous case of template completion, the -t/---template command has its own completion!

$ quickly --template [Tab][Tab]
footemplate               ubuntu-project

Good news is all of that is generically implemented in the Quickly Core itself. So, if you plan to create a Quickly template, you can get it also for free if you put right attributes to your personal commands (we will see that in a chapter 6).

Hope you will like this advanced completion setting (it gave me quite some headaches and a lot of trial/refactoring phases before getting it generically working and the code not being too ugly). Remember again that we will see how command can add to this completion their own level, as for help. :)

In next part, we will see miscellaneous things on the Quickly core itself.

Notes

[1] this does not imply that the listed command aren't awesome ;)

vendredi 11 septembre 2009

Build your application quickly with Quickly: Inside Quickly part 3

Here we go for another topic on Quickly tour! This chapter will be really fast to read compared to last one.

Getting some help with Quickly



Quickly has an builtin help command that can help you to retreive help from whenever command.

Inside a project

You can search directly help for builtin command and the ones from the associated template of your project.

template commands

In a ubuntu-project "templated" project, simply do:

$ quickly help release

to get some help from the release command of ubuntu-project template.

builtin command

$ quickly help commands

give some help on the builtin commands command.

commands from another template

As for launching commands, you can get help from other template command by:

$ quickly --template footemplate help awesome

This will print the help associated to the awesome command of the footemplate template. Nice, isn't?

Outside a project

There, you can get help from builtin command and still from template command

builtin command

As previously:

$ quickly help getstarted

template commands

From the last part, you should be able to guess what's the attribute of the help command... You got it! It's a command followed by template (but also, as I said too, a command followed by command, cf previous example)

Taking, again the example of ubuntu-project and getting some help from the release command:

$ quickly help ubuntu-project release

If you followed all the previous concepts successfully, how can I do that differently?

$ quickly -t ubuntu-project help release

got it!

$ quickly help -t ubuntu-project  release

and

$ quickly help release -t ubuntu-project

works as well!

Note that in the last case, you don't have shell-completion for the "release" field (as the template is defined after the help command)

As usual, completion is there to help you in all those cases.

All is done by the core itself, if you develop a template, you will get all those automation from Quickly Core for nothing! Great, isn't?

Next chapter will be on the shell-completion itself! It will help you to understand that the expression "all is guided through bash-completion" is not a wild dream.

NOTES:

  1. no, quickly help help as "googling google" doesn't make the world dying from entropy creation cycle.
  2. yes, quickly quickly exist. What does it do? $ quickly help quickly to know it, of course :)

mercredi 9 septembre 2009

Build your application quickly with Quickly: Inside Quickly part 2

This session is giving some fundamentals on Quickly, let's dive into them!

Two components: core and template

There is mainly two parts in Quickly: Quickly Core is a command line parser and context checker. It has builtin commands and can handle and launch template commands. Quickly templates are group of commands and files that are used on a certain purpose: you can create templates to manage your documents, a LaTeX skeleton, or to easily create projects gathering a certain number of technologies.

Consequently, using templates, you can create a project which will be binded to your templates. Templates can be written in whatever language you wish. That's the reason why we don't use optparse in Quickly Core component.

The application can be extended to run on other systems, and use different tools, etc... There is nothing stopping you from doing that. However, if you stray off the chosen path, some of the commands may no longer work for you.

We would love to see, for instance, a fedora-project template, gnome-project one, plasmoid-project, zeitgeist-plugin... and this tour will give you some trick to help you create one (in part 6).

But again, consider that you can create your template for everything, like managing your documents (without even creating any project). You can give some commands to create a new "company's set of documents" for a secretary ; he/she will complete them and then "quickly share" (for instance) for uploading it in the company's sharing documentation server. Quickly Core is not binding into developing only, power is completely given to template developers.

The ubuntu-project templates

The ubuntu-project template is the first template released today (some more coming for creating gedit plugins and ubuntu-game template).

The ubuntu-project template enables you to easily create a project using a given set of strong opinionated chosen technology ubuntu's people are mostly using:

  • Python for the language
  • pygtk for the UI framework
  • Glade for the UI editor
  • Gedit for the code editor
  • bzr for version control
  • Launchpad for code hosting
  • desktopcouch for storage/database

The idea is to make choices (as Ubuntu make choices in their default applications list) for developers wondering what technology is "good to use for...". Choosing in a technology jungle can sometimes be a mess. Nevertheless, this is just a the skeleton: nothing prevents you for removing the desktopcouch part if you don't want to use it for instance (same for other pieces of technology).

It's also easy to create your own template from ubuntu-project to remove what part you don't want (if you are found of git and don't want to use bzr, for example). More on that in next sections.

Also note, there is no Quickly runtime or base class library. Using the Ubuntu Project won't bring in any dependency on Quickly itself.

Templates, context and command management.

General

So, we have builtin and template command and you can also be inside or outside a project. All that forms a context.

A project created with the create command will be associated with the template used in the create command like in:
$ quickly create ubuntu-project foo[1]
This command can only be launched outside any Quickly project and needs a template to be specified on the command line.

Then, when you are in a project, you can launch $ quickly <command> to launch the <command> from the binded templates or Quickly builtin command. No need to specify a template.

Also, you can launch any command wherever you wish in the project hierarchy (subfolder, subsubfolder...), the command will behave the way it's designed.

Get the list of all available commands.

Nothing more easy, just run wherever you wish:

$ quickly commands
[builtins]      commands
[builtins]      getstarted
[builtins]      help
[builtins]      quickly
[ubuntu-project]        change-lp-project
[ubuntu-project]        create
[ubuntu-project]        dialog
[ubuntu-project]        edit
[ubuntu-project]        glade
[ubuntu-project]        license
[ubuntu-project]        package
[ubuntu-project]        release
[ubuntu-project]        run
[ubuntu-project]        save
[ubuntu-project]        share
[ubuntu-project]        tutorial

builtins are... builtins command and others are templates owning commands. You can even check there that commands is a builtin one.

Choosing the template

You can still launch commands from another template in your current project. Let's say you need the "awesome" command from the bar template to be launched in your current ubuntu-project "templated" project, you still can with $ quickly --template bar awesome[2]

Attributes of commands/Advanced brain breaker :)

WARNING: this part can be seen as quite tricky. It's needed if you really want to understand the template and builtin commands behavior or want to create your own template. If you don't understand/want to read it, don't desesperate and just jump into the "Ok, you killed me, what do I really need to know?" section :-)

Command attributes

As already said, some commands (templates and builtin ones) can either:

  • be launched outside a project only (case of "create" from ubuntu-project template command, for instance)
  • be launched inside a project only (case of "release" from ubuntu-project template command, for instance)
  • be launched outside or inside a project (case of "tutorial" from ubuntu-project template command, "commands" builtin command, for instance)

The check is done during command launch (and shell-completion filtering as well) to ensure user doesn't perform any mistake (as users make some mistakes sometimes, don't they? ;)). For instance, if you try to launch a command which can only be launched inside a project: didrocks@laptop:~/not_a_quickly_project$ quickly --template ubuntu-project release
ERROR: Can't find project in /home/didrocks/not_a_quickly_project.
Ensure you launch this command from a quickly project directory.
Aborting

Template command launched outside a project must be followed by a template if not specified as an option. Of course, this enables Quickly Core to know in which template to find the command. This will give:

$ quickly create ubuntu-project foo
                 ^^^^^^^^^^^^^^ ^^^
                     template  command arg

or:

$ quickly -t ubuntu-project create foo
          ^^^^^^^^^^^^^^^^^        ^^^
          template as an option  command arg

Same for tutorial command, which is an ubuntu-project command:

$ quickly tutorial ubuntu-project
                   ^^^^^^^^^^^^^^
                   template following command

or:

$ quickly -t ubuntu-project tutorial
          ^^^^^^^^^^^^^^^^^
         template as an option

Note: -t templatename can be set wherever on the command line.

As we will see in a later part, shell-completion automatically propose template commands that can be launched outside a project if you are outside a project, or inside if you are ... in a project folder. :)

As builtin commands are generalists, most of them doesn't need any template. But some have the attribute "followed by template" which will need also a template (example: 'help', 'quickly') specified on the command line.

An additional attribute we will se later is "followed by command" (case of the help command). There will be a dedicated part of the help.

Launch a template command outside a project

In case you launch a template command which is part of a template without specifying the template (either with -t option or following the command), you will have a message like that:
$ quickly tutorial
ERROR: tutorial command must be followed by a template and no template was found on the command line.
Candidates template are: footemplate, ubuntu-project
Arborting.

That means that both footemplate and ubuntu-project templates have a tutorial command and Quickly in all its kindness found them to help you. :)

So, then, you can try to launch (if quickly tutorial doesn't take any additional argument, which is the case): $ quickly tutorial footemplate or $ quickly tutorial ubuntu-project.

Ok, you killed me, what do I really need to know?

Phew, this was the harder part of Quickly's concept. Now, the following will seem to be really easy once you get this. In any case, shell-completion will only propose in the current context what you need/can launch (we will discuss that later). So, if you are lost, just let you guided by it, it will propose whenever template/command args you need to specified in the current context. :)

Only knowing what is a template and a project should be sufficient for a daily (and happy? ;)) Quickly user.

Next part will be on getting help on commands.

Notes

[1] foo can be also path/to/foo if path/to exists

[2] -t instead of --template if you are lazy :)

lundi 7 septembre 2009

Build your application quickly with Quickly: Inside Quickly part 1

Here is a suit of little blog posts regarding the Quickly application.

Quickly Logo Even if an awesome presentation by Rick Spencer has been done during last Ubuntu Developers Week, we will get there a little deeper on Quickly's technical side and possibilities. We won't enforce the tutorial side as well as there is already a rocking one in Quickly itself.

First, what is Quickly?

Taken from Launchpad:

Quickly helps you create software programs (and other things) quickly. You can select from a set of application templates and use some simple Quickly commands to create, edit code and GUI, and publish your software for others to use. Quickly's templates are easy to write. So if you are a fan of language foo, you can create a foo-project template. Or if you want to help people making plugins for your killer app, you can make a killer-app-plugin template. You can even create a template for managing corporate documents, creating your awesome LaTeX helpers The sky is the limit!

Given the richness and variety of the Linux platform, programming on Linux should be easy and fun. However, it's not easy and fun because it is too hard to learn. It is too hard to learn because there are too many choices, and too much information to wade through. Quickly strives to make programming easy and fun by bringing opinionated choices about how to write different kinds of programs to developers. Included is a Ubuntu application template for making applications that integrate smoothly into the Ubuntu software infrastructure.

GTD is easier with GTQD (Get Things Quickly Done)!

In a nutshell, creating application should be FUN and EASY.

Obligatory screenshot

Ok, I think you are eager to see a sexy screenshot of Quickly. Impatient? Here it is: Quickly Capture

Oh, didn't I mentioned that Quickly is a command line tool? :) It should be easy to integrate with existing GUIs and it should also be easy to use Quickly to create a Quickly GUI.

Get started

After installing Quickly, you can launch $ quickly getstarted to get some hints on how-to-start.

Useful links

The good new is that Quickly 0.2.2 has landed into karmic. Just give it a try! (aptitude install quickly and relaunch a bash if you want to get all the advanced shell-completion goodness we will explain later).

The Quickly tour is going to take off and hope you will enjoy the flight :)

Next session will be on basic Quickly concepts: Quickly Core and templates.

Topics of this tour:

  1. Part 1: introduction
  2. Part 2: general concepts, core and templates
  3. Part 3: getting help
  4. Part 4: shell-completion
  5. Part 5: miscellaneous core stuff
  6. Part 6: creating templates
  7. Part 7: ubuntu-project template presentation
  8. Part 8: ubuntu-project template code editing
  9. Part 9: package your app and publish it with ubuntu-project template