Dev Week -- Introduction to Quickly -- mterry -- Wed, Aug 29th, 2012

   1 [15:01] <mterry> Hello!
   2 [15:01] <mterry> My name is Michael Terry, and I'm a maintainer of Quickly
   3 [15:02] <mterry> I usually give introduction to Quickly talks during App Developer Week, but I'm also doing one this week, let me know in ubuntu-classroom-chat if you'd like things to be more toward the technical details of Quickly or not
   4 [15:02] <mterry> So I'll start with a quick overview of Quickly and where we are now, what our plans are for 12.10 and 13.04
   5 [15:02] <mterry> So Quickly is at core a way to get started developing very quickly
   6 [15:03] <mterry> And not have to worry too much about packaging or how to get your app into Ubuntu
   7 [15:03] <mterry> We make some opinionated choices (like Python, GTK+) that Ubuntu recommends, so that we can offer a better experience
   8 [15:03] <mterry> But there are plenty of other "templates" that Quickly offers to do other things (like HTML5 or flash)
   9 [15:04] <mterry> So why use Quickly or get involved with Quickly?
  10 [15:04] <mterry> Well, I guess the reason to use it is for the above -- if you don't care about packaging and just want to get started  :)
  11 [15:04] <mterry> If you're interested in contributing to Quickly, ask questions in the chat room and I can answer and explain
  12 [15:05] <mterry> Always things to do, and we just started planning a bunch of work for 13.04
  13 [15:05] <mterry> So, in 12.04, there are three templates: the normal Python+GTK one, a command line interface one, and a flash game one
  14 [15:05] <mterry> There are also HTML5, Qt, Qt Quick, and a Unity Lens ones maintained by the community
  15 [15:06] <ClassBot> eklok asked: can you work with Quickly via terminal and GUI?
  16 [15:06] <mterry> Right now, it's designed to be used via the terminal only
  17 [15:06] <mterry> But Michael Hall worked on a GTK frontend for it
  18 [15:06] <mterry> quickly-gtk I believe
  19 [15:06] <mterry>
  20 [15:07] <ClassBot> skizobass asked: Can you use Eclipse, PyDev for write a Python App with Quickly and then publish in the Software Center?
  21 [15:07] <mterry> Yes and no
  22 [15:07] <mterry> So we don't have integration with Eclipse or PyDev as such
  23 [15:07] <mterry> But you could write such an app and stick it inside of a Quickly project with a small amount of work, I believe
  24 [15:08] <mterry> What Quickly gives you is a skeleton project
  25 [15:08] <mterry> And if you threw away some of the code it gives you and stick yours in, you'd get most of the benefits of Quickly that way
  26 [15:08] <ClassBot> ben72 asked: in 12.04 quickly is the package to get right?
  27 [15:09] <mterry> Yes
  28 [15:09] <ClassBot> FlowRiser asked: What is the current workflow of Quickly ?
  29 [15:09] <mterry> So let's say you want to start a project
  30 [15:09] <mterry> You open a Terminal
  31 [15:09] <mterry> You run "quickly create ubuntu-application test-project"
  32 [15:10] <mterry> The ubuntu-application part there is choosing which template to use.
  33 [15:10] <mterry> In our case, we want the default-ubuntu-recommendation, which is Python+GTK
  34 [15:10] <mterry> Then, it will create a skeleton project and launch it
  35 [15:10] <mterry> Close it out, "cd test-project", and you're sitting in your new project
  36 [15:11] <mterry> You can now edit your code with "quickly edit" or package it with "quickly package".  I'll get to these commands in a bit
  37 [15:11] <ClassBot> skizobass asked: Can you write and organize the code (classes, packages, etc) like Eclipse in Quickly?
  38 [15:11] <mterry> I'm not sure how Eclipse is organized.  Hold on
  39 [15:11] <mterry> The default skeleton gives you one directory/Python-module for your code
  40 [15:12] <mterry> And also one Python module that it owns with boilerplate code
  41 [15:12] <mterry> You put all your code in your module and Quickly's wrapper will call into it
  42 [15:12] <mterry> So, as above, if you wanted to import an existing project into Quickly, you would replace that one module with your code
  43 [15:13] <mterry> But as far as classes go, yes, Python and Quickly both encourage one-class-per-file
  44 [15:13] <mterry> But you can do anything you want.  It's not as strictly enforced as, say, Java
  45 [15:13] <ClassBot> nja asked: Will you be covering some Python in this session?
  46 [15:13] <mterry> I hadn't planned to, no.  I think there are better resources than me for that
  47 === irfan_ is now known as van
  48 [15:14] <mterry> OK, there are no more questions, so I'll start diving into using Quickly more
  49 [15:14] <mterry> Before I forget, Quickly also has a built-in tutorial
  50 [15:14] <mterry> If you don't want to listen to me blather
  51 [15:14] <mterry> Run "quickly tutorial" in your project directory
  52 [15:15] <mterry> But let's continue with my blathering
  53 [15:15] <ClassBot> FlowRiser asked: I see that most of the languages you use require no compiling of the code; is there any chance we'll see a Cpp and GTK template?
  54 [15:15] <mterry> That's certainly a possibility
  55 [15:15] <mterry> But not something we've done yet
  56 [15:15] <mterry> Quickly's template system lets someone write such a template easily
  57 [15:15] <mterry> It just hasn't been done
  58 [15:15] <mterry> We had some progress on a Vala template, which is compiled
  59 [15:16] <mterry> But we've found in general, new users prefer non-compiled languages like HTML or Python
  60 [15:16] <ClassBot> peaceisin asked: For using quickly, one need to know how to program in python?
  61 [15:16] <mterry> Yes, at least for the default recommended template
  62 [15:16] <mterry> Actually, for all the shipped templates.
  63 [15:16] <mterry> But again, that's not necessarily true in the future
  64 [15:17] <mterry> But is now
  65 [15:17] <ClassBot> coalitians asked: Quickly is in python?
  66 [15:17] <mterry> Yes.  Both the skeleton project and Quickly itself
  67 [15:17] <ClassBot> BebopSteve asked: On "quickly edit," is there anything special about that?  Or can you just use a text editor of your choice
  68 [15:17] <mterry> You can use the editor of your choice.  You can set either EDITOR or QUICKLY_EDITOR environment variables to change it
  69 [15:17] <ClassBot> NickE asked: Does Quickly support Python 3 development?
  70 [15:17] <mterry> Not yet
  71 [15:18] <mterry> We want to support it, but it's looking like that will happen for 13.04
  72 [15:18] <ClassBot> chilicuil asked: does quickly support all data bases?, or do I need to use libraries?
  73 [15:18] <mterry> For that, you don't need special Quickly support
  74 [15:18] <mterry> Just import the appropriate Python modules and go crazy
  75 [15:19] <mterry> Quickly doesn't limit your choices of how you write your app.  It's just a wrapper around it, to provide some integration support into Ubuntu
  76 [15:19] <mterry> OK
  77 [15:19] <mterry> So another useful command to change your app, is "quickly design"
  78 [15:19] <mterry> Which will bring up Glade, a GUI editor
  79 [15:19] <mterry> How to use Glade is a whole 'nother talk, but it tries to be a point-and-click interface builder
  80 === thotp_ is now known as thotp
  81 [15:20] <mterry> It helps to understand GTK a bit when using it
  82 [15:20] <mterry> But the basic idea is that you can make new widgets in the pane on the left, place them in the middle, and adjust properties of widgets in the bottom right
  83 [15:20] <ClassBot> chilicuil asked: Quickly is intent to produce desktop apps or Web ones?
  84 [15:20] <mterry> Right now, desktop apps
  85 [15:21] <mterry> We do have an HTML5 template in the community bundle that kind of blurs that a bit
  86 [15:21] <mterry> But it
  87 [15:21] <mterry> But it's still designed for the desktop (runs Python underneath)
  88 [15:21] <ClassBot> green7 asked: Do we need to know GTK to use Quickly?
  89 [15:21] <mterry> Yes, for the default template
  90 [15:22] <mterry> Like for Glade
  91 === Unknown12290 is now known as waa3
  92 [15:22] <ClassBot> nja asked: Where would you recommend we learn Python?
  93 [15:22] <mterry> Dive Into Python is very good
  94 [15:22] <mterry>
  95 [15:23] <mterry> OK
  96 [15:23] <mterry> So let's say you're comfortable with Glade and have made some changes (and we can come back to it)
  97 [15:23] <mterry> If you want to see what your project looks like now, run "quickly run"
  98 [15:24] <mterry> Which will load all your edited files and show you the current project state
  99 [15:24] <mterry> One neat trick Quickly does is that when you add a widget, you frequently want to respond to user events on it
 100 [15:24] <mterry> Like clicks or whatever
 101 [15:24] <mterry> So Quickly makes it easy
 102 [15:25] <mterry> If you add a widget named button1
 103 [15:25] <mterry> You can just write a method in your window class called on_button1_clicked(self, widget, data=None)
 104 [15:25] <mterry> And do what you need there
 105 [15:25] <mterry> Quickly will notice that and hook up the widget to your method
 106 [15:25] <mterry> You need to use the on_WIDGETNAME_SIGNALNAME format
 107 [15:26] <mterry> And the signature will change depending on the signal type
 108 [15:26] <mterry> See the GTK documentation for details on a given signal
 109 [15:26] <ClassBot> green7 asked: Is there a difference between packaging and quickly run?
 110 [15:26] <mterry> Yes
 111 [15:26] <mterry> So quickly run is just a quick spot-check
 112 [15:26] <mterry> It runs all the files from where they are in your project directory
 113 [15:27] <mterry> But quickly package actually creates a Debian package file
 114 [15:27] <mterry> Which you can install into your system if you're root
 115 [15:27] <mterry> So let's say we ran 'quickly package' on our test-project program
 116 [15:27] <mterry> It would give us a file like ../test-project_0.1_all.deb
 117 [15:27] <mterry> We could then run "sudo dpkg -i ../test-project_0.1_all.deb" and install our new program
 118 [15:28] <mterry> You'd see it show up in the dash and everything
 119 === yofel_ is now known as yofel
 120 [15:28] <mterry> Before you seriously start packaging your app though, it's best to fill out some of the information in the '' file
 121 [15:28] <mterry> Like homepage and author
 122 [15:28] <mterry> And to run "quickly license" to specify what the license of your program is
 123 [15:29] <mterry> Because that's all important information before you start distributing it to other people
 124 [15:29] <mterry> So let me talk about packaging a bit
 125 [15:29] <mterry> Let's say we think this default app is amazing
 126 [15:29] <mterry> And we want to distribute it to some friends
 127 [15:30] <mterry> Well, first, you should test it locally with quickly package
 128 [15:30] <mterry> Make sure that it installs fine
 129 [15:30] <mterry> But if you want to share with a wider community, you might want to set up a PPA
 130 [15:30] <mterry> Launchpad lets you have your own PPA where you can put packages and people can download them as you update the PPA
 131 [15:31] <mterry> Let's say you've done that already (I can go into details if desired)
 132 [15:31] <mterry> You'll also need GPG keys set up
 133 [15:31] <mterry> And SSH keys
 134 [15:31] <mterry> Launchpad has documentation on this
 135 [15:31] <mterry>
 136 [15:32] <mterry>
 137 [15:32] <mterry> But OK, let's say we've got our PPA set up
 138 [15:32] <mterry> Then running "quickly share --ppa mterry/testing" will package up our project and upload it to my (mterry's) 'testing' PPA
 139 [15:33] <mterry> quickly share will use a testing version like 0.1public1
 140 [15:33] <mterry> Not a nice version
 141 [15:33] <mterry> But it's because quickly share is best for uploading in-progress versions for wider testing
 142 [15:33] <mterry> When you are ready to release for real, use "quickly release"
 143 [15:33] <mterry> This will put it in a PPA but update the version to something nice like 12.08
 144 [15:34] <mterry> Let me pause for questions
 145 [15:34] <ClassBot> nja asked: What Python editor would you recommend?
 146 [15:34] <mterry> I'm a luddite and like just simple gedit
 147 [15:34] <mterry> So I may not be the best person to ask
 148 === marius is now known as Guest7295
 149 [15:34] <mterry> I'm not even sure what other people would recommend
 150 [15:34] <mterry> Chat room can help out I bet
 151 [15:35] <mterry> OK, so I quickly covered share and release
 152 [15:35] <mterry> Which are the two ways Quickly offers to share your project around via a PPA
 153 [15:35] <mterry> But let's say you've finished really polishing your app and it's great now
 154 [15:36] <mterry> You want to get it into the Ubuntu Software Center
 155 [15:36] <mterry> Then you can use "quickly submitubuntu"
 156 [15:36] <mterry> Which will also upload into a PPA
 157 [15:36] <mterry> But will make various packaging changes that are required for Ubuntu Extras packages
 158 [15:37] <mterry> If you want to test such changes locally, you can also run "quickly package --extras" to get a local Debian package file that also has those changes
 159 [15:37] <mterry> (basically, it puts your application inside /opt instead of sprinkled around the filesystem like in /usr/bin and /usr/share)
 160 [15:37] <ClassBot> green7 asked: Is Quickly recommended over usual PyGTK programming?
 161 [15:37] <mterry> For an app that you want to share with other Ubuntu users, yes
 162 [15:38] <mterry> But Quickly is really just a shell around usual PyGTK programming
 163 [15:38] <mterry> It helps with packaging and integration, and a little bit of magic like I mentioned between Glade and your code
 164 [15:38] <ClassBot> ironhalik asked: What's the backward compatibility situation like with Quickly and users using older Ubuntu releases? Are there any issues?
 165 [15:39] <mterry> Should be small
 166 [15:39] <mterry> Quickly injects a bit of code into your app (in, e.g., the test_project_lib/ folder)
 167 [15:39] <mterry> So that will stay constant as you backport your app to older releases
 168 [15:39] <mterry> The only thing that might cause problems is dependencies
 169 [15:40] <mterry> So if you depend on a newer version of a package, or a package that didn't exist in older releases, obviously that's going to be a problem
 170 [15:40] <mterry> But I believe Quickly itself should work well into the past.  12.04's version uses gobject-introspection for it's GTK/Python bindings
 171 [15:41] <mterry> I don't know how far that goes back.  Like, I bet it doesn't work well in 10.04
 172 [15:41] <mterry> But it should for 11.10 at least
 173 [15:41] <ClassBot> gigix asked: Does Quickly binds your app strictlty to Ubuntu
 174 [15:41] <mterry> No.  Not your app itself.
 175 [15:41] <mterry> It offers different ways of making your life in Ubuntu easier
 176 [15:41] <mterry> Like making a Debian package file and uploading to PPAs
 177 [15:42] <mterry> But your code itself should not require Ubuntu features
 178 [15:42] <ClassBot> FlowRiser asked: What are some good GTK resources ?
 179 [15:42] <mterry> has some
 180 [15:42] <mterry> is an API overview
 181 [15:43] <mterry> And has some
 182 [15:43] <ClassBot> marcosb asked: Ruby template is on schedule?
 183 [15:43] <mterry> Nope
 184 [15:43] <mterry> :-/
 185 [15:43] <mterry> I don't know who's working on one
 186 [15:43] <mterry> But it's not on my radar
 187 [15:44] <ClassBot> ben72 asked: is there a way to make quickly work with python 3 manually even though it's not supported? Yesterday we learned python 3 is the way to go for new applications. :)
 188 [15:44] <mterry> Good question
 189 [15:44] <mterry> Quickly is unfortunately lagging here
 190 [15:44] <mterry> I agree Python3 is the way to go
 191 [15:44] <mterry> But we couldn't get all our features working with it in time.  Notably, the packaging of your app
 192 [15:45] <mterry> So you can certainly start a new Quickly app
 193 [15:45] <mterry> And then port it to Python
 194 [15:45] <mterry> 3
 195 [15:45] <mterry> (Should be real simple)
 196 [15:45] <mterry> But
 197 [15:45] <mterry> You'll lose the ability to run "quickly package", share, release, or submitubuntu
 198 [15:45] <mterry> :(
 199 [15:46] <mterry> But you can take the Python2 packaging that Quickly would give you
 200 [15:46] <mterry> (if you run quickly package before porting to Python 3)
 201 [15:46] <mterry> Then modify the debian/ directory to work with Python 3 yourself
 202 [15:46] <mterry> Then don't run "quickly package" youself...
 203 [15:47] <mterry> You'll at least have the benefit of not having to start from scratch
 204 [15:47] <mterry> Quickly can give you all the Python2 packaging and code and you can update to work with Python3
 205 [15:47] <mterry> You just can't use Quickly's packaging support going forward
 206 [15:47] <mterry> :(
 207 [15:47] <mterry> OK
 208 [15:48] <mterry> Quickly has a few other neat features
 209 [15:48] <mterry> Like "quickly save"
 210 [15:48] <mterry> Which will save all your changes into a version control system called bzr (bazaar)
 211 [15:48] <mterry> Kind of like checkpointing your code after a set of related changes
 212 [15:48] <mterry> You can use bzr directly (like "bzr diff") to see your current changes and such
 213 [15:49] <mterry> bzr is great, and it integrates with Launchpad.  Like you can do "bzr push lp:~mterry/+junk/test-project"
 214 [15:49] <mterry> To push all your code into Launchpad (under my account -- obviously change for your account)
 215 [15:50] <mterry> +junk is just a trick Launchpad has to let you upload without having to choose a project
 216 [15:50] <mterry> If you've registered your project in Launchpad, you can use it's name instead
 217 [15:50] <mterry> But anyway, that's all Launchpad stuff, not Quickly stuff!
 218 [15:50] <mterry> Just wanted to mention quickly save
 219 [15:50] <ClassBot> There are 10 minutes remaining in the current session.
 220 [15:50] <mterry> Another neat trick is "quickly add dialog new-dialog"
 221 [15:51] <mterry> Let's say you want to add a save dialog or error dialog or something like that.  A common enough operation that Quickly gives a little help
 222 [15:51] <mterry> It will create the code for you and add it to Glade (but you have to close Glade and relaunch with "quickly design")
 223 [15:51] <mterry> And run "quickly edit" again to open up the new files
 224 [15:51] <mterry> You'll see your new dialog in code and in Glade
 225 [15:52] <mterry> Then just import it in your main window with "from project_name.DialogName import DialogName"
 226 [15:52] <mterry> And instantiate it with "d = DialogName()"
 227 [15:52] <mterry> You can use "quickly help" to see all the commands available and help for individual commands too
 228 [15:52] <mterry> Like "quickly help save"
 229 [15:52] <ClassBot> skizobass asked: When you create a new dialog with Quickly. How you separated the script from the main script?
 230 [15:53] <mterry> Quickly will create a new python file in (e.g.) test_project/
 231 [15:53] <mterry> So if you ran "quickly add dialog hello"
 232 [15:53] <mterry> It will create a test_project/ file
 233 [15:53] <mterry> (I think I got that name right)
 234 [15:53] <ClassBot> nja asked: Is there anything like .toString() in Python?
 235 [15:53] <mterry> Yes
 236 [15:54] <mterry> str()
 237 [15:54] <mterry> so let's say I have an object
 238 [15:54] <mterry> o
 239 [15:54] <mterry> I do str(o)
 240 [15:54] <mterry> to get a string
 241 [15:54] <ClassBot> skizobass asked: Quickly separate the code automatically for each dialog ?
 242 [15:54] <mterry> Yes, if you use the "quickly add dialog" command
 243 [15:54] <mterry> You don't have to do that yourself
 244 [15:54] <mterry> You can organize your code all you want when you write it
 245 [15:54] <mterry> But when Quickly makes them, that's what it does
 246 [15:55] <mterry> OK, I only have a few minutes left
 247 [15:55] <mterry> I know this was a little scattered, but hopefully you have a better idea what Quickly is
 248 [15:55] <mterry> And why you might want to use it
 249 [15:55] <ClassBot> There are 5 minutes remaining in the current session.
 250 [15:56] <mterry> Again, I recommend "quickly help" and "quickly tutorial" for exploring on your own
 251 [15:56] <mterry> And has some neat things you can do
 252 [15:56] <mterry> As does all of
 253 === norbi is now known as Guest81889
 254 [15:57] <mterry> Seems like no more questions.  Thanks everyone!
 255 [15:58] <ClassBot> nja asked: In python, is it possible to have the same constructor with different arguments?
 256 [15:58] <mterry> Yes and no
 257 [15:58] <mterry> You'd use the same method
 258 [15:59] <mterry> But you can have optional arguments like __init__(option1=None, option2=None)

MeetingLogs/devweek1208/IntroductionQuickly (last edited 2012-08-30 10:19:17 by dholbach)