[Dev] how do I use an AssetDictionary?

James Paige Bob at HamsterRepublic.com
Fri Apr 11 10:48:14 PDT 2008


On Fri, Apr 11, 2008 at 10:44:48AM -0700, Brian Fisher wrote:
>    On Fri, Apr 11, 2008 at 9:45 AM, James Paige <Bob at hamsterrepublic.com>
>    wrote:
> 
>      Hmmm... that is how I thought it worked, but when I try it, it does
>      this:
> 
>      james at doomtrain:~/src/mhgames/marauders$ ./main.py
>      Traceback (most recent call last):
>       File \"./main.py\", line 7, in <module>
>         from map import BaseMap
>       File \"/home/james/src/mhgames/marauders/map.py\", line 24, in
>      <module>
>         class BaseMap(AssetBase):
>       File \"/home/james/src/mhgames/marauders/map.py\", line 26, in BaseMap
>         data = AssetDictionary(AssetObject(Tile))
>       File
>      \"/usr/lib/python2.5/site-packages/motherhamster/cheekpouches.py\", line
>      394, in __init__
>         assert(isinstance(element_descriptor, SimpleProperty))
>      AssertionError
> 
>    Looks like maybe a bad assert? :)
>    I can't think of a reason why AssetDictionary couldn't take AssetObject -
>    I think it reality what it can't do is take AssetRef - if any assert is
>    appropriate it's probably:
>    ---------
>    assert(not isinstance(element_descriptor, AssetRef)

I see that AssetList already has "assert(not 
isinstance(element_descriptor, AssetRef)" so I will make the change and 
try it out.

---
James



More information about the Dev mailing list