r690@llin: dpavlin | 2006-05-18 15:47:03 +0200
authorDobrica Pavlinusic <dpavlin@rot13.org>
Thu, 18 May 2006 13:48:58 +0000 (13:48 +0000)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Thu, 18 May 2006 13:48:58 +0000 (13:48 +0000)
 make lookup optional

git-svn-id: svn+ssh://mjesec/home/dpavlin/svn/webpac2/trunk@520 07558da8-63fa-0310-ba24-9fe276d99e06

run.pl

diff --git a/run.pl b/run.pl
index 5c1d5e3..e8c8c49 100755 (executable)
--- a/run.pl
+++ b/run.pl
@@ -202,7 +202,7 @@ while (my ($database, $db_config) = each %{ $config->{databases} }) {
 
                my $lookup = new WebPAC::Lookup(
                        lookup_file => $input->{lookup},
-               );
+               ) if ($input->{lookup});
 
                my $input_module = $config->{webpac}->{inputs}->{$type};
 
@@ -227,7 +227,7 @@ while (my ($database, $db_config) = each %{ $config->{databases} }) {
                my $n = new WebPAC::Normalize::XML(
                #       filter => { 'foo' => sub { shift } },
                        db => $db,
-                       lookup_regex => $lookup->regex,
+                       lookup_regex => $lookup ? $lookup->regex : undef,
                        lookup => $lookup,
                        prefix => $input->{name},
                );
@@ -288,7 +288,7 @@ while (my ($database, $db_config) = each %{ $config->{databases} }) {
                                $ds = WebPAC::Normalize::Set::data_structure(
                                        row => $row,
                                        rules => $rules,
-                                       lookup => $lookup->lookup_hash,
+                                       lookup => $lookup ? $lookup->lookup_hash : undef,
                                );
 
                                $db->save_ds(