emin

changeset 26
79167c58c3a5
parent 25
fb778c6b6d4b
child 28
1088bb11189f
     1.1 --- a/emin	Wed Apr 24 10:38:33 2013 +0200
     1.2 +++ b/emin	Wed Apr 24 10:49:39 2013 +0200
     1.3 @@ -25,6 +25,7 @@
     1.4  
     1.5  TODO:
     1.6   * Make Cheetah templating optional, or use Genshi/Jinja/Mako?
     1.7 + * Clean up image filenames to avoid/minimise duplicate extensions
     1.8   * Try to validate the HTML output
     1.9   * Add all on one page option
    1.10   * Resize option
    1.11 @@ -44,7 +45,7 @@
    1.12  import logging
    1.13  from optparse import OptionParser, OptionGroup
    1.14  parser = OptionParser(usage=__doc__, version=__version__)
    1.15 -parser.add_option("-t", "--title", dest="TITLE", default="",
    1.16 +parser.add_option("-t", "--title", dest="TITLE", default=None,
    1.17                    help="title of this gallery")
    1.18  parser.add_option("--template", dest="TEMPLATE", default=None,
    1.19                    help="specify the template file to be used for the index pages")
    1.20 @@ -119,6 +120,9 @@
    1.21      newstr = s.replace(" ", "-").replace(",", "").replace("/", "").replace(".", "")
    1.22      return newstr
    1.23  
    1.24 +## Better title autodetection
    1.25 +if not opts.TITLE:
    1.26 +    opts.TITLE = os.path.basename(os.path.abspath(opts.SRCDIR))
    1.27  
    1.28  logging.debug("Title: %s" % opts.TITLE)
    1.29  logging.debug("Thumb height: %d" % opts.THUMB_HEIGHT)
    1.30 @@ -454,7 +458,7 @@
    1.31      PAGEPATH = os.path.join(opts.OUTDIR, PAGEFILE)
    1.32  
    1.33      ## Write the title
    1.34 -    PAGETITLE = opts.TITLE or os.path.basename(opts.SRCDIR)
    1.35 +    PAGETITLE = opts.TITLE
    1.36  
    1.37      ## Write the linked page list
    1.38      LINKSTR = mkPageLinkStr(PAGENUM)

mercurial