def create_fakedir(outputdir, tiles):
 for (tilepath, tilemtime) in tiles.iteritems():
  dirpath = os.path.join(outputdir, *(str(x) for x in tilepath[:(-1)]))
  if (len(tilepath) == 0):
   imgname = 'base.png'
  else:
   imgname = (str(tilepath[(-1)]) + '.png')
  if (not os.path.exists(dirpath)):
   os.makedirs(dirpath)
  finalpath = os.path.join(dirpath, imgname)
  open(finalpath, 'w').close()
  os.utime(finalpath, (tilemtime, tilemtime))

def create_fakedir ( outputdir , tiles ) : for ( tilepath , tilemtime ) in tiles . iteritems ( ) : dirpath = os . path . join ( outputdir , * ( str ( x ) for x in tilepath [ : ( - 1 ) ] ) ) if ( len ( tilepath ) == 0 ) : imgname = 'base.png' else : imgname = ( str ( tilepath [ ( - 1 ) ] ) + '.png' ) if ( not os . path . exists ( dirpath ) ) : os . makedirs ( dirpath ) finalpath = os . path . join ( dirpath , imgname ) open ( finalpath , 'w' ) . close ( ) os . utime ( finalpath , ( tilemtime , tilemtime ) )
takes a base output directory and a tiles dict mapping tile paths to tile mtimes as returned by get_tile_set() .