comparison piecrust/data/assetor.py @ 870:48d25fd68b8d

assets: Fix bug in assetor.
author Ludovic Chabant <ludovic@chabant.com>
date Mon, 12 Jun 2017 22:30:06 -0700
parents 757fba54bfd3
children 504ddb370df8
comparison
equal deleted inserted replaced
869:41b0c94f9833 870:48d25fd68b8d
33 self._cache_list = None 33 self._cache_list = None
34 34
35 def __getattr__(self, name): 35 def __getattr__(self, name):
36 try: 36 try:
37 self._cacheAssets() 37 self._cacheAssets()
38 return self._cache[name].uri 38 return self._cache_map[name].uri
39 except KeyError: 39 except KeyError:
40 raise AttributeError() 40 raise AttributeError()
41 41
42 def __getitem__(self, i): 42 def __getitem__(self, i):
43 self._cacheAssets() 43 self._cacheAssets()
47 self._cacheAssets() 47 self._cacheAssets()
48 return len(self._cache_list) 48 return len(self._cache_list)
49 49
50 def _debugRenderAssetNames(self): 50 def _debugRenderAssetNames(self):
51 self._cacheAssets() 51 self._cacheAssets()
52 return list(self._cache.keys()) 52 return list(self._cache_map.keys())
53 53
54 def _cacheAssets(self): 54 def _cacheAssets(self):
55 if self._cache_map is not None: 55 if self._cache_map is not None:
56 return 56 return
57 57