From 23dd853a34fbb640c1e34fa4db4c64ffeb03d9f2 Mon Sep 17 00:00:00 2001 From: James Crook Date: Sun, 18 Feb 2018 12:32:11 +0000 Subject: [PATCH] Add make html script. --- scripts/piped-work/docimages_oddments.py | 5 ++++- scripts/piped-work/make_html.py | 17 +++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 scripts/piped-work/make_html.py diff --git a/scripts/piped-work/docimages_oddments.py b/scripts/piped-work/docimages_oddments.py index b9fe41f5a..05809c5c1 100644 --- a/scripts/piped-work/docimages_oddments.py +++ b/scripts/piped-work/docimages_oddments.py @@ -60,6 +60,7 @@ def oddments_imagesA(): capture( name + "Tool.png" , 'Tools' ); #A track is needed for the buttons to be active. loadMonoTracks(1) + do( 'SetPreference: Name="/GUI/Theme" Value="high-contrast"') for id in range( 11000, 11006 ): do( "Drag: Id="+str( id) + " FromX=10 FromY=10" ) capture( "Button" + str(id) +"Hover.png", "Transport" ) @@ -72,6 +73,7 @@ def oddments_imagesA(): do( "Drag: Id="+str( id) + " FromX=10 FromY=10" ) capture( "Button" + str(id) +"Hover.png", "Edit" ) do( "Drag: Id="+str( id) + " FromX=1000 FromY=10" ) + do( 'SetPreference: Name="/GUI/Theme" Value="light"') def oddments_imagesB(): @@ -87,4 +89,5 @@ def oddments_imagesB(): oddments_imagesA() oddments_imagesB() - + + diff --git a/scripts/piped-work/make_html.py b/scripts/piped-work/make_html.py new file mode 100644 index 000000000..2fca833d7 --- /dev/null +++ b/scripts/piped-work/make_html.py @@ -0,0 +1,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 "
"+name+"
" + +files = getFiles() +print( "\n".join( [ oneItem(name) for name in files ] ) )