Adobe AIR 2 example: UDP sockets with PyAMF and Twisted

January 19th, 2010

The upcoming release of Adobe AIR will provide support for UDP sockets, allowing you to send and receive messages using the Universal Datagram Protocol (UDP).

We created an example, using Adobe AIR 2.0 and the PyAMF and Twisted libraries for Python, that echoes ByteArray messages every x seconds to a Twisted UDP server. The example application also enumerates available hardware and software network interfaces on the client computer using the new NetworkInfo API.

Read more in the tutorial.

screenshot of the example

PyAMF 0.5 released

September 8th, 2009

PyAMF is a lightweight library that allows Flash Player and Python applications to communicate via Adobe’s ActionScript Message Format.

PyAMF 0.5 is a cleanup of the internals of 0.4 and it provides some performance optimizations. In accomplishing this, a number of features were added.

Read the rest of this entry »

Running a PyAMF WSGI server in Apache Ant using Jython

July 20th, 2009

Apache Ant is a Java-based build tool. Ant build files are created using XML but it also support Python scripts using Jython.

There are 2 ways to execute Python scripts in Ant:

JSR-223 enables dynamic languages to be callable via Java in a seamless manner. Unfortunately this is currently only supported with Jython 2.2.1 and not the latest 2.5.0. Since PyAMF only supports Jython 2.5 or newer, you have to use the PythonInterpreter class directly. This style of embedding code is very similar to making use of a scripting engine, but it has the advantage of working with Jython 2.5.

Here you see the gateway running in Ant:

Buildfile: build.xml

clean:

compile:
[mkdir] Created dir: build/classes
[javac] Compiling 1 source file to build/classes

jar:
[mkdir] Created dir: build/jar
[jar] Building jar: build/jar/HelloWorld.jar

run:
[java] *sys-package-mgr*: processing new jar, 'build/jar/HelloWorld.jar'
[java] Running AMF gateway on http://localhost:8000


Read the complete howto, including a sample server/client, on http://docs.pyamf.org/dev/tutorials/jython/ant.html.

Using PyAMF with Apache Tomcat

July 13th, 2009

Today a new tutorial was added that shows you how to deploy your PyAMF applications with Apache Tomcat and modjy. modjy is an implementation of a WSGI compliant gateway/server for Jython, built on Java/J2EE servlets. This allows you to run Jython WSGI applications inside a Java/J2EE servlet container, e.g. Apache Tomcat. modjy is part of the Jython project.

Tomcat PyAMF

PyAMF server/client using Jython with Swing

May 20th, 2009

Now that the upcoming Jython 2.5 is getting closer to it’s final release, I thought it would be nice to create an example that shows PyAMF running on top of Jython. Jython is an implementation of the high-level, dynamic, object-oriented language Python written in 100% Pure Java, and seamlessly integrates with the Java platform. It thus allows you to run Python scripts on any Java platform.

Below you see a screenshot of the example, which was created using Java’s native Swing UI toolkit. It allows you to start a simple AMF server on localhost:8000 and embeds an AMF client that makes calls to that server. This particular example doesn’t interact with an Adobe Flash Player application, it simply shows it’s possible to run PyAMF servers and clients on top of the upcoming Jython release.

Screenshot of Jython/PyAMF example


You can browse or download the source from the Subversion repository. You can find instructions on how to run the example yourself on the wiki page.

PyAMF 0.4.2 released

April 24th, 2009

The team is proud to announce the release of PyAMF 0.4.2!

PyAMF is a lightweight library that allows Flash and Python applications to communicate via Adobe’s ActionScript Message Format.

This is a bugfix release, see the changelog for the complete list of changes. A brief overview of the changes:

  • Support for decoding the ’source’ property on ArrayCollection (Ticket:488)
  • Fixed an issue in the GAE adapter where dynamic properties would be missing on referenced objects (Ticket:511)
  • Fixed a critical issue with AMF0 reference counting when encoding remoting responses (Ticket:510)
  • Strengthened HTTP header handling in the client (Ticket:492)
  • Support for Django i18n ugettext_lazy (Ticket:496)
  • Support for microseconds for datetime objects (Ticket:490)
  • Support for property types on SQLAlchemy mapped classes (Ticket:491)
  • Support for property types for Google AppEngine db.Model and db.Expando. (Ticket:487)

Check out the download page, installation instructions or the API documentation for more information. Questions? First stop is the mailing list but we also hang out on IRC.

SQLAlchemy and Flash: Addressbook example

March 16th, 2009

SQLAlchemy logo

Dave Thompson created a new address book example that uses the new SQLAlchemy adapter that was added in the latest release of PyAMF. PyAMF provides Action Message Format (AMF) support for Python, mainly used in the Adobe Flash Player for RPC communication.


Get Adobe Flash player



You can browse or download the source from the Subversion repository. You can find instructions on how to run the example yourself on the documentation page.

PyAMF 0.4.1 released

February 25th, 2009

The team is proud to announce the release of PyAMF 0.4.1!

PyAMF is a lightweight library that allows Flash and Python applications to communicate via Adobe’s ActionScript Message Format.

This is a bugfix release, see the changelog for the complete list of changes. A brief overview of the changes:

  • amf0.Encoder.use_amf3 has been extended to cover all object types (Ticket:453, Ticket:467)
  • Encoding {0:0, ‘0′:1} will now raise an AttributeError (Ticket:458)
  • Improvements to the Google App Engine adapter – see ticket for details (Ticket:479)
  • Unicode handling in __repr__ functions has been improved (Ticket:455)
  • Django models.TimeField, models.DateField will now be converted to the correct type (datetime.time and datetime.date respectively). fields.NOT_PROVIDED is also checked for by converting to pyamf.Undefined and back again. (Ticket:457)

Check out the download page, installation instructions or the API documentation for more information. Questions? First stop is the mailing list but we also hang out on IRC.

PyAMF 0.4 released

January 18th, 2009

The team is proud to announce the release of PyAMF 0.4 final!

PyAMF is a lightweight library that allows Flash and Python applications to communicate via Adobe’s ActionScript Message Format.

This release fixes over a 100 tickets, see the changelog for the complete list of changes. We now consider the library to be stable and ready for production! A brief overview of the changes:

  • A new C extension to pyamf.util and pyamf.amf3. This is a work in progress, created using Cython, and more sections of the library will be moved to C as they are identified. Thanks to Gerard Escalante.
  • An adapter for SQLAlchemy 0.4/0.5 is available, allowing object graphs to be easily encoded. See the wiki for more information. Thanks to Dave Thompson and Michael Van Tellingen.
  • Improvements to the Google App Engine adapter to allow datastore objects to be easily encoded/decoded.

Check out the download page, installation instructions or the API documentation for more information. Questions? First stop is the mailing list but we also hang out on IRC.

PyAMF 0.4rc3 released

January 14th, 2009

The PyAMF team is proud to announce a new release of PyAMF, a lightweight library that allows Flash and Python applications to communicate via Adobe’s ActionScript Message Format.

This is hopefully the last Release Candidate before we release 0.4 final. Changes since rc2 include:

  • Support for SQLAlchemy 0.5.0 (Ticket:436)
  • pyamf.util.DataTypeMixIn/cpyamf.util.BufferedByteStream can now encode/decode 24bit un/signed integers. (Ticket:422)
  • pyamf.util.StringIOProxy/cpyamf.util.BufferedByteStream both have new consume methods that will chop of the tail of the stream (already read stream). (Ticket:423)
  • Now checking for all types of supported xml lib types for encoding, but will only use the first implementation for decoding (Ticket:426)
  • fpconst dependancy is now only required if the platform requires it (Ticket:356)
  • Decoding negative timestamps on certain platforms (namely Windows) are now supported (Ticket:390)

For a detailed list of changes, see the change log.

To download this release either grab a compressed file, use ‘easy_install -U pyamf’ or grab the Subversion tag.

Check out the download page, installation instructions or the API documentation for more information. Questions? First stop is the mailing list but we also hang out on IRC.

Cheers,

The PyAMF team