xmltv/grab/uk_atlas tv_grab_uk_atlas,1.26,1.27

Geoff <[email protected]>
Newsgroups gmane.comp.tv.xmltv.cvs
Message-ID <[email protected]>
Update of /cvsroot/xmltv/xmltv/grab/uk_atlas
In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv25248

Modified Files:
	tv_grab_uk_atlas 
Log Message:
(minor) don't error if user.map file not found

Index: tv_grab_uk_atlas
===================================================================
RCS file: /cvsroot/xmltv/xmltv/grab/uk_atlas/tv_grab_uk_atlas,v
retrieving revision 1.26
retrieving revision 1.27
diff -C2 -d -r1.26 -r1.27
*** tv_grab_uk_atlas	15 Aug 2014 10:53:44 -0000	1.26
--- tv_grab_uk_atlas	28 Aug 2014 13:45:13 -0000	1.27
***************
*** 907,924 ****
  		#  and overwrite any corresponding grabber mappings		
  		my $fn = get_supplement_dir() . '/'. $GRABBER_NAME . '.user.map.conf';
! 		my $fhok = open my $fh, '<', $fn or warning("Cannot open conf file $fn");
! 		if ($fhok) {
! 			while (my $line = <$fh>) { 
! 				chomp $line;  chop($line) if ($line =~ m/\r$/);  trim($line);
! 				next if $line =~ /^#/ || $line eq '';
! 				
! 				my ($type, $mapfrom, $mapto, $trash) = $line =~ /^(.*)==(.*)==(.*?)([\s\t]*#.*)?$/;
! 				SWITCH: {
! 						lc($type) eq 'map' && do { $mapchannels->{$mapfrom} = $mapto; last SWITCH; };
! 						lc($type) eq 'cat' && do { $mapcategories->{$mapfrom} = $mapto; last SWITCH; };
! 						warning("Unknown type in map file: \n $line");
  				}
  			}
- 			close $fh;
  		}
  		# print Dumper ($mapchannels, $mapcategories);
--- 907,926 ----
  		#  and overwrite any corresponding grabber mappings		
  		my $fn = get_supplement_dir() . '/'. $GRABBER_NAME . '.user.map.conf';
! 		if ( -e $fn ) {
! 			my $fhok = open my $fh, '<', $fn or warning("Cannot open conf file $fn");
! 			if ($fhok) {
! 				while (my $line = <$fh>) { 
! 					chomp $line;  chop($line) if ($line =~ m/\r$/);  trim($line);
! 					next if $line =~ /^#/ || $line eq '';
! 					
! 					my ($type, $mapfrom, $mapto, $trash) = $line =~ /^(.*)==(.*)==(.*?)([\s\t]*#.*)?$/;
! 					SWITCH: {
! 							lc($type) eq 'map' && do { $mapchannels->{$mapfrom} = $mapto; last SWITCH; };
! 							lc($type) eq 'cat' && do { $mapcategories->{$mapfrom} = $mapto; last SWITCH; };
! 							warning("Unknown type in map file: \n $line");
! 					}
  				}
+ 				close $fh;
  			}
  		}
  		# print Dumper ($mapchannels, $mapcategories);


------------------------------------------------------------------------------
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.