Changeset 18692


Ignore:
Timestamp:
Oct 19, 2012, 11:40:10 AM (12 years ago)
Author:
plg
Message:

new option --short_lines to make output log shorter for DOS terminal

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/piwigo_import_tree/piwigo_import_tree.pl

    r18600 r18692  
    3434          reload_properties
    3535          debug
     36          short_lines
    3637      /
    3738);
     
    279280
    280281    if (defined $property and $property ne '') {
    281         print '[photo '.$params{id}.'] "'.$params{path}.'", set photo title "'.$property.'"'."\n";
     282        print '[photo '.$params{id}.'] "';
     283
     284        if (defined $opt{short_lines}) {
     285            print basename($params{path});
     286        }
     287        else {
     288            print $params{path};
     289        }
     290
     291        print '", set photo title "'.$property.'"'."\n";
    282292
    283293        my $form = {
     
    306316    };
    307317
    308     print '[album '.$params{album_id}.'] '.$params{path}.' upload starts... ';
     318    print '[album '.$params{album_id}.'] "';
     319    if (defined $opt{short_lines}) {
     320        print basename($params{path});
     321    }
     322    else {
     323        print $params{path};
     324    }
     325    print '" upload starts... ';
     326
    309327    $| = 1;
    310328    my $t1 = [gettimeofday];
     
    317335    );
    318336
     337    my $photo_id = from_json($response->content)->{result}{image_id};
     338
    319339    my $elapsed = tv_interval($t1);
    320     print ' upload completed ('.sprintf('%u ms', $elapsed * 1000).')'."\n";
    321 
    322     return from_json($response->content)->{result}{image_id};
     340    print ' completed ('.sprintf('%u ms', $elapsed * 1000).', photo '.$photo_id.')'."\n";
     341
     342    return $photo_id;
    323343}
    324344
Note: See TracChangeset for help on using the changeset viewer.