MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / out_of_date

Function out_of_date

lib/matplotlib/sphinxext/plot_directive.py:526–545  ·  view source on GitHub ↗

Return whether *derived* is out-of-date relative to *original* or any of the RST files included in it using the RST include directive (*includes*). *derived* and *original* are full paths, and *includes* is optionally a list of full paths which may have been included in the *origina

(original, derived, includes=None)

Source from the content-addressed store, hash-verified

524
525
526def out_of_date(original, derived, includes=None):
527 """
528 Return whether *derived* is out-of-date relative to *original* or any of
529 the RST files included in it using the RST include directive (*includes*).
530 *derived* and *original* are full paths, and *includes* is optionally a
531 list of full paths which may have been included in the *original*.
532 """
533 if not os.path.exists(derived):
534 return True
535
536 if includes is None:
537 includes = []
538 files_to_check = [original, *includes]
539
540 def out_of_date_one(original, derived_mtime):
541 return (os.path.exists(original) and
542 derived_mtime < os.stat(original).st_mtime)
543
544 derived_mtime = os.stat(derived).st_mtime
545 return any(out_of_date_one(f, derived_mtime) for f in files_to_check)
546
547
548class PlotError(RuntimeError):

Callers 1

render_figuresFunction · 0.85

Calls 1

out_of_date_oneFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…