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

Function target_outdated

IPython/utils/path.py:330–351  ·  view source on GitHub ↗

Determine whether a target is out of date. target_outdated(target,deps) -> 1/0 deps: list of filenames which MUST exist. target: single filename which may or may not exist. If target doesn't exist or is older than any file listed in deps, return true, otherwise return false.

(target,deps)

Source from the content-addressed store, hash-verified

328
329
330def target_outdated(target,deps):
331 """Determine whether a target is out of date.
332
333 target_outdated(target,deps) -> 1/0
334
335 deps: list of filenames which MUST exist.
336 target: single filename which may or may not exist.
337
338 If target doesn't exist or is older than any file listed in deps, return
339 true, otherwise return false.
340 """
341 try:
342 target_time = os.path.getmtime(target)
343 except os.error:
344 return 1
345 for dep in deps:
346 dep_time = os.path.getmtime(dep)
347 if dep_time > target_time:
348 #print "For target",target,"Dep failed:",dep # dbg
349 #print "times (dep,tar):",dep_time,target_time # dbg
350 return 1
351 return 0
352
353
354def target_update(target,deps,cmd):

Callers 1

target_updateFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected