diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2018-07-24 17:51:25 +0200 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2018-07-24 17:51:25 +0200 |
commit | ee520323410a7f6982f40fe9c6631c3b936bcd2d (patch) | |
tree | 835af2ec0109ce9c021de227791777b5100e5233 /src/ee/ds/doit.py | |
parent | 894ff92c770320e264961bba55bbf0fba16efe56 (diff) | |
download | ee-python-ee520323410a7f6982f40fe9c6631c3b936bcd2d.tar.gz ee-python-ee520323410a7f6982f40fe9c6631c3b936bcd2d.tar.bz2 ee-python-ee520323410a7f6982f40fe9c6631c3b936bcd2d.tar.xz ee-python-ee520323410a7f6982f40fe9c6631c3b936bcd2d.zip |
wip.
o Renaming "fact" to "ds".
Diffstat (limited to 'src/ee/ds/doit.py')
-rw-r--r-- | src/ee/ds/doit.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/ee/ds/doit.py b/src/ee/ds/doit.py new file mode 100644 index 0000000..f922cf1 --- /dev/null +++ b/src/ee/ds/doit.py @@ -0,0 +1,14 @@ + + +def uptodate_if_isdir(path): + def do_check(): + return os.path.isdir(path) + return do_check + +def uptodate_if_older_than(dependency, *targets): + def do_check(): + dep_mtime = os.stat(dependency).st_mtime + mtimes = [os.stat(t).st_mtime for t in targets if os.path.isfile(t)] + target_mtime = max(mtimes) if mtimes else 0 + return dep_mtime < target_mtime + return do_check |