Search for a resource and return an absolute file path, or `None`. The :attr:`path` list is searched in order. The first match is returned. Symlinks are followed. The result is cached to speed up future lookups.
(self, name)
| 3102 | else: yield full |
| 3103 | |
| 3104 | def lookup(self, name): |
| 3105 | """ Search for a resource and return an absolute file path, or `None`. |
| 3106 | |
| 3107 | The :attr:`path` list is searched in order. The first match is |
| 3108 | returned. Symlinks are followed. The result is cached to speed up |
| 3109 | future lookups. """ |
| 3110 | if name not in self.cache or DEBUG: |
| 3111 | for path in self.path: |
| 3112 | fpath = os.path.join(path, name) |
| 3113 | if os.path.isfile(fpath): |
| 3114 | if self.cachemode in ('all', 'found'): |
| 3115 | self.cache[name] = fpath |
| 3116 | return fpath |
| 3117 | if self.cachemode == 'all': |
| 3118 | self.cache[name] = None |
| 3119 | return self.cache[name] |
| 3120 | |
| 3121 | def open(self, name, mode='r', *args, **kwargs): |
| 3122 | """ Find a resource and return a file object, or raise IOError. """ |
no outgoing calls
no test coverage detected