Changeset 14736 in project


Ignore:
Timestamp:
05/22/09 08:31:23 (10 years ago)
Author:
Ivan Raikov
Message:

Bug fix in the filter-subfolders code.

Location:
release/4/sigma/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • release/4/sigma/trunk/sigma.scm

    r14504 r14736  
    593593          (pngpat  "(.*\\.[pP][nN][gG]$)")
    594594          (gifpat  "(.*\\.[gG][iI][fF]$)")
    595           (thumbpat (string-substitute "." "\\." thumbprefix))
    596           (slidepat (string-substitute "." "\\." slideprefix)))
     595          (thumbpat (regexp-escape thumbprefix))
     596          (slidepat (regexp-escape slideprefix)))
    597597      (let ((pat   (s+ jpgpat "|" pngpat "|" gifpat))
    598598            (expat (regexp (s+ ".*((" thumbpat ")|(" slidepat ")).*"))))
     
    835835(define (filter-subfolders target-dir target-dir-depth lst)
    836836  (filter-map (lambda (d)
    837                 (let ((thumbpat   (regexp (s+ thumbprefix "*")))
     837                (let ((thumbpat   (regexp (s+ (regexp-escape thumbprefix) ".*")))
    838838                      (absolute?  (string=? dirsep (car d))))
    839839                  ;; only allow subfolders that contain thumbnails
     
    10511051(define (main-make-gallery SIGMA-DIR index image-dir target-dir commands . rest)
    10521052  (let-optionals rest ((subdirs (list)) (up #f) (toplevel? #f) (slide-dir #f))
     1053   (message "entering directory: " image-dir)
    10531054   (if (commands 'clean?)
    10541055       (let* ((pat (s+ ".*/(" thumbprefix ".*|" slideprefix ".*|" css-tmpl-file "|"
     
    10761077                                   (map (lambda (x) (if (list? x) (append x (list "")) (list x ""))) subfolders)))))
    10771078           (let ((nfiles (or (and flst+captions (length flst)) 0)))
     1079             (message "Found " nfiles " image files in directory: " image-dir)
    10781080             (cond ((and (zero? nfiles) toplevel? subfolders)
    10791081                    ;; Create a top-level index file that only contains links to subgalleries
    10801082                    (begin
     1083                      (message "creating top-level index file...")
    10811084                      ;; locate and copy the index template file, if necessary
    10821085                      (locate-and-copy-template SIGMA-DIR target-dir index-tmpl-file)
     
    10851088                      ;; create the index files with all the thumbnails
    10861089                      (make-toplevel-index target-dir index-tmpl-file
    1087                                            opt_html-index opt_html-ext opt_g opt_author subfolders up)))
     1090                                           opt_html-index opt_html-ext opt_g opt_author subfolders up)
     1091                      (done)))
    10881092                   (flst+captions
    10891093                    (begin
    10901094                      (if (commands 'gallery?)
    1091                           (begin
    1092                             (message "Found " nfiles " image files in directory: " image-dir)
    1093                             (if (< nfiles 1)
    1094                                 (sigma:error " please select more files for your gallery!"))))
     1095                          (if (< nfiles 1)
     1096                              (sigma:error " please select more files for your gallery!")))
    10951097                      (if flst+captions
    10961098                          (let-values (((flst captions)   (unzip2 flst+captions))
  • release/4/sigma/trunk/sigma.setup

    r14505 r14736  
    1111
    1212  ; Assoc list with properties for the program:
    13   '((version 1.17)
     13  '((version 1.18)
    1414    (documentation "sigma.html")))
    1515
Note: See TracChangeset for help on using the changeset viewer.