Mercurial > boomslang
comparison pyntnclick/resources.py @ 620:38f75cef86d0 pyntnclick
Resources are files. As stipulated by $DEITY
author | Stefano Rivera <stefano@rivera.za.net> |
---|---|
date | Sat, 11 Feb 2012 21:45:16 +0200 |
parents | 1eb1537173ef |
children | 85153f422522 |
comparison
equal
deleted
inserted
replaced
619:d9d1a9c4b833 | 620:38f75cef86d0 |
---|---|
41 are skipped. | 41 are skipped. |
42 """ | 42 """ |
43 resource_name = '/'.join(resource_path_fragments) | 43 resource_name = '/'.join(resource_path_fragments) |
44 resource_name = os.path.join(*resource_name.split('/')) | 44 resource_name = os.path.join(*resource_name.split('/')) |
45 for path in self.get_paths(resource_name): | 45 for path in self.get_paths(resource_name): |
46 if os.path.exists(path): | 46 if os.path.isfile(path): |
47 return path | 47 return path |
48 raise ResourceNotFound(resource_name) | 48 raise ResourceNotFound(resource_name) |
49 | 49 |
50 def get_paths(self, resource_path): | 50 def get_paths(self, resource_path): |
51 """Get list of resource paths to search. | 51 """Get list of resource paths to search. |