MCPcopy Create free account
hub / github.com/ipython/ipython / file_doesnt_endwith

Function file_doesnt_endwith

setupbase.py:46–54  ·  view source on GitHub ↗

Return true if test is a file and its name does NOT end with any of the strings listed in endings.

(test,endings)

Source from the content-addressed store, hash-verified

44# A little utility we'll need below, since glob() does NOT allow you to do
45# exclusion on multiple endings!
46def file_doesnt_endwith(test,endings):
47 """Return true if test is a file and its name does NOT end with any
48 of the strings listed in endings."""
49 if not isfile(test):
50 return False
51 for e in endings:
52 if test.endswith(e):
53 return False
54 return True
55
56#---------------------------------------------------------------------------
57# Basic project information

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected