Changeset 27211 in osm for applications/editors/josm


Ignore:
Timestamp:
2011-12-11T15:24:38+01:00 (13 years ago)
Author:
stoecker
Message:

minor fixes

File:
1 edited

Legend:

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

    r27210 r27211  
    229229sub doget
    230230{
    231   my ($mech, $page) = @_;
    232   for(my $i = 1; $i <= 50; $i++)
     231  my ($mech, $page, $arg) = @_;
     232  for(my $i = 1; $i <= 5; $i++)
    233233  {
    234234    $mech->timeout(30);
     
    241241    return $mech if !$@;
    242242    sleep(30+5*$i);
     243    last if $arg && $arg eq "no503" and $code == 503;
    243244    $mech = WWW::Mechanize->new("agent" => $agent);
    244245  }
     
    281282      }
    282283      my $urlcode = URI::Escape::uri_escape($code);
    283       $mech = doget($mech, "https://translations.launchpad.net/josm/trunk/+pots/josm/$lang/+filter?person=$urlcode");
     284      $mech = doget($mech, "https://translations.launchpad.net/josm/trunk/+pots/josm/$lang/+filter?person=$urlcode", "no503");
    284285      sleep(1);
    285       my ($count) = $mech->content() =~ /of[\r\n\t ]+?(\d+)[\r\n\t ]+?result/;
     286      my $cont = $mech->content() || "";
     287      my ($count) = $cont =~ /of[\r\n\t ]+?(\d+)[\r\n\t ]+?result/;
    286288      if($count && $mech->status == 200)
    287289      {
Note: See TracChangeset for help on using the changeset viewer.