]> git.openstreetmap.org Git - chef.git/commitdiff
Import os
authorTom Hughes <tom@compton.nu>
Tue, 7 Aug 2018 20:23:02 +0000 (21:23 +0100)
committerTom Hughes <tom@compton.nu>
Tue, 7 Aug 2018 20:23:02 +0000 (21:23 +0100)
cookbooks/tile/files/default/bin/expire-tiles-single

index fa45be9eed6ec7cfd1695a72a55cdf72fd97242f..44ba93b03b5bade546a2aec069d78d5151cf46c0 100644 (file)
@@ -4,7 +4,7 @@ Expire meta tiles from a OSM change file by resetting their modified time.
 """
 
 import argparse
 """
 
 import argparse
-import os.path as ospath
+import os
 import osmium as o
 import pyproj
 
 import osmium as o
 import pyproj
 
@@ -73,15 +73,15 @@ def xyz_to_meta(x, y, z, meta_size):
         if path is None:
             path = (part + ".meta")
         else:
         if path is None:
             path = (part + ".meta")
         else:
-            path = ospath.join(part, path)
+            path = os.path.join(part, path)
 
 
-    return ospath.join(str(z), path)
+    return os.path.join(str(z), path)
 
 
 def expire_meta(meta):
     """Expire the meta tile by setting the modified time back.
     """
 
 
 def expire_meta(meta):
     """Expire the meta tile by setting the modified time back.
     """
-    if ospath.exists(meta):
+    if os.path.exists(meta):
         print("Expiring " + meta)
         os.utime(meta, (EXPIRY_TIME, EXPIRY_TIME))
 
         print("Expiring " + meta)
         os.utime(meta, (EXPIRY_TIME, EXPIRY_TIME))
 
@@ -101,7 +101,7 @@ def expire_meta_tiles(options):
             meta = xyz_to_meta(xy[0], xy[1], xy[2], options.meta_size)
 
             for tile_dir in options.tile_dir:
             meta = xyz_to_meta(xy[0], xy[1], xy[2], options.meta_size)
 
             for tile_dir in options.tile_dir:
-                meta_set.add(ospath.join(tile_dir, meta))
+                meta_set.add(os.path.join(tile_dir, meta))
 
             # add the parent into the set for the next round
             new_set.add((int(xy[0]/2), int(xy[1]/2), xy[2] - 1))
 
             # add the parent into the set for the next round
             new_set.add((int(xy[0]/2), int(xy[1]/2), xy[2] - 1))