(self, prog)
| 140 | return self._current_option |
| 141 | |
| 142 | def find_man_pages(self, prog): |
| 143 | logger.info("looking up %r in store", prog) |
| 144 | |
| 145 | if self._anchored or not self._distro_preference: |
| 146 | # Already anchored to a distro, or no preference list to fall |
| 147 | # back through — strict lookup only. |
| 148 | man_pages = self.store.find_man_page( |
| 149 | prog, |
| 150 | distro=self.distro, |
| 151 | release=self.release, |
| 152 | ) |
| 153 | logger.info( |
| 154 | "found %r in store, got: %r, using %r", |
| 155 | prog, |
| 156 | man_pages, |
| 157 | man_pages[0], |
| 158 | ) |
| 159 | return man_pages |
| 160 | |
| 161 | # Try each distro in preference order; the first hit anchors all |
| 162 | # subsequent lookups to that distro. |
| 163 | for d, r in self._distro_preference: |
| 164 | try: |
| 165 | man_pages = self.store.find_man_page(prog, distro=d, release=r) |
| 166 | except errors.ProgramDoesNotExist: |
| 167 | continue |
| 168 | self.distro = d |
| 169 | self.release = r |
| 170 | self._anchored = True |
| 171 | logger.info( |
| 172 | "found %r in store, got: %r, using %r", |
| 173 | prog, |
| 174 | man_pages, |
| 175 | man_pages[0], |
| 176 | ) |
| 177 | return man_pages |
| 178 | |
| 179 | raise errors.ProgramDoesNotExist(prog) |
| 180 | |
| 181 | def unknown(self, token, start, end): |
| 182 | logger.debug("nothing to do with token %r", token) |
no test coverage detected