September 9, 2009
This article was contributed by Nathan Willis
Quickly is a new utility to
simplify Linux application development by bootstrapping repetitive project
setup, user interface, packaging, and release chores. It targets both new
application developers and those who simply want to speed up recurring
tasks. Quickly is a product of the Ubuntu project, but is flexible enough
to be used in other distributions and for other types of tasks — the
real power of Quickly lies in the templates that automate different aspects
of project configuration and maintenance.
An application built using Quickly has no dependency on Quickly itself,
said developer Didier Roche, "there is no Quickly runtime or base
class library." The goal, he said, is to speed up the process for
regular developers and help new developers get past the barrier of deciding
which tools and approaches to use.
It can be difficult to get into GNU/Linux
programming as there are a whole bunch of available technologies. Let's think
about using GTK/QT, language, which library do I need? Add to this some
tools decisions like the IDE, the VCS, hosting the project, etc. Too many
choices kills the choice itself. [...] For instance, learning Debian
packaging just to create a package to share with people can be
tedious. Quickly (with ubuntu-project template) does it for
you. Consequently, opportunistic developers can focus only on precise
things and do it quickly, easily and right!
Canonical's Rick Spencer came up with the initial idea for Quickly after a
series of false starts with missing documentation — including the
deprecated tool libglade that did
not point him towards its replacement gtkbuilder
— and packaging guides that were so generalized that they provided little
concrete help:
It took me a long time and a lot of digging to put
together a set of tools for myself that worked for me. [...] This was
partly due to the fact that there was no definitive source of information,
or any credible expert. So threads in Ubuntu Forums where newcomers asked
"how do I write an app for Ubuntu" get a pile of different options, and no
way to know what is best. I very much wanted to
solve this problem, and create a pipeline that made it easy to go from
conceiving an app to have people using it.
The latest version of Quickly is 0.2.2 and is
packaged only for Ubuntu 9.10, in which it is slated to be part of the
official release. The authors note, however, that it could easily be
packaged for Ubuntu 9.04 or for other distributions. Quickly is a
command-line only tool that developers can use to execute discrete steps of
the form:
quickly command [options]
It has commands
that create a new project, start an editing session, package it, make a
public release, and so on.
Most of these commands are defined in a template tailored to a specific
scenario; running "quickly commands" will list the built-in
commands and those associated with each installed template. So far, the
only released template is ubuntu-project, which automates working with
Ubuntu-compatible code (using Bazaar
for version control, Debian packaging, and Launchpad.net Personal Package
Archives (PPA) for releases).
In addition, the ubuntu-project template makes what Roche called
"opinionated choices" for the tools and technologies used by the new
application: using Python for the language, PyGTK for the user interface, Glade for
the UI design, Gedit for the editor, and Desktop CouchDB for
(optional) data storage. Using the template's project creation routines to
start a new project, Quickly creates a subdirectory for the project and
set of skeleton files, including necessary Python and Glade files, plus
auxiliary icon and licensing files. Quickly also creates Python classes to
encapsulate basic windows and dialogs, and a separate Glade file for each
class and window. These decisions are designed to make it simple to edit
the application with Quickly, even though they might not be the design
choices other programmers would make.
Example Quickly usage
The Ubuntu wiki features a
basic tutorial on writing code with Quickly, and Roche has started
a series of blog entries to document its usage and options. On August 31,
Roche and Spencer hosted an IRC
talk during Ubuntu Developer Week that delved into further detail.
The process starts by running:
quickly create ubuntu-project myapp
Quickly then creates a
./myapp directory, and fills it
with:
bin/
Copyright
data/
myapp/
myapp.desktop.in
setup.py
The Python files are placed in myapp/myapp, and the Glade files in
myapp/data. After that, the developer must
cd into
the myapp directory. From there, quickly run will launch the
new application, quickly edit will open the key Python files
in Gedit, and quickly glade will open
the UI files with Glade. Because the focus of the ubuntu-project template
is on graphical applications, a quickly dialog command is
available to create a new dialog window and associated class in Glade and
Python.
Running quickly save will save the code to Bazaar,
quickly license some_license will add license
headers, and quickly package will calculate dependencies and
generate a .deb package. Public releases are made with
quickly share and quickly release. Both
commands require the
user to have a working account on Launchpad.net, complete with a PPA. The
difference between the two commands is that share does not assign
a version
number or allow for a change log; release automatically increments
version
numbers, although they can be overridden.
Quickly design: core and templates
At its core, Roche explained, the quickly tool itself is
essentially a
parser and command processor. It checks context (for example, whether the
working directory is a Quickly project directory), provides command
completion, help, and a few low-level hooks, but most of the logic resides in
the templates. Templates are written in Python, and although there is no
documentation for template writing available yet, interested parties can
browse the code used in the ubuntu-project template, which is installed by
the package at /usr/share/quickly/templates/ubuntu-project.
Roche said that the Quickly team decided to separate as much of the
"intelligence" as possible from the quickly core in order to make it more
useful. "If anyone wants to make templates for other platforms, we
would gladly merge those into our project," he said, perhaps
separating Quickly templates into its own subproject from Quickly Core.
"We would love to see, for instance, a fedora-project template,
gnome-project one, plasmoid-project, [or a] zeitgeist-plugin."
Quickly even makes it simple to duplicate an existing template in order
to customize it; the built-in command:
quickly quickly template
creates a duplicate. The user can then modify the
new template for use with other editors, other version control systems, or
make more substantial changes without starting from scratch. "If
someone likes the ubuntu-project template but doesn't agree on, let's say,
couchdb but prefers gconf, he is able to create his own template based on
ubuntu-project with $ quickly quickly ubuntu-project
ubuntu-project-with-gconf and then hack in
~/quickly-templates/ubuntu-project-with-gconf/ to tweak what interests
him," said Roche.
Quickly's core/template separation means that it is not limited to
standalone GUI Linux application development. As the project's Launchpad page states, developers
could easily create a template to kick-start creation of a conforming
plugin for a specific application, for working with rendering systems like
LaTeX, or for non-coding
projects like documentation tasks.
As additional templates are written by Quickly users, Roche said, the
team will coordinate with template authors to see what shared functionality
deserves to be rolled up into built-in commands. Regardless of the task,
some operations like file upload are generic enough for reuse. Quickly's
Launchpad access is one such example; it began as part of the
ubuntu-project template, but is now accessible to other template authors
through Quickly's core — abstracting sign-in, reconnections, and
other tasks.
Quickly in practice
Quickly is on track to ship
with Ubuntu "Karmic Koala" 9.10, though Spencer said he does not know of
any official Karmic applications written with Quickly. A few developers
have started using the package to build small applications; Jono Bacon blogged
about his use of Quickly while working on a tool for managing Amazon Kindle
content, and Bryce Harrington has started
developing a GUI front-end to Quickly — using Quickly itself.
Roche said that the near-term plans for the ubuntu-project template
include adding some important features like GPG and SSH key creation for
use with package signing and Launchpad upload. The team is also interested
in adding new templates, including an ubuntu-game template that
incorporates PyGame, and a
gedit-plugin template that would demonstrate Quickly's applicability for
application-specific plugin project development.
In the long term, Roche said that Quickly should be able to scale up to
large projects in addition to the modest single-developer examples shown so
far. It already supports concurrent Bazaar access, but the ubuntu-project
template does not support Launchpad's "teams" collaboration feature because
it is not accessible via the Launchpadlib library. Nevertheless, he said,
the Quickly team is actively working on the issue and hopes to be able to
tackle it in the future.
An early review
of Quickly at Ars Technica compared it to Rails, which also uses a command-line to
automate set-up for non-command-line projects. Readers responded that it
also bears similarity to Django
and Maven project creation, but it
may be a first for desktop applications. Although, as Roche said, nothing
about Quickly's core or its templating system limit it to desktop
application development. Any repetitive task could be sped up by being
adapted into a Quickly template; which templates the world sees depends
entirely on who picks up Quickly and experiments with it.
(
Log in to post comments)