MCPcopy Index your code
hub / github.com/SirVer/ultisnips / _get_tmp

Function _get_tmp

pythonx/UltiSnips/text_objects/shell_code.py:46–61  ·  view source on GitHub ↗

Find an executable tmp directory.

()

Source from the content-addressed store, hash-verified

44
45
46def _get_tmp():
47 """Find an executable tmp directory."""
48 userdir = Path("~").expanduser()
49 for testdir in [
50 tempfile.gettempdir(),
51 str(userdir / ".cache"),
52 str(userdir / ".tmp"),
53 str(userdir),
54 ]:
55 if (
56 not Path(testdir).exists()
57 or _run_shell_command("echo success", testdir) != "success"
58 ):
59 continue
60 return testdir
61 return ""
62
63
64class ShellCode(NoneditableTextObject):

Callers 1

__init__Method · 0.85

Calls 1

_run_shell_commandFunction · 0.85

Tested by

no test coverage detected