Changeset 30229 in osm for applications/editors/josm


Ignore:
Timestamp:
2014-01-26T17:22:33+01:00 (11 years ago)
Author:
stoecker
Message:

improve stats tool

Location:
applications/editors/josm/i18n
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/i18n/launchpad.pl

    r30179 r30229  
    373373    {
    374374      my ($code, $inactive, $name) = ($1, $2, $3);
    375       if(exists($results{$code}{$lang}))
     375      if(exists($results{$code}{$lang}{count}) && exists($results{$code}{$lang}{time}) && time()-$results{$code}{$lang}{time} < 5*24*60*60)
    376376      {
    377377        printf "%-5s - %-30s - Found - %s\n", $lang,$code,$name;
     
    385385      if($count && $mech->status == 200)
    386386      {
     387        my $t = time();
     388        my $old = "";
     389        if(exists($results{$code}{$lang}{count}))
     390        {
     391          if($results{$code}{$lang}{count} != $count)
     392          {
     393            $old .= sprintf " %d %s",abs($count-$results{$code}{$lang}{count}),$count-$results{$code}{$lang}{count} > 0 ? "more" : "less";
     394          }
     395          else
     396          {
     397            $old .= " unchanged";
     398          }
     399        }
     400        if(exists($results{$code}{$lang}{time}))
     401        {
     402          $old .= sprintf " %.2f days later",($t-$results{$code}{$lang}{time})/86400.0;
     403        }
    387404        $results{$code}{NAME} = $name;
    388         $results{$code}{$lang} = $count;
    389         $results{$code}{TOTAL} += $count;
     405        $results{$code}{TOTAL} += $count-($results{$code}{$lang}{count}||0);
     406        $results{$code}{$lang}{count} = $count;
     407        $results{$code}{$lang}{time} = $t;
     408        $results{$code}{$lang}{$t} = $count;
    390409        if(open DFILE,">:utf8","launchpadtrans.data")
    391410        {
     
    393412          close DFILE;
    394413        }
    395         printf "%-5s - %-30s - %5d - %s\n", $lang,$code,$count,$name;
    396        
     414        if($old)
     415        {
     416          printf "%-5s - %-30s - %5d - %-70s%s\n", $lang,$code,$count,$name,$old;
     417        }
     418        else
     419        {
     420          printf "%-5s - %-30s - %5d - %s\n", $lang,$code,$count,$name;
     421        }
    397422      }
    398423      else
     
    409434    {
    410435      next if $lang eq "NAME" or $lang eq "TOTAL";
    411       print FILE ";$lang=$results{$code}{$lang}";
    412       printf " - %-5s=%5d",$lang, $results{$code}{$lang};
     436      next if !exists($results{$code}{$lang}{time}) || time()-$results{$code}{$lang}{time} > 6*24*60*60;
     437      print FILE ";$lang=$results{$code}{$lang}{count}";
     438      printf " - %-5s=%5d",$lang, $results{$code}{$lang}{count};
    413439    }
    414440    print FILE "\n";
  • applications/editors/josm/i18n/po

    • Property svn:ignore
      •  

        old new  
        11josm.pot
         2core.pot
         3data.pot
         4plugins.pot
        25*.po
        36*~
Note: See TracChangeset for help on using the changeset viewer.