# HG changeset patch # User phoku@33b003aa-7bff-0310-803a-e67f0ece8222 # Date 1251125243 0 # Node ID a9482d3d989e98a7aafd3558fd62d44385b603b6 # Parent fee958103d5857c2b244498cf252a0900f424c8f PyChan fixes: * DummyImage is gone for good. * Renamed GuiImage.source annotation used in PyChan. * Fixed a bug in an error path. diff -r fee958103d58 -r a9482d3d989e engine/extensions/pychan/properties.py --- a/engine/extensions/pychan/properties.py Mon Aug 24 14:41:52 2009 +0000 +++ b/engine/extensions/pychan/properties.py Mon Aug 24 14:47:23 2009 +0000 @@ -91,14 +91,14 @@ # we just let the NotFound exception trickle here. # depedning on complains we can catch and print a warning. image_info["image"] = get_manager().loadImage(image) - image_info["image"]._source = image + image_info["image"].source = image self._getSetter(obj)(image_info["image"]) elif isinstance(image,fife.GuiImage): # FIXME - this trickery with the hidden annotation # with an _source attribute isn't really clean. # Is it even necessary - image_info["source"] = getattr(image,"_source","") + image_info["source"] = getattr(image,"source","") image_info["image"] = image if image_info["source"]: image_info["image"] = get_manager().loadImage(image) @@ -106,7 +106,7 @@ else: attribute_name = "%s.%s" % (obj.__class__.__name__,self.name) error_message = "%s only accepts GuiImage and python strings, not '%s'" - raise RuntimeError(error_message % (attribute_name, repr(source))) + raise RuntimeError(error_message % (attribute_name, repr(image))) setattr(obj, self.prop_name, image_info) @@ -115,5 +115,6 @@ image = d.get("image",None) if not image: image = fife.GuiImage() + image.source = "" return image diff -r fee958103d58 -r a9482d3d989e engine/extensions/pychan/widgets/common.py --- a/engine/extensions/pychan/widgets/common.py Mon Aug 24 14:41:52 2009 +0000 +++ b/engine/extensions/pychan/widgets/common.py Mon Aug 24 14:47:23 2009 +0000 @@ -69,6 +69,3 @@ from layout import LayoutBase return isinstance(widget,LayoutBase) -class DummyImage(object): - def getWidth(self): return 0 - def getHeight(self): return 0