summaryrefslogtreecommitdiffstats
path: root/python_modules/ptypes.py
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2010-07-01 17:55:33 +0200
committerMarc-André Lureau <marcandre.lureau@gmail.com>2012-03-20 15:25:47 +0100
commit0ed056da99f2ee23da5600f76d5824c68918c1b5 (patch)
tree44be6dbfc6cf4f1f1fe5c1db60eef339ef9df41a /python_modules/ptypes.py
parent4a12b9c0dd555695177a017f4826557dde5fbe11 (diff)
downloadspice-protocol-0ed056da99f2ee23da5600f76d5824c68918c1b5.tar.gz
spice-protocol-0ed056da99f2ee23da5600f76d5824c68918c1b5.tar.xz
spice-protocol-0ed056da99f2ee23da5600f76d5824c68918c1b5.zip
Properly parse QXLImage to the new-world SpiceImage
SpiceImage now replaces RedImage and has all image types in it. All image data are now chunked (and as such not copied when demarshalling).
Diffstat (limited to 'python_modules/ptypes.py')
-rw-r--r--python_modules/ptypes.py31
1 files changed, 24 insertions, 7 deletions
diff --git a/python_modules/ptypes.py b/python_modules/ptypes.py
index 68cf3df..715544f 100644
--- a/python_modules/ptypes.py
+++ b/python_modules/ptypes.py
@@ -811,14 +811,31 @@ class ContainerType(Type):
return str(fixed)
def lookup_member(self, name):
+ dot = name.find('.')
+ rest = None
+ if dot >= 0:
+ rest = name[dot+1:]
+ name = name[:dot]
+
+ member = None
if self.members_by_name.has_key(name):
- return self.members_by_name[name]
- for m in self.members:
- if m.is_switch():
- member = m.lookup_case_member(name)
- if member:
- return member
- raise Exception, "No member called %s found" % name
+ member = self.members_by_name[name]
+ else:
+ for m in self.members:
+ if m.is_switch():
+ member = m.lookup_case_member(name)
+ if member != None:
+ break
+ if member != None:
+ break
+
+ if member == None:
+ raise Exception, "No member called %s found" % name
+
+ if rest != None:
+ return member.member_type.lookup_member(rest)
+
+ return member
class StructType(ContainerType):
def __init__(self, name, members, attribute_list):