Beispiel #1
0
	def packdict(self, val):
		record = newrecord()
		usrf = None
		for key, value in val.items():
			if isinstance(key, (AEType, AEProp)):
				if key.code == 'pcls': # AS packs records that contain a 'class' property by coercing the packed record to that type at the end
					try:
						record = record.coerce(value.code)
					except:
						record.setparam(key.code, self.pack(value))
				else:
					record.setparam(key.code, self.pack(value))
			else:
				if not usrf:
					usrf = newlist()
				usrf.setitem(0, self.pack(key))
				usrf.setitem(0, self.pack(value))
		if usrf:
			record.setparam('usrf', usrf)
		return record
Beispiel #2
0
	def packdict(self, val):
		record = newrecord()
		usrf = None
		for key, value in val.items():
			if isinstance(key, (AEType, AEProp)):
				if key.code == 'pcls': # AS packs records that contain a 'class' property by coercing the packed record to that type at the end
					try:
						record = record.coerce(value.code)
					except:
						record.setparam(key.code, self.pack(value))
				else:
					record.setparam(key.code, self.pack(value))
			else:
				if not usrf:
					usrf = newlist()
				usrf.setitem(0, self.pack(key))
				usrf.setitem(0, self.pack(value))
		if usrf:
			record.setparam('usrf', usrf)
		return record
Beispiel #3
0
	def packlist(self, val):
		lst = newlist()
		for item in val:
			lst.setitem(0, self.pack(item))
		return lst
Beispiel #4
0
	def packlist(self, val):
		lst = newlist()
		for item in val:
			lst.setitem(0, self.pack(item))
		return lst