X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=make-changed.py;h=80af0896b452163264867cb920018da9688b47e4;hb=1afa1542b43c3400cdf58b66d4c7c1e7c60c2e9a;hp=24643948d8a66d8d2b58131acb1741fbce51936f;hpb=e4d529b9ee404a8ee0e4b7b1ddc2bcf338b4efcd;p=phdru.name%2Fphdru.name.git diff --git a/make-changed.py b/make-changed.py index 2464394..80af089 100755 --- a/make-changed.py +++ b/make-changed.py @@ -1,4 +1,4 @@ -#! /usr/bin/env python +#! /usr/bin/env python3 import sys, os @@ -6,17 +6,17 @@ 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_prog_mtime > dest_mtime) or (main_tmpl_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)