lilalo

diff l3-agent @ 84:2cb912bff2ea

* В журнале выводится имя курса, а не только его код
* Исправлена ошибка с фильтром при чтении журнала из XML-репозитория
Теперь всё ок
author devi
date Sat Feb 25 08:02:25 2006 +0200 (2006-02-25)
parents bdc1f02d3f87
children 3f92cd706473
line diff
     1.1 --- a/l3-agent	Fri Feb 24 18:43:35 2006 +0200
     1.2 +++ b/l3-agent	Sat Feb 25 08:02:25 2006 +0200
     1.3 @@ -279,6 +279,9 @@
     1.4                  #Загруженную информацию сразу же отправляем в поток
     1.5                  print_session($Config{cache}, $local_session_id);
     1.6              }
     1.7 +            else {
     1.8 +                die "can't open session file";
     1.9 +            }
    1.10          }
    1.11  
    1.12          open (FILE, "$file");
    1.13 @@ -581,10 +584,12 @@
    1.14      @Command_Lines_Index = sort {
    1.15          defined($Command_Lines[$index[$a]]->{"time"}) 
    1.16          ?  $Command_Lines[$index[$a]]->{"time"} <=> $Command_Lines[$index[$b]]->{"time"} 
    1.17 -        :  $Command_Lines[$index[$a]]->{"day"} cmp $Command_Lines[$index[$b]]->{"day"} 
    1.18 +        :  defined($Command_Lines[$index[$a]]->{"day"})
    1.19 +        ?  $Command_Lines[$index[$a]]->{"day"} cmp $Command_Lines[$index[$b]]->{"day"} 
    1.20          || $Command_Lines[$index[$a]]->{"hour"} <=> $Command_Lines[$index[$b]]->{"hour"}
    1.21          || $Command_Lines[$index[$a]]->{"min"} <=> $Command_Lines[$index[$b]]->{"min"} 
    1.22          || $Command_Lines[$index[$a]]->{"sec"} <=> $Command_Lines[$index[$b]]->{"sec"}
    1.23 +        :  0
    1.24      } @index;
    1.25  
    1.26      print "finished\n" if $Config{"verbose"} =~ /y/;
    1.27 @@ -738,12 +743,16 @@
    1.28      my $local_session_id = $_[1];
    1.29      return if not defined($Sessions{$local_session_id});
    1.30  
    1.31 +    print "printing session info. session id = ".$local_session_id."\n"
    1.32 +        if $Config{verbose} =~ /y/;
    1.33 +
    1.34      open(OUT, ">>", $output_filename)
    1.35          or die "Can't open $output_filename for writing\n";
    1.36      print OUT "<session>\n";
    1.37      my %session = %{$Sessions{$local_session_id}};
    1.38      for my $key (keys %session) {
    1.39 -        print OUT "<$key>".$session{$key}."</$key>\n"
    1.40 +        print OUT "<$key>".$session{$key}."</$key>\n";
    1.41 +        print "         ".$key,"\n";
    1.42      }
    1.43      print OUT "</session>\n";
    1.44      close(OUT);