[Templates] PATCH Template::Plugin::Directory
Allen Day
allenday@ucla.edu
Sun, 10 Mar 2002 21:46:36 -0800 (PST)
This message is in MIME format. The first part should be readable text,
while the remaining parts are likely unreadable without MIME-aware tools.
Send mail to mime@docserver.cac.washington.edu for more info.
---1463811583-1604620451-1015825596=:9391
Content-Type: TEXT/PLAIN; charset=US-ASCII
Hi all,
I've patched the Directory plugin to allow filename filtering.
Now you can do like so:
[% USE d = Directory(somedir,root=someroot) %]
[% d.files.size %] # maybe 100 files
[% d.files('jpe?g$').size %] # but only 90 jpeg images
This against Template 2.06. Hopefully not too heinous; it's my first
patch.
-Allen
---1463811583-1604620451-1015825596=:9391
Content-Type: TEXT/PLAIN; charset=US-ASCII; name="Directory.pm.patch"
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.LNX.4.33.0203102146360.9391@kermit.1-up.net>
Content-Description:
Content-Disposition: attachment; filename="Directory.pm.patch"
KioqIERpcmVjdG9yeS5wbS5vcmlnCVN1biBNYXIgMTAgMjE6MzA6NTggMjAw
Mg0KLS0tIERpcmVjdG9yeS5wbS5uZXcJU3VuIE1hciAxMCAyMTozMDo1NSAy
MDAyDQoqKioqKioqKioqKioqKioNCioqKiA2NCw2OSAqKioqDQotLS0gNjQs
ODAgLS0tLQ0KICB9DQogIA0KICANCisgc3ViIGZpbGVzIHsNCisgICAgIG15
ICgkc2VsZiwgJHBhdHRlcm4pID0gQF87DQorIA0KKyAgICAgbXkgQG1hdGNo
ID0gKCk7DQorICAgICBmb3JlYWNoIG15ICRmaWxlIChAeyRzZWxmLT57Zmls
ZXN9fSl7DQorICAgICAgICAgcHVzaCBAbWF0Y2gsICRmaWxlIGlmICRmaWxl
LT57IG5hbWUgfSA9fiAvJHBhdHRlcm4vOw0KKyAgICAgfQ0KKyANCisgICAg
IHJldHVybiBcQG1hdGNoOw0KKyB9DQorIA0KICAjLS0tLS0tLS0tLS0tLS0t
LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t
LS0tLS0tLS0tLS0tDQogICMgc2NhbihcJWNvbmZpZykNCiAgIw0K
---1463811583-1604620451-1015825596=:9391--