Changeset 3454 for trunk/tools


Ignore:
Timestamp:
Jun 25, 2009, 1:01:35 AM (15 years ago)
Author:
plg
Message:

merge r3453 from branch 2.0 to trunk
feature 1033 added: new API method pwg.categories.setInfo makes possible to
change the name and comment of a given category.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/piwigo_remote.pl

    r3282 r3454  
    2525GetOptions(
    2626    \%opt,
    27     qw/action=s file=s thumbnail=s high=s original=s categories=s chunk_size=i define=s%/
     27    qw/
     28          action=s
     29          file=s
     30          thumbnail=s
     31          high=s
     32          original=s
     33          categories=s
     34          chunk_size=i
     35          base_url=s
     36          username=s
     37          password=s
     38          define=s%
     39      /
    2840);
    2941
     
    3244
    3345my %conf;
    34 $conf{base_url} = 'http://localhost/piwigo/2.0';
    3546$conf{response_format} = 'json';
    36 $conf{username} = 'plg';
    37 $conf{password} = 'plg';
    3847$conf{limit} = 10;
    39 $conf{chunk_size} = defined $opt{chunk_size} ? $opt{chunk_size} : 500_000;
     48
     49my %conf_default = (
     50    base_url => 'http://localhost/piwigo/2.0',
     51    username => 'plg',
     52    password => 'plg',
     53    chunk_size => 500_000,
     54);
     55foreach my $conf_key (keys %conf_default) {
     56    $conf{$conf_key} = defined $opt{$conf_key} ? $opt{$conf_key} : $conf_default{$conf_key}
     57}
    4058
    4159my $result = undef;
     
    217235}
    218236
    219 if ($opt{action} eq 'pwg.images.setInfo') {
     237if ($opt{action} eq 'pwg.images.setInfo' or $opt{action} eq 'pwg.categories.setInfo') {
    220238    $form = {
    221239        method => $opt{action},
Note: See TracChangeset for help on using the changeset viewer.