Support writing int and float items to a plist.

They are written as normal string items, so anything using the plist later
on will need to know the context, but at least now there's no need to first
convert int or float data to strings before writing a plist.
This commit is contained in:
Bill Currie 2012-08-31 16:10:30 +09:00
parent 2b55687aa5
commit 43abf8e3df

View file

@ -242,6 +242,8 @@ class pldata:
self.data.append('>')
elif type(item) == str:
self.write_string(item)
elif type(item) in [int, float]:
self.write_string(str(item))
else:
raise PListError(0, "unsupported type")
def write(self, item):