X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=make-changed.py;h=24643948d8a66d8d2b58131acb1741fbce51936f;hb=refs%2Fheads%2Fmaster;hp=86a251beb6e2dd7592e3f9b275a81e86433bd6d3;hpb=6aa7ab00b5dc30b6221d0d55fecc1b0b957cdd79;p=phdru.name%2Fphdru.name.git diff --git a/make-changed.py b/make-changed.py index 86a251b..80af089 100755 --- a/make-changed.py +++ b/make-changed.py @@ -1,22 +1,22 @@ -#! /usr/local/bin/python -O +#! /usr/bin/env python3 import sys, os -main_tmpl_mtime = os.path.getmtime("phd_pp_ru.tmpl") -main_prog_mtime = os.path.getmtime("phd_pp.py") +main_prog_mtime = os.path.getmtime("phd.py") +main_tmpl_mtime = os.path.getmtime("phd_site.tmpl") for line in sys.stdin: - line = line.strip() - src_mtime = os.path.getmtime(line) + line = line.strip() + src_mtime = os.path.getmtime(line) - dest = line.replace(".tmpl", ".html") - try: - dest_mtime = os.path.getmtime(dest) - except OSError: - make = True - else: - make = (src_mtime > dest_mtime) or \ - (main_tmpl_mtime > dest_mtime) or (main_prog_mtime > dest_mtime) + dest = line.replace(".tmpl", ".html") + try: + dest_mtime = os.path.getmtime(dest) + except OSError: + make = True + else: + make = (src_mtime > dest_mtime) or \ + (main_prog_mtime > dest_mtime) or (main_tmpl_mtime > dest_mtime) - if make: - print line + if make: + print(line)