File: make_html.py

package info (click to toggle)
audacity 3.7.7%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 134,800 kB
  • sloc: cpp: 366,277; ansic: 198,323; lisp: 7,761; sh: 3,414; python: 1,501; xml: 1,385; perl: 854; makefile: 125
file content (17 lines) | stat: -rw-r--r-- 550 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# Takes an image file directory and makes the web page that lists them.
# They are listed in creation date/time order.

import glob
import os

def getFiles() :
    files = glob.glob("C:\\OpenSourceGit\\AudacityTeamTools\\wit-html\\auto_images\\*.png")
    files.sort(key=os.path.getmtime)
    return [ os.path.basename( name ) for name in files ]
    #print("\n".join(files))

def oneItem( name ) :
    return "<img src='./auto_images/"+name+"'><br><em>"+name+"</em><br>"

files = getFiles()
print( "\n".join( [ oneItem(name) for name in files ] ) )