Oh my, I just realized that while I was on the phone to my friend Gilles, I ASCII art doodled in TextMate!
\/\/\/\/\/\/\/\/\/\/\/\/
/ /
\ .................... \
/ . ______ . /
\ . || . \
/ . [] . /
\ . [[]] . \
/ .[:|--[[ ]]--|:]. /
\ . [[]] . \
/ . [] . /
\ . || . \
/ . ------ . /
\ .................... \
/ /
/\/\/\/\/\/\/\/\/\/\/\/
I normally doodle on paper when on the phone but, AFAIK, this is the first time I did it while using my laptop. Should I be worried? Or have I just reached a new level of geekiness? 
Shell scripts are very useful little things. Google App Engine makes deploying apps a single-line affair, but I was still finding myself going through a series of steps when deploying updates to The GAE SWF Project, mostly because I wanted to release the source code as a zip file for download. So, I hacked together a script in bash and now it's a painless process (I could probably have done the same thing using Ant, but I've also been wanting to play with bash scripts for a while now!)
Here it is, in case bits of it help you too:
#!/bin/bash
args=("$@")
if [ -z ${args[0]} -o -z ${args[1]} ]
then
echo "Usage: update <version_from> <version_to>"
exit
fi
releaseFolder="../releases/The_GAE_SWF_Project_$2"
zipFile="../releases/The_GAE_SWF_Project_$2.zip"
ftpFolder="/public_html/downloads/"
echo "THE GAE SWF Project. Updating and deploying from version $1 to $2."
if [ $1 != $2 ]
then
echo "Updating the base template with new version number..."
sed s/$1/$2/ < templates/base.html > templates/temp_base.html
mv templates/temp_base.html templates/base.html
read -p "Commit version $2 in SVN? [y/(n)] " tag
if [ $tag == "y" ]
then
echo "Commiting the new base template to Subversion..."
svn commit -m "Updated version numbers in base.html template to $2"
else
echo "Skipped commit."
fi
fi
echo "Exporting a clean version of the trunk..."
rm -rf $releaseFolder > /dev/null
svn export -q http://svn1.cvsdude.com/osflash/gaeswf/trunk $releaseFolder
# Start the server and bring it up in the browser for testing.
echo "[[[ Please test this version in the browser. Hit Ctrl-C to stop server when ready. ]]]"
$releaseFolder/start
read -p "Tag version $2 in SVN? [y/(n)] " tag
if [ $tag == "y" ]
then
echo "Tagging version $2..."
svn cp http://svn1.cvsdude.com/osflash/gaeswf/trunk http://svn1.cvsdude.com/osflash/gaeswf/tags/$2 -m "Version $2"
else
echo "Skipped tagging."
fi
read -p "Ready to deploy? [y, (n)] " deploy
if [ $deploy == "y" ]
then
echo "Zipping the source code..."
rm $zipFile > /dev/null
zip -rq $zipFile $releaseFolder
# SFTP the source file to my blog.
# Uses an expect script to achieve this.
./ftpsource $2
# Deploy the app to Google App Engine
appcfg.py update .
else
echo "Skipped deployment."
fi
# Open the remote site in Firefox.
open -a firefox http://gaeswf.appspot.com
echo "Version $2 successfully deployed."
I use a separate expect script to FTP the source zip file to aralbalkan.com:
#!/usr/bin/expect
set version [lrange $argv 0 0]
spawn sftp me@mydomain
expect "password:"
send "******\n";
expect "sftp>"
send "put ../releases/The_GAE_SWF_Project_$version.zip path/to/downloads/ \r"
expect "sftp>"
send "quit \r"
Expect is a very cool way to script interactive instances (and yeah, I didn't want to mess with SSH!)
Down and dirty scripting can be a liberating and useful experience sometimes 
I've moved the common base classes for the framework to the
actionscript folder in the root of the project. Add this folder to your class path in both Flash and Flex projects.
Note that your document class in Flash projects should extend org.gaeswf.flash.BaseApplication and your Application MXML in Flex should be of type org.gaeswf.flex.BaseApplication (if none of this makes any sense to you, see my Flex 3 Code Behind Quick Start.)
Remember that I'm constantly updating the framework and will continue to do so as we build Singularity. Expect changes!
Update: Apparently, I blogged it but didn't push it up to appspot. Doh! So instead, you get an even more updated version 1.34 now.
The new additions are currently only to the Flex client and include a public state in addition to Home (which led me to revise and generalize how I was handling the deep links back from login and logout to support apps with a mix of authenticated and non-authenticated states).
The new public state is called "Mouse wheel" and demonstrates how to make the mouse wheel work in Flash on OS X (it doesn't by default) by using Ali Rantakari's excellent ExternalMouseWheelSupport package.
Update: I just saw that the site had validation errors which I've now fixed. It validates as HTML 4.01 Strict. This is not in the 1.34 source release but will be in the next one.
Update: They're on it!

In the meanwhile, the suggested workaround is to add debug=True to your template.render() methods (pass it as the third argument, i.e., after the context).
Update: As of 2.30pm (when I last checked), the app appears to be working again. I've made no changes whatsoever.
If you hit the Flash or Flex client on The GAE SWF Project right now, you will be greeted with a page long traceback.
I've just opened issue 273 on the Google App Engine Issue Tracker to track this and added this comment on the forums.
The problem is that the error never occurs locally when developing and testing with the Development Web Server and randomly starts happening on appspot (the app will work well for stretches of time and then start failing 100% of the time.)
The last time this happened, issuing an appcfg.py update . fixed the issue but I'm not going to do that now in hopes that seeing the error will make it easier for Google's engineers to fix it.
Published on April 23, 2008
in General.
Have you checked the
Singularity Web Conference speaker line-up recently? We've been busy!
I just released version 1.33 of
The GAE SWF Project and, as tradition would have it, need to head to bed in the next few minutes lest I should expire.
The updates in a nutshell:
- The Yahoo! Astra TabBar component does not show the focusRect when navigating by keyboard. I fixed this for the example but I'm going to talk to my friends at Yahoo! so that this can be implemented in a reusable way in the component itself. See the latest Flash 9 client demo and navigate with the keyboard to see the focusRect in action.
- Added tab indexing to the Flash 9 client.
- Added an extra (optional) field to the profile page so you guys can express yourselves!
- Synced the Profile screens for the Flash and Flex clients.
- Lowered the keyboard delay on server-side validation to 500ms
- Server-side validation no longer locks the submit button on the Profile screen.
- Released version 1.33 of the source code.
Check it out here.
How cool, I just heard from Brajeshwar on Twitter that The GAE SWF Project is currently the featured application on the Google App Engine Application Gallery.
I released the proof of concept Flex 3 client late last night after the initial Flash 9 client release last week and I'm look forward to writing more about it in a future blog post.
And, far from being a theoretical exercise, the very pragmatic GAE SWF Framework is going evolve and get put through its paces as we use it to build the web application for the Singularity Web Conference. I can't wait!
Exciting times!
I just updated
The GAE SWF Project to add the
proof-of-concept Google App Engine Flex 3 client. The source code download now includes the source code for the Flex project.
The Flex client works exactly like the Flash 9 client and shares an almost identical codebase. 99% of the framework is the same.
I'm going to document that differences, etc., but it's past 1am at the moment and I need to sleep!
I just updated
The GAE SWF Project to version
1.21 1.23. New source code for the update is now available for download.
All changes in this version are server-side:
- All requests apart from those to the PyAMF gateway go through the
IndexHandler class. The app.yaml file no longer maps /examples/.* URLs to the various example SWF applications. In other words, the SWF apps are simply handler classes now, not separate WSGI applications. The PyAMF gateway remains a separate WSGI application.
- Pulled out the server-side deep linking code from the initial example to a new
BaseSWFHandler class in the new gaeswf package. The handlers for all SWF examples will extend this class and call the handleDeepLink() method to have regular deep links automatically converted to SWFAddress deep links.
- Removed the unnecessary examples and initial packages and placed all examples in the root of the examples package.
- Added 404 handling. Unknown URLs no longer fail silently.
- main.html template is now known as base.html.
- Added simple.html template for handlers that want to use base.html without the need for a separate template that extends it.
Enjoy!
Update: I've updated the online version to 1.23 to change the 404 photo. I realized this morning that the original Creative Commons-licensed photo I had found on Flickr did not belong to the user who had published it on their account.)
Recent Comments