aboutsummaryrefslogtreecommitdiffstats
path: root/gsxws
diff options
context:
space:
mode:
authorFilipp Lepalaan <f@230.to>2013-09-13 10:42:16 +0300
committerFilipp Lepalaan <f@230.to>2013-09-13 10:42:16 +0300
commitea99def3781fe7ca8b81190996815e1951d395bb (patch)
treed2b981cf5a1a7542895f2cce991e7e2d76a8572a /gsxws
parent273ed82b3222b106717936ecc29d6736f62216e2 (diff)
downloadpy-gsxws-ea99def3781fe7ca8b81190996815e1951d395bb.tar.gz
py-gsxws-ea99def3781fe7ca8b81190996815e1951d395bb.tar.bz2
py-gsxws-ea99def3781fe7ca8b81190996815e1951d395bb.zip
Define IMAGE_URL as a module-level variable
Diffstat (limited to 'gsxws')
-rw-r--r--gsxws/parts.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/gsxws/parts.py b/gsxws/parts.py
index 1d21165..acf9957 100644
--- a/gsxws/parts.py
+++ b/gsxws/parts.py
@@ -6,6 +6,7 @@ import tempfile
from lookups import Lookup
from core import GsxObject, GsxError
+IMAGE_URL = "https://km.support.apple.com.edgekey.net/kb/imageService.jsp?image=%s"
class Part(GsxObject):
"""
@@ -26,7 +27,7 @@ class Part(GsxObject):
raise GsxError("Cannot fetch part image without part number")
image = "%s_350_350.gif" % self.partNumber
- url = "https://km.support.apple.com.edgekey.net/kb/imageService.jsp?image=%s" % image
+ url = IMAGE_URL % image
tmpfile = tempfile.mkstemp(suffix=image)
try:
@@ -41,5 +42,5 @@ if __name__ == '__main__':
import logging
from core import connect
logging.basicConfig(level=logging.DEBUG)
- connect(*sys.argv[1:5])
+ connect(*sys.argv[1:])
doctest.testmod()