11.09

Here are notes for the "Rapid App Development with Quickly" Ubuntu App Developer Week talk on 2011-09-08.

Logs from this talk are here: http://irclogs.ubuntu.com/2011/09/08/%23ubuntu-classroom.html

  • Intro
  • Creating your app
  • Editing the UI
  • Writing Code
  • Packaging

Intro

What is Quickly?

  • https://wiki.ubuntu.com/Quickly

  • Application templating system
  • Boiler plate
  • Commands
  • Integration with infrastructure
  • Opinionated choices
  • Shell completion
  • Easy and fun

Quickly in Ubuntu 11.04

  • Version 11.04
  • Three templates: ubuntu-application, ubuntu-cli, ubuntu-flash-game, ubuntu-pygame
  • GTK+ 2 and Python 2 based

Quickly in Ubuntu 11.10

  • Bug fixes only

Installing Quickly

  • $ sudo apt-get install quickly
  • Lots of dependencies, so a slightly large download
  • Sets up lots of useful tools

Creating your app

  • $ quickly create ubuntu-application app-name
  • Creates and opens a working application

Editing the UI

  • $ quickly design
  • Code files and glade files linked by naming
  • Automatically hooked up for you

Glade Tips and Tricks

  • Selecting in the inspector
  • Layout via boxes, VBoxes and HBoxes
  • Changing position in a Box
  • pack_start, pack_end
  • Fill and expand control sizing, auto layout on window resizing
  • Border and padding control spacing
  • Use stock items when possible
  • Translator comments

Dialogs

  • Add dialogs with the "dialog" command
    • $ quickly add dialog dialog-name
    • Close, reopen Glade
    • Import the dialog

from project_name.DialogName import DialogName
  • Use DialogName()

d = DialogName()
response = d.run()
if response == gtk.RESPONSE_OK:
 #do your stuff
d.destroy()

Signals

  • In Glade, note widget name
  • For buttons, use clicked
  • For menus, use activated
  • Writing signal handlers:

def on_button1_clicked(self, widget, data=None):
    # do your stuff
    # widget is the sender

Writing Code

  • finish_initializing() versus __init__()

  • Your entry point is ProjectWindow, project_lib is subject to change

Debugging and Testing

  • Most common and easiest
  • Leaves print statements in code, need to be deleted

Logging

  • Won't cause debug output to be printed in normal run

Debugger

  • pdb is a command line debugger, works well, but is a bit hard to use

Packaging

  • For sharing apps via email or dropping a file somewhere
  • Quite forgiving

Setting up your app for packaging

Creating a deb

  • $ quickly package
  • Try it out

PPAs

export DEBEMAIL="oliver.twist@example.com"
export DEBFULLNAME="Oliver Twist"
  • Create a PPA (https://help.launchpad.net/Packaging/PPA)

  • To release, you need to create a project in Launchpad
  • $ quickly share # puts latest in your PPA
  • $ quickly release # does the same but also increments version and makes an announcement

Software Center

If you'd like to see your project in the Ubuntu Software Center, then the submitubuntu command will help you out a bit. It does a few notable things to aid application approval:

  • Creates and publishes a package to a PPA just as quickly release does

  • The package will have files installed into /opt as required
  • The package will have special metadata that is used by the Software Center (like where the screenshot lives and such)

You can create the same special package without actually publishing to a PPA (for testing and your curiosity) by using the package command:

$ quickly package --extras

See AppReviews for more information.

Quickly/AppDeveloperWeek/11.09 (last edited 2012-08-24 18:10:07 by c-66-30-117-196)