Ignore:
Timestamp:
2012-06-01T22:30:50+02:00 (14 years ago)
Author:
stoecker
Message:

add launchpad pot file upload approving

File:
1 edited

Legend:

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

    r28409 r28424  
    170170    chdir("po");
    171171    $mech->submit_form(with_fields => {"file" => "josm.pot"});
     172    $mech->get("https://translations.launchpad.net/josm/trunk/+imports?field.filter_status=NEEDS_REVIEW&field.filter_extension=pot");
     173    my @links;
     174    foreach my $line (split("\n", $mech->content()))
     175    {
     176      push (@links, $1) if $line =~ /href="(\/\+imports\/\d+)"/;
     177    }
     178    if(!@links)
     179    {
     180      warn "Upload not found in import list, upload possibly failed.";
     181    }
     182    elsif(@links > 1)
     183    {
     184      warn "More than one upload found in import list, cannot approve.";
     185    }
     186    else
     187    {
     188      $mech->get("https://translations.launchpad.net$links[0]");
     189      $mech->submit_form(form_name => "launchpadform", button => "field.actions.approve");
     190      if(!($mech->content() =~ /There are no entries that match this filtering/))
     191      {
     192        warn "Approving possibly failed.";
     193      }
     194    }
     195
    172196    chdir("..");
    173197}
Note: See TracChangeset for help on using the changeset viewer.