Skip to content

Commit 2cb2f8d

Browse files
author
basti
committed
Code cleaned up.
1 parent ff49ec6 commit 2cb2f8d

File tree

3 files changed

+43
-41
lines changed

3 files changed

+43
-41
lines changed

amazonproduct/__init__.py

+39-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,41 @@
11

2-
from version import VERSION
3-
from api import *
2+
"""
3+
Amazon Product Advertising API
4+
==============================
45
5-
__version__ = VERSION
6+
The Product Advertising API provides programmatic access to Amazon's
7+
product selection and discovery functionality so that developers like you
8+
can advertise Amazon products to monetize your website.
9+
10+
The Product Advertising API helps you advertise Amazon products using
11+
product search and look up capability, product information and features
12+
such as Customer Reviews, Similar Products, Wish Lists and New and Used
13+
listings. You can make money using the Product Advertising API to advertise
14+
Amazon products in conjunction with the Amazon Associates program. Be sure
15+
to join the Amazon Associates program to earn up to 15% in referral fees
16+
when the users you refer to Amazon sites buy qualifying products.
17+
18+
More info can be found at
19+
https://affiliate-program.amazon.com/gp/advertising/api/detail/main.html
20+
21+
Requirements
22+
------------
23+
24+
You need an Amazon Webservice account which comes with an access key and a
25+
secret key.
26+
27+
If you don't customise the response processing, you'll also need the python
28+
module lxml (>=2.1.5) and, if you're using python 2.4, also pycrypto.
29+
30+
License
31+
-------
32+
33+
This program is release under the BSD License. You can find the full text of
34+
the license in the LICENSE file accompanying the package.
35+
36+
"""
37+
38+
from amazonproduct.version import VERSION
39+
from amazonproduct.api import *
40+
41+
__version__ = VERSION

amazonproduct/api.py

+1-36
Original file line numberDiff line numberDiff line change
@@ -3,41 +3,6 @@
33
# This program is release under the BSD License. You can find the full text of
44
# the license in the LICENSE file.
55

6-
"""
7-
Amazon Product Advertising API
8-
==============================
9-
10-
The Product Advertising API provides programmatic access to Amazon's
11-
product selection and discovery functionality so that developers like you
12-
can advertise Amazon products to monetize your website.
13-
14-
The Product Advertising API helps you advertise Amazon products using
15-
product search and look up capability, product information and features
16-
such as Customer Reviews, Similar Products, Wish Lists and New and Used
17-
listings. You can make money using the Product Advertising API to advertise
18-
Amazon products in conjunction with the Amazon Associates program. Be sure
19-
to join the Amazon Associates program to earn up to 15% in referral fees
20-
when the users you refer to Amazon sites buy qualifying products.
21-
22-
More info can be found at
23-
https://affiliate-program.amazon.com/gp/advertising/api/detail/main.html
24-
25-
Requirements
26-
------------
27-
28-
You need an Amazon Webservice account which comes with an access key and a
29-
secret key.
30-
31-
If you don't customise the response processing, you'll also need the python
32-
module lxml (>=2.1.5) and, if you're using python 2.4, also pycrypto.
33-
34-
License
35-
-------
36-
37-
This program is release under the BSD License. You can find the full text of
38-
the license in the LICENSE file.
39-
40-
"""
416

427
__docformat__ = "restructuredtext en"
438

@@ -60,7 +25,7 @@
6025
except ImportError: # pragma: no cover
6126
from urllib import quote
6227

63-
from version import VERSION
28+
from amazonproduct.version import VERSION
6429

6530
USER_AGENT = ('python-amazon-product-api/%s '
6631
'+http://pypi.python.org/pypi/python-amazon-product-api/' % VERSION)

amazonproduct/contrib/caching.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
except ImportError: # pragma: no cover
88
from md5 import new as md5
99

10-
from amazonproduct import API
10+
from amazonproduct.api import API
1111

1212
DEFAULT_CACHE_DIR = tempfile.mkdtemp(prefix='amzn_')
1313

@@ -55,7 +55,8 @@ def _fetch(self, url):
5555

5656
return resp
5757

58-
def get_hash(self, url):
58+
@staticmethod
59+
def get_hash(url):
5960
"""
6061
Calculate hash value for request based on URL.
6162
"""

0 commit comments

Comments
 (0)