| 248 | return source.decode(self.encoding), filename, uptodate |
| 249 | |
| 250 | def list_templates(self): |
| 251 | path = self.package_path |
| 252 | if path[:2] == './': |
| 253 | path = path[2:] |
| 254 | elif path == '.': |
| 255 | path = '' |
| 256 | offset = len(path) |
| 257 | results = [] |
| 258 | def _walk(path): |
| 259 | for filename in self.provider.resource_listdir(path): |
| 260 | fullname = path + '/' + filename |
| 261 | if self.provider.resource_isdir(fullname): |
| 262 | _walk(fullname) |
| 263 | else: |
| 264 | results.append(fullname[offset:].lstrip('/')) |
| 265 | _walk(path) |
| 266 | results.sort() |
| 267 | return results |
| 268 | |
| 269 | |
| 270 | class DictLoader(BaseLoader): |