Return location of `ais` binary if available.
()
| 139 | |
| 140 | @lru_cache(maxsize=1) |
| 141 | def ais_binary() -> str: |
| 142 | """Return location of `ais` binary if available.""" |
| 143 | path = shutil.which('ais') |
| 144 | |
| 145 | if path is not None: |
| 146 | logging.debug('Found AIS binary at %s', path) |
| 147 | return path |
| 148 | |
| 149 | # Double-check if it exists at the default path |
| 150 | default_path = '/usr/local/bin/ais' |
| 151 | if os.path.isfile(default_path): |
| 152 | logging.info('ais available at the default path: %s', default_path, mode=LogMode.ONCE) |
| 153 | return default_path |
| 154 | logging.warning( |
| 155 | f'AIS binary not found with `which ais` and at the default path {default_path}.', mode=LogMode.ONCE |
| 156 | ) |
| 157 | return None |
| 158 | |
| 159 | |
| 160 | def datastore_path_to_local_path(store_path: str) -> str: |
searching dependent graphs…