[LON-CAPA-cvs] cvs: loncom /interface printout.pl

foxr lon-capa-cvs@mail.lon-capa.org
Mon, 06 Nov 2006 11:40:02 -0000


foxr		Mon Nov  6 06:40:02 2006 EDT

  Modified files:              
    /loncom/interface	printout.pl 
  Log:
  Handle files in conversion queue with .eps or .ps extensions by copying
  them with ' ' mapped to _ so that printing them won't fail.
  
  
Index: loncom/interface/printout.pl
diff -u loncom/interface/printout.pl:1.111 loncom/interface/printout.pl:1.112
--- loncom/interface/printout.pl:1.111	Mon Oct 30 06:40:49 2006
+++ loncom/interface/printout.pl	Mon Nov  6 06:40:02 2006
@@ -205,7 +205,7 @@
       foreach my $not_eps (@content_of_file) {
 	  chomp($not_eps);
 	  if ($not_eps ne '') {
-	      # print "Converting $not_eps"; # Debugging.
+	       # print "Converting $not_eps"; # Debugging.
               my $status_statement='EPS picture for '.$not_eps;
 	      # print "$status_statement\n";
 	      $not_eps=~s|\/\.\/|\/|g;
@@ -227,13 +227,16 @@
 	      # We really just need to copy it from where it was to prtspool
 	      # but with the spaces substituted to _'s.
 	      #
-	      my ($path, $nsname, $sext) = fileparse($eps_f, qr/\.(ps|eps)/i);
+	      my ($nsname,$path, $sext) = fileparse($not_eps, qr/\.(ps|eps)/i);
 	      if ($sext =~/ps$/i) {
+		  # print "$not_eps is a postscript file. copy to $path\n";
 		  File::Path::mkpath($path,0,0777);
-		  $not_eps =~ s/^\s+//;
-		  $not_eps =~ s/\s+$//;
-		  $not_eps =~ s/ /\__/g;
-		  File::Copy("$not_eps", "$eps_f"); 
+#		  $not_eps =~ s/^\s+//;
+#		  $not_eps =~ s/\s+$//;
+#		  $not_eps =~ s/ /\__/g;
+		  # print "Copying $not_eps to $eps_f\n";
+		  copy("$not_eps", "$eps_f"); 
+		  # print "Copy complete\n";
 	      } else {
 	      
 		  $eps_f .= '.eps';	# Just append the eps ext.