]> git.phdru.name Git - phdru.name/phdru.name.git/blobdiff - make-changed.py
Feat(reindex_blog.py): Расширить описание
[phdru.name/phdru.name.git] / make-changed.py
index 31443aac84b7035ae93e743f1bc45914db9a12ff..80af0896b452163264867cb920018da9688b47e4 100755 (executable)
@@ -1,22 +1,22 @@
-#! /usr/bin/env python
+#! /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)