Improving python wrappers?
Posted: Fri Aug 05, 2011 23:19
I would like to improve python wrappers, for example
vs
i dont have experience in this kind of stuff, so could you tell me where to start, and also do you agree with this kind of changes?
I am assuming that above method, accepts only stated variable types as arguments.
EDIT1: Proof of concept, how it can be achieved
Code: Select all
xx.setPosition(PyCEGUI.UVector2(PyCEGUI.UDim(0.5,0), PyCEGUI.UDim(0.5,0)))vs
Code: Select all
xx.setPosition( (0.5,0), (0.5,0) )i dont have experience in this kind of stuff, so could you tell me where to start, and also do you agree with this kind of changes?
I am assuming that above method, accepts only stated variable types as arguments.
EDIT1: Proof of concept, how it can be achieved
Code: Select all
from PyCEGUI import *
import PyCEGUI
def set(self, property, val):
if property == "Position":
self.setPosition(UVector2(UDim(val[0][0], val[0][1]), UDim(val[1][0], val[1][1])))
elif property == "Size":
self.setSize(UVector2(UDim(val[0][0], val[0][1]), UDim(val[1][0], val[1][1])))
else:
self.setProperty(property,val)
PyCEGUI.GUISheet.set = set