Check if the directory path exists for a given file. For example, for a file /home/user/.cache/mycli/log, check if /home/user/.cache/mycli exists. :param str path: The file path. :return: Whether or not the directory path exists.
(path: str)
| 98 | |
| 99 | |
| 100 | def dir_path_exists(path: str) -> bool: |
| 101 | """Check if the directory path exists for a given file. |
| 102 | |
| 103 | For example, for a file /home/user/.cache/mycli/log, check if |
| 104 | /home/user/.cache/mycli exists. |
| 105 | |
| 106 | :param str path: The file path. |
| 107 | :return: Whether or not the directory path exists. |
| 108 | |
| 109 | """ |
| 110 | return os.path.exists(os.path.dirname(path)) |
| 111 | |
| 112 | |
| 113 | def guess_socket_location() -> str | None: |
no outgoing calls
no test coverage detected