12.08
Here are notes for the "Introduction to Quickly" Ubuntu Developer Week talk on 2012-08-28.
Intro
Usually we talk about Quickly as an App Developer talk, but Didier (driver of the Quickly reboot) asked me to give a bit of a talk about where we're going and how to get involved.
I can also talk about using Quickly, if people are interested. Feel free to ask such questions.
What is Quickly?
- A way to get up and running quickly
- Boiler plate
- Opinionated choices
- Package an app for users
- Easy and fun
Why get involved?
Quickly is the officially recommended tool for getting started (see http://developer.ubuntu.com/get-started/)
- Help many developers bring their ideas into the software center
Used by several peripheral Ubuntu apps like Ubuntu Accomplishments: https://wiki.ubuntu.com/Accomplishments
Quickly in Ubuntu 12.04
- Three shipped templates: ubuntu-application, ubuntu-cli, ubuntu-flash-game
- GTK+ 3 and Python 2 based
Quickly in Ubuntu 12.10
- Will more forcibly update code in bin/ and *_lib/ which are Quickly-owned
- Cleaner ARB support
Quickly in Ubuntu 13.04
This is the much-blogged-about reboot: https://wiki.ubuntu.com/Quickly/Reboot
- Likely no debian/ directory
- New default templates: GTK, HTML5, Lens
- Move flash and cli templates to community package
Use bake build system: https://launchpad.net/bake
Use pkgme for debian/ packaging: https://launchpad.net/pkgme
- Python 3
- Easier to create/customize templates via inheritance
Templates
- Built in ones
- GTK/Python
- CLI
- Flash Game
Community ones: https://launchpad.net/quickly-community-templates
- HTML5
- Qt
- Qt Quick
- Unity Lens
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
- $ cd app-name
Tutorial
- $ quickly tutorial
- Runs you through some sample modifications and commands, but just note it for later. We'll move on
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
- 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
Editing the Code
- $ quickly edit
- Code files opened in gedit
Testing changes
- $ quickly run
- Runs your project, with all your changes
Saving changes
- $ quickly save [comment]
- Uses bzr to save a checkpoint. Use actual bzr for anything fancier, like reverting.
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
Print statements
- Most common and easiest
- Leaves print statements in code, need to be deleted
Logging
logging.debug('things are working')
- Won't cause debug output to be printed in normal run
Packaging
- For sharing apps via email or dropping a file somewhere
- Quite forgiving
Setting up your app for packaging
- Add your name and email to the AUTHORS file
- $ quickly license BSD # if needed, GPL-3 by default
Edit *.desktop.in to define category (http://standards.freedesktop.org/menu-spec/latest/apa.html)
- Add author, email, description, long description to setup.py
Creating a deb
- $ quickly package
- Try it out
PPAs
- A bit less forgiving than package
Create SSH keys as per Launchpad instructions (https://help.launchpad.net/YourAccount/CreatingAnSSHKeyPair)
Create PGP keys as per Launchpad instructions (https://help.launchpad.net/YourAccount/ImportingYourPGPKey)
- set DEBEMAIL and DEBFULLNAME in .bashrc, the same as what was in your GPG key
- match gpg --list-secret-keys
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/12.08 (last edited 2012-08-24 20:07:43 by c-66-30-117-196)