SVN: toys/rsget.pl: README.config RSGet/Captcha.pm
sparky
sparky at pld-linux.org
Tue Nov 3 23:55:47 CET 2009
Author: sparky
Date: Tue Nov 3 23:55:47 2009
New Revision: 10940
Modified:
toys/rsget.pl/README.config
toys/rsget.pl/RSGet/Captcha.pm
Log:
- changed captcha_save_results setting into a directory
Modified: toys/rsget.pl/README.config
==============================================================================
--- toys/rsget.pl/README.config (original)
+++ toys/rsget.pl/README.config Tue Nov 3 23:55:47 2009
@@ -68,5 +68,5 @@
# be verbose (useful for debugging):
#verbose = 2
-# save captcha images (useful for debugging):
-#captcha_save_results = 1
+# save captcha images (useful for debugging) in ~/.rsget.pl/captcha directory:
+#captcha_save_results = ${RSGET_DIR}/captcha
Modified: toys/rsget.pl/RSGet/Captcha.pm
==============================================================================
--- toys/rsget.pl/RSGet/Captcha.pm (original)
+++ toys/rsget.pl/RSGet/Captcha.pm Tue Nov 3 23:55:47 2009
@@ -16,8 +16,7 @@
def_settings(
captcha_save_results => {
desc => "Save captcha results, for captcha debugging.",
- default => 0,
- allowed => qr/\d+/,
+ type => "PATH",
},
);
@@ -98,8 +97,9 @@
my $name = $self->{captcha_md5};
delete $self->{captcha_md5};
- return unless setting( "captcha_save_results" );
return unless $name;
+ my $capdir = setting( "captcha_save_results" );
+ return unless $capdir;
my $subdir;
if ( not defined $result ) {
@@ -113,7 +113,7 @@
}
my $getter = RSGet::Plugin::from_pkg( $self->{_pkg} );
- my $dir = "captcha/$getter->{short}/$subdir";
+ my $dir = "$capdir/captcha/$getter->{short}/$subdir";
mkpath( $dir ) unless -d $dir;
my $file = "$dir/$name";
More information about the pld-cvs-commit
mailing list