Quickly

Differences between revisions 10 and 11
Revision 10 as of 2009-06-09 09:49:22
Size: 11042
Editor: 91
Comment:
Revision 11 as of 2009-06-09 12:41:34
Size: 12307
Editor: 91
Comment:
Deletions are marked like this. Additions are marked like this.
Line 64: Line 64:
== Template detection == == Templates rule detection ==
Line 84: Line 84:
Some commands do not rely on .quickly file. Some builtins commands do not rely on .quickly file (quickly new, quickly quickly)
Line 97: Line 97:
qiuckly.py is essentially a simple command line parser. When receiving a command it follows the following steps:
 1. Check if the command is "new". If so, try to use the specified template.
 1. If the command is not "new", it looks in the template specified in the .quickly file (or the template specified by the -t option) for a python script that matches the name.
 1. If the command is not found in the specified template, then quickly.py looks in a canonical commands directory.
quickly.py is essentially a simple command line parser. The general structure of a quickly call is: '''quickly <command>'''


When receiving a command it follows the following steps:
 1. Check if the command is a builtins one using no existing project ("new", "quickly"). If so, try to use the specified template.
 1. If not, it looks in the template specified by the -t option for a python script that matches the name.
 1. If no command is found, it looks in the .quickly file (if exists) and get the template where to look for a command.
 1. If the command is not found in the specified template, then quickly.py looks in a canonical commands directory ("builtins").
Line 103: Line 107:
Remember that hooks in "builtins" directory are executed before and after the commands, if this is found.
Line 105: Line 111:


 * The general structure of a quickly call is:
  * quickly <command>
 This will search first for a template command (the template name is looked in the .quickly file)
'''IN PROGRESS'''
Also, even if you are in a project binded to "ubuntu-project", you can execute a "release" command from another template using in the project folder : '''quickly -t kubuntu-project release''' instead of '''quickly release'''


=== Special command like new and quickly ===
quickly new enables to create a new project. The idea is to simplify the command line for it and '''quickly new ubuntu-project foo''' is far easier than '''quickly -t ubuntu-project new foo'''. The latter is still valid, but user will prefer quickly new <template_name> <project_name>

Same with '''quickly quickly''', which duplicate a template to another directory with a new name. '''quickly quickly ubuntu-project foo-template''' will copy "ubuntu-project" in '''~/.quickly/templates/foo-template'''
Line 113: Line 120:
'''IN PROGRESS'''
Line 115: Line 121:
 1. New project
 1. Create deb
 * New project: '''quickly new ubuntu-project foo'''.

This create the .quickly file in a new foo/ directory with "template=ubuntu-project\nproject=foo" (this hook is in pre_new), then new setup a basic pygtk/glade python project.

This init a bzr repository and commit a first state.

/!\ No Launchpad action is done yet.

 * Save: '''quickly save'''
Line 120: Line 134:

* IN PROGRESS *

Summary

Quickly will offer a set of commands that can be issued by a developer to:

  1. Quickly get a new project started
  2. Quickly create a deb package
  3. Quickly upload or update a package to a PPA

The first project template will be ubuntu-project. The system will be simple to extend by adding to a template or creating new templates.

Release Note

Quickly is new in 9.10. Quickly makes it easy for developers to make new applications for Ubuntu, and to share those application with other Ubuntu users.

Rationale

It is currently very difficult for developers to get started building applications that work with Ubuntu. There is ample documentation on how to contribute to ubuntu itself, but there is no prescriptive guidance on how to best build an application for Ubuntu. The forums and other sources provide lists of many different options, but there is no trustworthy authority.

Once a program is written, it is quite difficult to get it to end users. Programmers can create debs and use PPAs, but these are technically complex operations, with confusing guidance and multiple choices.

Quickly strives to solve this problem by:

  1. Creating a canonical project that makes opinionated choices for the developer in terms of what tools to use, and how to use them.
  2. Make creating a deb very easy.
  3. Make creating a PPA very easy.

User stories

Betty wants to create a simple application to track pencil usage in her office, where they all use Ubuntu on their desktops. She runs the command "quickly new ubuntu-project pencils". This creates a stub project, including pointers to documentation, etc... She write the application using python and pygtk.

She uses the command "quickly deb". This creates a deb package for her, she tries it out and it works.

So she uses "quickly ppa". This prompts her to create a launchpad account. After which, the project is loaded into her PPA. Her colleagues then use the ppa to load the pencils app onto their computer.

She gets a feature request, and adds the feature. She increments the version number, and runs quickly ppa again. Her users get an updated copy through update-manager.

Assumptions

Toolkit and Language for ubuntu-project

The core template will be "ubuntu-project".

  1. python is the language
  2. pygtk is the framework
  3. glade-3 is the UI editor
  4. gtkbuilder is the binding library
  5. classes encapsulate windows and dialogs (rather than inherit)

Dependencies

  1. The ubuntu-project template should understand automagic python build system conventions and lay out projects in a compatible manner.
  2. Launchpad PPAs must be understood and effectively scripted.

Design

The primary design mantra of Quickly is that everything should be Fun and Easy.

  1. Convention over configuration
  2. Minimal and simple configuration files
  3. Tool agnostic (we are not building or integrating into an IDE)
  4. Reward every action with progress
  5. Make next steps visible

How a Template Works

A template is a set of commands and related content that is designed to set up a project from scratch for the user, as well as potentially containing commands for enhancing and changing the project. It is essentially a directory with a set of python scripts and supporting files that lives in quickly/templates.

The only required command is "new". The new command should create a directory for the user with the necessary files for a functioning program that can be extended and enhanced. It should also create a ".quickly" file that contains the name of the template. This is used by the quickly.py script.

Templates rule detection

  • Template are looked for in those directories:
  • ~/.quickly/templates/
  • <quickly binariy>/templates/

  • /usr/share/quickly/templates/

Implementation

  1. Implement the ubuntu-project template
  2. Implement new window command
  3. Implement new dialog command
  4. quickly command directing script
  5. wrap automagic python build script
  6. wrap ppa script
  7. create tutorial

.quickly file

  • This file is create by pre_new() (see further) in a project directory. The general form is foo = bar

It can have commentaries with # following one instruction or in this own line. Parsing it and adding/changing one value must not change the general layout of it.

Some builtins commands do not rely on .quickly file (quickly new, quickly quickly)

Commands

General behavior

  • There are two type of commands: builtins and template commands.
  • Builtins commands are provided in builtins/commands.py.
  • Template commands are provided in <template_path>/<template_name>/<command>.py All commands can have hooks in builtins/commands.py, for instance foo() can have pre_foo() and/or post_foo().

On exemple is pre_new() command that will create the project folder and generate the .quickly file before the new() command is called.

The Quickly Script

quickly.py is essentially a simple command line parser. The general structure of a quickly call is: quickly <command>

When receiving a command it follows the following steps:

  1. Check if the command is a builtins one using no existing project ("new", "quickly"). If so, try to use the specified template.
  2. If not, it looks in the template specified by the -t option for a python script that matches the name.
  3. If no command is found, it looks in the .quickly file (if exists) and get the template where to look for a command.
  4. If the command is not found in the specified template, then quickly.py looks in a canonical commands directory ("builtins").
  5. If the command is still not found, quickly.py returns an error.

Remember that hooks in "builtins" directory are executed before and after the commands, if this is found.

quickly.py, therefore, has no inherent knowledge of specific templates or commands, and should, therefore, be quite easy to change and extend.

Also, even if you are in a project binded to "ubuntu-project", you can execute a "release" command from another template using in the project folder : quickly -t kubuntu-project release instead of quickly release

Special command like new and quickly

quickly new enables to create a new project. The idea is to simplify the command line for it and quickly new ubuntu-project foo is far easier than quickly -t ubuntu-project new foo. The latter is still valid, but user will prefer quickly new <template_name> <project_name>

Same with quickly quickly, which duplicate a template to another directory with a new name. quickly quickly ubuntu-project foo-template will copy "ubuntu-project" in ~/.quickly/templates/foo-template

Ubuntu-projects commands

Required

  • New project: quickly new ubuntu-project foo.

This create the .quickly file in a new foo/ directory with "template=ubuntu-project\nproject=foo" (this hook is in pre_new), then new setup a basic pygtk/glade python project.

This init a bzr repository and commit a first state.

Warning /!\ No Launchpad action is done yet.

  • Save: quickly save

  • Create PPA
  • New Window
  • New Dialog

* IN PROGRESS *

Nice to Have

  1. New Widget
  2. Save Snapshot
  3. Stub Events
  4. Other Project Templates

Other Templates

Only the ubuntu-project template is required for Karmic. However, the following templates would be nice.

pyGame

Quickly get started creating a game with pygame.

gedit plugin

Quickly get started with a new menu and/or pane in gedit. This would be great for programmers building their own tools.

quickly quickly

Quickly generate the skeleton of a quickly template. This should jump start quickly template contributions, and help ensure they use the proper heuristics, etc...

Test/Demo Plan

Quickly should spread via a comprehensive, but short, tutorial.

Unresolved issues

BoF agenda and discussion

ubuntu-project commands proposition

As said above, ubuntu-project relies on bzr + LP + ppa. But it should avoid technical terms in commands. So, I propose those commands :

  • new -> create the project and the first bzr commit. Do not ask for LP yet (or we will get tons of dummy empty project). The commiter's name will be "bzr whoami" result.

  • save -> create a snapshot using bzr (commit). Still no binding with LP. The commiter's name will be "bzr whoami" result.

  • set-ubuntu-version <ubuntu_version> -> setup the default ubuntu version we aimed for. The default is the result of "lsb_release -cs"

  • release <revision> -> commit, tag and "bzr push" to LP. Ask for deb creation in a ppa.

If the LP project is not created when releasing the first version, try to ask user/password, then bind to LP, create the project and retrieve the real user name from launchpad to change "bzr whoami" if this one is still the default.

UDS NOTES

automagic python build system is under development as a separate project by pitti.

Pitti's BoF notes: lool: private PPAs? pitti: once LP supports it, it's easy; however, you can put a .deb on your company web server; PPAs are for "easy discovery" use case lool: right, so we need a non-PPA release method, outputting a .deb for instance

KDE support can be added with "quickly new kubuntu-project" (just a matter of adding templates)

  • use KAppTemplate

new functionality: quickly release -> bzr add new files, commit, tag as new release, update changelogs, upload to PPA (if configured)

promotion:

  • have a registry of quickly-based projects (code samples!)
  • update wiki instruction to point it out as easiest option
  • look at integration with ubuntu-dev-tools
  • install by default
  • add to github?
  • gedit is default editor -> provide access to quickly through menu

===== end of pitti's notes -- slightly updated by lool :-P ==== =====begin ken's notes========== Opportunistic programmer, generally different mindset than the systematic programmer

What is a opportunistic programmer?

  • Hobbyists
  • Creates simple quick applications
  • Iterate rapidly
  • Professionals
    • technical directors on movies
    • in-house tools written for very limited user-base

Application Layer Cake

  • How do end users find my app? - discovery and installation
  • How do I get my app to end users? - packaging
  • What language, APIs, editor, etc should I use? - Tools and APIs

iPhone has a great implementation, SDK to the app store

For ubuntu it is far more complex

  • Lots of choice in frameworks, editors, databases, etc
  • Confusing to learn how to package and distribute your application
  • Not easy for users to discovery your application (out of scope for quickly)

Current plans

  • Quickly - opinionated choice of frameworks, language, and coding style
    • python/pygtk
    • template driven
    • Uses the automagic python build
      • automagically creates simple deb packaging for python apps

Examples

  • iFlush
  • Pencil ordering app

Everything in quickly must be fun and easy

  • instant reward

Functions

  • new project
  • create deb
  • create ppa
  • add new window
  • add new dialog

Nice to have

  • add widget
  • save snapshot (perhaps commit/push a bzr branch)
  • stub events
  • other project templates
  • create a release, tarball, bzr tag, upload to ppa

How do we convice people that this is the way to create applications?

  • prominate link to "how to get started developing"
  • prove the ease of use, if Quickly is the easiest and fastest, it will win

Look at github for social ideas, but that is probably more of a github vs. launchpad discussion

Override default plugin perhaps make quickly a gedit plugin

What about Kubuntu?

  • integration with kapptemplate maybe?

=====end ken's notes==========


CategorySpec

DesktopTeam/Specs/Karmic/Quickly (last edited 2009-09-25 21:04:08 by 97-126-110-78)