Projects tagged ‘as3’, ‘flex’, and ‘python’


[4 total ]

0 Users

The xobj project provides an object reflector between various dynamic languages and XML. Currently, python and ActionScript 3 implementations are available. The source tree is available as a ... [More] Mercurial repository at http://hg.rpath.com/xobj/ Motivationsxobj was motivated by a few specific goals: Make the use of XML for object model interchange between client and server tiers less painful Allow your code to use real typed instances of classes rather than simple generic data structures Treat your code as the definition of schema rather than forcing an XMLSchema driven approach on your code. Read and write XML documents that will pass most XMLSchema structural validation requirements with relatively little effort on your part It is not required to provide an XML schema to use xobj. Custom objects may be used for parts or all of the document, whether or not an XML schema is provided. Schema validation is optional. If new elements show up, they will be preserved across read/write; schema additions will not normally require code changes. Implementation NotesDuring XML decoding, xobj preserves namespaces, element ordering and tracks attributes vs elements so that re-encoded object graphs can comply with most of the common XMLSchema validation requirements. This observed metadata is attached to your object graph rather than hidden out of view. For "whole cloth" generation of XML from object graphs that were not themselves decoded in the first place, you can provide the namespace, elements ordering and attribute metadata declaratively to facilitate XMLSchema conformance. During decoding, xobj uses both the runtime type information available from your classes as well as a typemap you specify to determine the target type for every decoded XML element. During encoding, xobj uses this same runtime information plus additional observed (or provided) metadata to inform the output XML. For ActionScript, xobj decodes XML documents directly into typed instance objects rather than generic Object or ObjectProxy wrappers. This avoids the double-handling of generic objects required by the default SimpleXMLDecoder provided by Adobe Flex. ExamplesFor example, using the ElementTree Python library, you might write something like this: imageItem = [ x for x in parent if x.tag='image' ] In this case, imageItem will always be a list, even if it is not defined in the XML schema to be a sequence. Using xobj, you could refer to the image element more directly: parent.image That will be either a single item or a list, depending on the context. Additionally, the image object will be of a class you specify. The unit test cases provide further examples of usage and intended semantics of the xobj methods. [Less]
Created 11 months ago.

0 Users

AS3 Package: com.python.rpc.xmlrpcThe AS3 package com.python.rpc.xmlrpc contains classes for easy access of python services provided by python's SimpleXMLRPCServer implementation. The provided ... [More] example is based upon tutorial: "Put a Flex UI on your application" by Bruce Eckel (mindview.net) published at: http://www.adobe.com/devnet/flex/articles/flex_ui.html Requires:AS3 package com.ak33m.rpc.xmlrpc.XMLRPCObject (Google code project: as3-rpclib), see http://code.google.com/p/as3-rpclib/ Contains:AS3 class PYTHONXMLRPCServerinit(host:String,port:uint):void createService(name:String,...):PYTHONXMLRPCService AS3 class PYTHONXMLRPCServiceinit(server:PYTHONXMLRPCServer,name:String,...):void apply(args:Array=null):void call(...rest):void Ease of use: See the example! +++ ActionScript code block +++ var pyServer:PYTHONXMLRPCServer=new PYTHONXMLRPCServer(); pyServer.init("127.0.0.1",9000); var pyServiceName:String="toLowerCase"; var pyService:PYTHONXMLRPCService=pyServer.createService(pyServiceName,onFault,onResult); pyService.call("Hello World!"); +++ Python code block +++ import sys from SimpleXMLRPCServer import SimpleXMLRPCServer class MyPythonServices: def toLowerCase(self, str): print "toLowerCase()"; resultStr = str.lower(); return resultStr; server = SimpleXMLRPCServer(("localhost", 9000)); print "Local python server listening on localhost port 9000." print " -> Close console window to stop the server and exit."; server.register_instance(MyPythonServices()); server.serve_forever(); [Less]
Created 12 months ago.

0 Users

A repository for our open source programming projects and the source code for online tutorials posted at our blog: http://ghostinteractive.net/blog
Created 7 months ago.

0 Users

Collection of various Seesmic API Libraries
Created about 1 year ago.