r5812 - in /packages/libnet-amazon-perl/trunk: ./ debian/ lib/Net/ lib/Net/Amazon/ lib/Net/Amazon/Property/ lib/Net/Amazon/Response/ t/

gregoa-guest at users.alioth.debian.org gregoa-guest at users.alioth.debian.org
Sat Jul 14 22:48:59 UTC 2007


Author: gregoa-guest
Date: Sat Jul 14 22:48:59 2007
New Revision: 5812

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=5812
Log:
* New upstream release.

Modified:
    packages/libnet-amazon-perl/trunk/Changes
    packages/libnet-amazon-perl/trunk/META.yml
    packages/libnet-amazon-perl/trunk/README
    packages/libnet-amazon-perl/trunk/debian/changelog
    packages/libnet-amazon-perl/trunk/lib/Net/Amazon.pm
    packages/libnet-amazon-perl/trunk/lib/Net/Amazon/Property.pm
    packages/libnet-amazon-perl/trunk/lib/Net/Amazon/Property/CE.pm
    packages/libnet-amazon-perl/trunk/lib/Net/Amazon/Property/Music.pm
    packages/libnet-amazon-perl/trunk/lib/Net/Amazon/Request.pm
    packages/libnet-amazon-perl/trunk/lib/Net/Amazon/Response.pm
    packages/libnet-amazon-perl/trunk/lib/Net/Amazon/Response/Wishlist.pm
    packages/libnet-amazon-perl/trunk/t/010Artist.t
    packages/libnet-amazon-perl/trunk/t/017Author.t

Modified: packages/libnet-amazon-perl/trunk/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libnet-amazon-perl/trunk/Changes?rev=5812&op=diff
==============================================================================
--- packages/libnet-amazon-perl/trunk/Changes (original)
+++ packages/libnet-amazon-perl/trunk/Changes Sat Jul 14 22:48:59 2007
@@ -1,4 +1,26 @@
 Revision history for Perl extension Net::Amazon:
+
+0.43 (06/20/2007)
+   (cb) Simon Wistow <simon at thegestalt.org> found an bug with wishlist
+        processing, which would cause Net::Amazon to give up prematurely.
+   (cb) Be more graceful when dealing with Small ResponseGroups by trying
+        to avoid Perl warnings.
+   (cb) Added a gross hack to deal with Amazon's wishlist handling to ensure
+        the wishlist test can actually pass.
+
+0.42 (06/18/2007)
+   (cb) Add scripts to automatically generate the canned test data.
+   (cb) Serge Dubrouski <sergeyfd at gmail.com> noted an inconsistency in the 
+        documentation for ImageUrl{Small,Medium,Large}.  When I converted to 
+        AWS4 I renamed these functions accidently.  Add back the old function 
+        names, and keep the new functions around.
+
+0.41 (04/10/2007)
+   (cb) Tümer Garip <tgarip at neu.edu.tr> found a long standing bug for the
+        Music properties whereby track data were not correctly captured, and
+        returned.
+   (cb) Fix the Artist test to account for this lapse in the future, and add 
+        more tests as well.
 
 0.40 (03/12/2007)
    (cb) UPC accepts a search index, so process it.

Modified: packages/libnet-amazon-perl/trunk/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libnet-amazon-perl/trunk/META.yml?rev=5812&op=diff
==============================================================================
--- packages/libnet-amazon-perl/trunk/META.yml (original)
+++ packages/libnet-amazon-perl/trunk/META.yml Sat Jul 14 22:48:59 2007
@@ -1,19 +1,16 @@
---- #YAML:1.0
-name:                Net-Amazon
-version:             0.40
-abstract:            Framework for accessing amazon.com via REST
-license:             ~
-generated_by:        ExtUtils::MakeMaker version 6.32
-distribution_type:   module
-requires:     
+# http://module-build.sourceforge.net/META-spec.html
+#XXXXXXX This is a prototype!!!  It will change in the future!!! XXXXX#
+name:         Net-Amazon
+version:      0.43
+version_from: lib/Net/Amazon.pm
+installdirs:  site
+requires:
     Data::Dumper:                  0
     Log::Log4perl:                 0.3
     LWP::UserAgent:                2
     Time::HiRes:                   1
     URI:                           0
     XML::Simple:                   2.08
-meta-spec:
-    url:     http://module-build.sourceforge.net/META-spec-v1.2.html
-    version: 1.2
-author:
-    - Mike <m at perlmeister.com>
+
+distribution_type: module
+generated_by: ExtUtils::MakeMaker version 6.30

Modified: packages/libnet-amazon-perl/trunk/README
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libnet-amazon-perl/trunk/README?rev=5812&op=diff
==============================================================================
--- packages/libnet-amazon-perl/trunk/README (original)
+++ packages/libnet-amazon-perl/trunk/README Sat Jul 14 22:48:59 2007
@@ -1,5 +1,5 @@
 ######################################################################
-    Net::Amazon 0.40
+    Net::Amazon 0.43
 ######################################################################
 NAME
     Net::Amazon - Framework for accessing amazon.com via REST

Modified: packages/libnet-amazon-perl/trunk/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libnet-amazon-perl/trunk/debian/changelog?rev=5812&op=diff
==============================================================================
--- packages/libnet-amazon-perl/trunk/debian/changelog (original)
+++ packages/libnet-amazon-perl/trunk/debian/changelog Sat Jul 14 22:48:59 2007
@@ -1,3 +1,9 @@
+libnet-amazon-perl (0.43-1) unstable; urgency=low
+
+  * New upstream release.
+
+ -- gregor herrmann <gregor+debian at comodo.priv.at>  Sun, 15 Jul 2007 00:47:13 +0200
+
 libnet-amazon-perl (0.40-1) unstable; urgency=low
 
   * New upstream release.

Modified: packages/libnet-amazon-perl/trunk/lib/Net/Amazon.pm
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libnet-amazon-perl/trunk/lib/Net/Amazon.pm?rev=5812&op=diff
==============================================================================
--- packages/libnet-amazon-perl/trunk/lib/Net/Amazon.pm (original)
+++ packages/libnet-amazon-perl/trunk/lib/Net/Amazon.pm Sat Jul 14 22:48:59 2007
@@ -8,10 +8,11 @@
 use strict;
 use warnings;
 
-our $VERSION          = '0.40';
+our $VERSION          = '0.43';
 our $WSDL_DATE        = '2007-01-17';
 our $Locale           = 'us';
 our @CANNED_RESPONSES = ();
+our $IS_CANNED        = 0;
 
 use LWP::UserAgent;
 use HTTP::Request::Common;
@@ -226,6 +227,7 @@
     INFO("Fetching $url");
 
     if(@CANNED_RESPONSES) {
+        $IS_CANNED = 1;
         INFO("Serving canned response (testing)");
         return shift @CANNED_RESPONSES;
     }

Modified: packages/libnet-amazon-perl/trunk/lib/Net/Amazon/Property.pm
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libnet-amazon-perl/trunk/lib/Net/Amazon/Property.pm?rev=5812&op=diff
==============================================================================
--- packages/libnet-amazon-perl/trunk/lib/Net/Amazon/Property.pm (original)
+++ packages/libnet-amazon-perl/trunk/lib/Net/Amazon/Property.pm Sat Jul 14 22:48:59 2007
@@ -17,17 +17,22 @@
 use Log::Log4perl qw(:easy);
 
 # read: a poor man's XPath
+# NOTE: Igor Sutton Lopes has a module called Hash::Path that does exactly
+# what I am doing here.  He beat me to the punch. :)
 our %DEFAULT_ATTRIBUTES_XPATH = (
     Availability => [qw(Offers Offer OfferListing Availability)],
     Catalog => [qw(ItemAttributes ProductGroup)],
     Binding => [qw(ItemAttributes Binding)],
     CollectibleCount => [qw(OfferSummary TotalCollectible)],
     CollectiblePrice => [qw(OfferSummary LowestCollectiblePrice FormattedPrice)],
+    ImageUrlLarge => [qw(LargeImage URL)],
     LargeImageUrl => [qw(LargeImage URL)],
     ListPrice => [qw(ItemAttributes ListPrice FormattedPrice)],
     Manufacturer => [qw(ItemAttributes Manufacturer)],
     MediumImageUrl => [qw(MediumImage URL)],
+    ImageUrlMedium => [qw(MediumImage URL)],
     OurPrice => [qw(Offers Offer OfferListing Price FormattedPrice)],
+    ImageUrlSmall => [qw(SmallImage URL)],
     SmallImageUrl => [qw(SmallImage URL)],
     SuperSaverShipping => [qw(Offers Offer OfferListing IsEligibleForSuperSaverShipping)],
     Title => [qw(Title)],
@@ -81,8 +86,12 @@
         $self->$attr($value);
     }
 
-    $self->NumberOfOfferings($self->UsedCount() + $self->ThirdPartyNewCount() + $self->CollectibleCount());
-    $self->ProductDescription($options{xmlref}->{EditorialReviews}->{EditorialReview}->[0]->{Content});
+    if (defined $options{xmlref}->{OfferSummary}) {
+        $self->NumberOfOfferings($self->UsedCount() + $self->ThirdPartyNewCount() + $self->CollectibleCount());
+    }
+    if (defined $options{xmlref}->{EditorialReviews}) {
+        $self->ProductDescription($options{xmlref}->{EditorialReviews}->{EditorialReview}->[0]->{Content});
+    }
 
     my @browse_nodes;
     if (ref $options{xmlref}->{BrowseNodes}->{BrowseNode} eq 'ARRAY') {

Modified: packages/libnet-amazon-perl/trunk/lib/Net/Amazon/Property/CE.pm
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libnet-amazon-perl/trunk/lib/Net/Amazon/Property/CE.pm?rev=5812&op=diff
==============================================================================
--- packages/libnet-amazon-perl/trunk/lib/Net/Amazon/Property/CE.pm (original)
+++ packages/libnet-amazon-perl/trunk/lib/Net/Amazon/Property/CE.pm Sat Jul 14 22:48:59 2007
@@ -41,7 +41,7 @@
     $self->manufacturer($ref->{Manufacturer});
     $self->model($ref->{Model});
     $self->mpn($ref->{MPN});
-    $self->platforms($ref->{Platform});
+    $self->platforms($ref->{Platform} || 'UNKNOWN');
     $self->publisher($ref->{Publisher});
     $self->studio($ref->{Studio});
     $self->title($ref->{Title});

Modified: packages/libnet-amazon-perl/trunk/lib/Net/Amazon/Property/Music.pm
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libnet-amazon-perl/trunk/lib/Net/Amazon/Property/Music.pm?rev=5812&op=diff
==============================================================================
--- packages/libnet-amazon-perl/trunk/lib/Net/Amazon/Property/Music.pm (original)
+++ packages/libnet-amazon-perl/trunk/lib/Net/Amazon/Property/Music.pm Sat Jul 14 22:48:59 2007
@@ -68,8 +68,10 @@
     $self->NumMedia($ref->{NumberOfDiscs});
 
     my @tracks;
-    for my $media (keys %{$ref->{Tracks}}) {
-        push @tracks, $_ for (@{$media->{Track}});
+    for my $disc (@{$xmlref->{Tracks}->{Disc}}) {
+        for my $track (@{$disc->{Track}}) {
+            push @tracks, $track->{content};
+        }
     }
     $self->tracks(\@tracks);
 
@@ -136,7 +138,11 @@
 
 =item tracks()
 
-Returns a list of the CD's track titles.
+Returns a list of the CD's track titles.  Tracks are ordered as they appear on
+the media.  Track one is at offset zero in the tracks() list.  If there are
+multiple media then tracks are appended to the same list.  There is currently
+no way to determine which track belongs to which media.  (Amazon returns these
+data, but it is not used by Net::Amazon.)
 
 =item label()
 

Modified: packages/libnet-amazon-perl/trunk/lib/Net/Amazon/Request.pm
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libnet-amazon-perl/trunk/lib/Net/Amazon/Request.pm?rev=5812&op=diff
==============================================================================
--- packages/libnet-amazon-perl/trunk/lib/Net/Amazon/Request.pm (original)
+++ packages/libnet-amazon-perl/trunk/lib/Net/Amazon/Request.pm Sat Jul 14 22:48:59 2007
@@ -320,9 +320,27 @@
 
 =item type
 
-Defaults to C<Large>, but can be set to C<Small> if no reviews etc.
-on a product are wanted. Some fields (e.g. C<isbn>) are not going to be 
-available in C<small> mode, though.
+Defaults to C<Large>, but can also be set to C<Medium>, or C<Small>.
+
+=over 8
+
+=item Large
+
+The C<Large> type provides everything in C<Medium> as well as music track
+information, customer reviews, similar products, offers, and accessory data,
+i.e. the kitchen sink.
+
+=item Medium
+
+The C<Medium> type provides everything in C<Small> as well as sales rank,
+editorial reviews, and image URLs.
+
+=item Small
+
+The C<Small> type provies ASIN, product title, creator (author, artist, etc.),
+product group, URL, and manufacturer.
+
+=back
 
 =item mode
 

Modified: packages/libnet-amazon-perl/trunk/lib/Net/Amazon/Response.pm
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libnet-amazon-perl/trunk/lib/Net/Amazon/Response.pm?rev=5812&op=diff
==============================================================================
--- packages/libnet-amazon-perl/trunk/lib/Net/Amazon/Response.pm (original)
+++ packages/libnet-amazon-perl/trunk/lib/Net/Amazon/Response.pm Sat Jul 14 22:48:59 2007
@@ -10,8 +10,8 @@
 use XML::Simple;
 use Log::Log4perl qw(:easy get_logger);
 
-our @FORCE_ARRAY_FIELDS = qw(Author Artist Creator Director Review 
-EditorialReview SimilarProduct);
+our @FORCE_ARRAY_FIELDS = qw(Author Artist Creator Director Disc
+Review EditorialReview SimilarProduct Track);
 
 __PACKAGE__->make_accessor($_) for qw(
   status messages items xmlref total_results);

Modified: packages/libnet-amazon-perl/trunk/lib/Net/Amazon/Response/Wishlist.pm
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libnet-amazon-perl/trunk/lib/Net/Amazon/Response/Wishlist.pm?rev=5812&op=diff
==============================================================================
--- packages/libnet-amazon-perl/trunk/lib/Net/Amazon/Response/Wishlist.pm (original)
+++ packages/libnet-amazon-perl/trunk/lib/Net/Amazon/Response/Wishlist.pm Sat Jul 14 22:48:59 2007
@@ -62,7 +62,7 @@
 ##################################################
     my($self, $ref, $new_items, $page) = @_;
     DEBUG("Trying to fetch additional wishlist page (AMZN bug)");
-    return $new_items == 10;
+    return ($Net::Amazon::IS_CANNED) ? $new_items == 10 : $new_items > 0;
 }
 
 ##################################################

Modified: packages/libnet-amazon-perl/trunk/t/010Artist.t
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libnet-amazon-perl/trunk/t/010Artist.t?rev=5812&op=diff
==============================================================================
--- packages/libnet-amazon-perl/trunk/t/010Artist.t (original)
+++ packages/libnet-amazon-perl/trunk/t/010Artist.t Sat Jul 14 22:48:59 2007
@@ -4,7 +4,7 @@
 use warnings;
 use strict;
 
-use Test::More tests => 10;
+use Test::More tests => 20;
 BEGIN { use_ok('Net::Amazon') };
 
 #use Log::Log4perl qw(:easy);
@@ -44,7 +44,19 @@
 @properties = $resp->properties();
 is($properties[3]->artist, "Zwan", "Check artist");
 is($properties[3]->album, "Lyric", "Check album");
+is($properties[3]->Title, "Lyric", "Check Title");
 is($properties[4]->nummedia, "", "Check nummedia");
 is($properties[4]->media, "Audio CD", "Check media");
 is($properties[0]->label, "Reprise / Wea", "Check label");
+is($properties[0]->publisher, "Reprise / Wea", "Check publisher");
+is($properties[0]->studio, "Reprise / Wea", "Check studio");
+is($properties[0]->upc, "093624843627", "Check upc");
+is($properties[0]->ean, "0093624843627", "Check ean");
+is($properties[0]->release_date, "2003-01-28", "Check release_date");
 is($properties[1]->label, "Import [Generic]", "Check label");
+my @tracks = $properties[0]->tracks;
+is(scalar(@tracks), 14, "Check number of tracks");
+is($tracks[0], "Lyric", "Check tracks one");
+is($tracks[8], "Endless Summer", "Check tracks nine");
+is($tracks[13], "Come With Me", "Check tracks fourteen");
+

Modified: packages/libnet-amazon-perl/trunk/t/017Author.t
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libnet-amazon-perl/trunk/t/017Author.t?rev=5812&op=diff
==============================================================================
--- packages/libnet-amazon-perl/trunk/t/017Author.t (original)
+++ packages/libnet-amazon-perl/trunk/t/017Author.t Sat Jul 14 22:48:59 2007
@@ -4,7 +4,7 @@
 use warnings;
 use strict;
 
-use Test::More tests => 16;
+use Test::More tests => 22;
 BEGIN { use_ok('Net::Amazon') };
 
 #use Log::Log4perl qw(:easy);
@@ -53,3 +53,9 @@
 is($properties[0]->ean, "9780201360684", "Check ean");
 is($properties[0]->year, "1998", "Check year");
 is($properties[0]->Catalog, "Book", "Check Catalog");
+is($properties[0]->SmallImageUrl, "http://images.amazon.com/images/P/0201360683.01._SCTHUMBZZZ_.jpg", "Checking small image URL");
+is($properties[0]->ImageUrlSmall, "http://images.amazon.com/images/P/0201360683.01._SCTHUMBZZZ_.jpg", "Checking small image URL");
+is($properties[0]->MediumImageUrl, "http://images.amazon.com/images/P/0201360683.01._SCMZZZZZZZ_.jpg", "Checking Medium image URL");
+is($properties[0]->ImageUrlMedium, "http://images.amazon.com/images/P/0201360683.01._SCMZZZZZZZ_.jpg", "Checking Medium image URL");
+is($properties[0]->LargeImageUrl, "http://images.amazon.com/images/P/0201360683.01._SCLZZZZZZZ_.jpg", "Checking Large image URL");
+is($properties[0]->ImageUrlLarge, "http://images.amazon.com/images/P/0201360683.01._SCLZZZZZZZ_.jpg", "Checking Large image URL");




More information about the Pkg-perl-cvs-commits mailing list