#!/usr/bin/env python

# mkphplist: find all non-thumbnail images under the current directory,
# and generate a showpix.php with the appropriate image list.
# Copyright 2004 by Akkana Peck. 
# You may use and distribute this under the GPL.

import sys, os

print "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">"

print "\n<?php"
print "  $title = \"Images\";"
print "  $pixlist = array("

# Find the files to use
if len(sys.argv) <= 1 :
    fp = os.popen("find . -name \"*.jpg\" | grep -v T.jpg")
    while 1 :
        line = fp.readline()
        if not line : break
        print "    array (\"" + line + "\", \"\" ),"
else :
    for fil in sys.argv[1:] :
        print "    array (\"" + fil + "\", \"\" ),"

print "  );"

print "  require(\"../../../software/showpix-base.php\");"
print "?>"
