MCPcopy Index your code
hub / github.com/microsoft/SandDance / recursive_mtime

Function recursive_mtime

python/jupyter-widget/setupbase.py:302–315  ·  view source on GitHub ↗

Gets the newest/oldest mtime for all files in a directory.

(path, newest=True)

Source from the content-addressed store, hash-verified

300
301
302def recursive_mtime(path, newest=True):
303 """Gets the newest/oldest mtime for all files in a directory."""
304 if os.path.isfile(path):
305 return mtime(path)
306 current_extreme = None
307 for dirname, dirnames, filenames in os.walk(path, topdown=False):
308 for filename in filenames:
309 mt = mtime(pjoin(dirname, filename))
310 if newest: # Put outside of loop?
311 if mt >= (current_extreme or mt):
312 current_extreme = mt
313 elif mt <= (current_extreme or mt):
314 current_extreme = mt
315 return current_extreme
316
317
318def mtime(path):

Callers 1

is_staleFunction · 0.85

Calls 1

mtimeFunction · 0.85

Tested by

no test coverage detected