spice-protocol-pxvdi/python_modules
Alexander Wauck e919337980 Make spice_codegen.py work on both Python 2 and 3
This is a new version of my previous patch that does not include six.py.
It's still kind of big, but at least it's all spice-common changes now.
There are also a few other fixes that Christophe brought to my attention.
Note that six now needs to be installed on the system (python-six on
Fedora and Debian, six on PyPI).

This *should* be enough to make spice_codegen.py work on both Python 2
and Python 3.  The major changes are as follows:

 * cStringIO.StringIO -> io.StringIO
 * str vs. unicode updates (io.StringIO doesn't like str)
 * integer division
 * foo.has_key(bar) -> bar in foo
 * import internal_thing -> from . import internal_thing
 * removed from __future__ import with_statement
   (might break Python 2.5?)
 * changed some lambdas to list comprehensions (done by 2to3)
 * cast some_dict.keys() to list where needed (e.g. for sorting)
 * use normal type names with isinstance instead of types.WhateverType

Signed-off-by: Alexander Wauck <awauck@codeweavers.com>
2015-04-01 13:39:03 +02:00
..
__init__.py Initial import of spice protocol description and demarshall generator 2012-03-20 15:25:43 +01:00
codegen.py Make spice_codegen.py work on both Python 2 and 3 2015-04-01 13:39:03 +02:00
demarshal.py Make spice_codegen.py work on both Python 2 and 3 2015-04-01 13:39:03 +02:00
Makefile.am build-sys: make it a seperately buildable spice-common library 2012-03-22 20:21:05 +01:00
marshal.py Make spice_codegen.py work on both Python 2 and 3 2015-04-01 13:39:03 +02:00
ptypes.py Make spice_codegen.py work on both Python 2 and 3 2015-04-01 13:39:03 +02:00
spice_parser.py Make spice_codegen.py work on both Python 2 and 3 2015-04-01 13:39:03 +02:00