aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFilipp Lepalaan <f@0x00.co>2013-04-09 11:43:12 +0300
committerFilipp Lepalaan <f@0x00.co>2013-04-09 11:43:12 +0300
commitef1d80ffa76cbf200ebaf55c39242264c5a8cab5 (patch)
treeb4fca713a24b87f7f2cbab28f28c44a76449d1a5
parenta7ea0d63824cf20a57ffe9243e0f85e8b6b725e2 (diff)
downloadpy-gsxws-ef1d80ffa76cbf200ebaf55c39242264c5a8cab5.tar.gz
py-gsxws-ef1d80ffa76cbf200ebaf55c39242264c5a8cab5.tar.bz2
py-gsxws-ef1d80ffa76cbf200ebaf55c39242264c5a8cab5.zip
Some minor tweaks
-rwxr-xr-xgsxws.py61
1 files changed, 33 insertions, 28 deletions
diff --git a/gsxws.py b/gsxws.py
index ccc0f18..8afd359 100755
--- a/gsxws.py
+++ b/gsxws.py
@@ -48,40 +48,40 @@ LOCALE = 'en_XXX'
CACHE = ObjectCache(minutes=20)
TIMEZONES = (
- ('GMT', 'UTC (Greenwich Mean Time)'),
- ('PDT', 'UTC - 7h (Pacific Daylight Time)'),
- ('PST', 'UTC - 8h (Pacific Standard Time)'),
- ('CDT', 'UTC - 5h (Central Daylight Time)'),
- ('CST', 'UTC - 6h (Central Standard Time)'),
- ('EDT', 'UTC - 4h (Eastern Daylight Time)'),
- ('EST', 'UTC - 5h (Eastern Standard Time)'),
- ('CEST', 'UTC + 2h (Central European Summer Time)'),
- ('CET', 'UTC + 1h (Central European Time)'),
- ('JST', 'UTC + 9h (Japan Standard Time)'),
- ('IST', 'UTC + 5.5h (Indian Standard Time)'),
- ('CCT', 'UTC + 8h (Chinese Coast Time)'),
- ('AEST', 'UTC + 10h (Australian Eastern Standard Time)'),
- ('AEDT', 'UTC + 11h (Australian Eastern Daylight Time)'),
- ('ACST', 'UTC + 9.5h (Austrailian Central Standard Time)'),
- ('ACDT', 'UTC + 10.5h (Australian Central Daylight Time)'),
- ('NZST', 'UTC + 12h (New Zealand Standard Time)'),
+ ('GMT', "UTC (Greenwich Mean Time)"),
+ ('PDT', "UTC - 7h (Pacific Daylight Time)"),
+ ('PST', "UTC - 8h (Pacific Standard Time)"),
+ ('CDT', "UTC - 5h (Central Daylight Time)"),
+ ('CST', "UTC - 6h (Central Standard Time)"),
+ ('EDT', "UTC - 4h (Eastern Daylight Time)"),
+ ('EST', "UTC - 5h (Eastern Standard Time)"),
+ ('CEST', "UTC + 2h (Central European Summer Time)"),
+ ('CET', "UTC + 1h (Central European Time)"),
+ ('JST', "UTC + 9h (Japan Standard Time)"),
+ ('IST', "UTC + 5.5h (Indian Standard Time)"),
+ ('CCT', "UTC + 8h (Chinese Coast Time)"),
+ ('AEST', "UTC + 10h (Australian Eastern Standard Time)"),
+ ('AEDT', "UTC + 11h (Australian Eastern Daylight Time)"),
+ ('ACST', "UTC + 9.5h (Austrailian Central Standard Time)"),
+ ('ACDT', "UTC + 10.5h (Australian Central Daylight Time)"),
+ ('NZST', "UTC + 12h (New Zealand Standard Time)"),
)
REGIONS = (
- ('002', 'Asia/Pacific'),
- ('003', 'Japan'),
- ('004', 'Europe'),
- ('005', 'United States'),
- ('006', 'Canadia'),
- ('007', 'Latin America'),
+ ('002', "Asia/Pacific"),
+ ('003', "Japan"),
+ ('004', "Europe"),
+ ('005', "United States"),
+ ('006', "Canadia"),
+ ('007', "Latin America"),
)
REGION_CODES = ('apac', 'am', 'la', 'emea',)
ENVIRONMENTS = (
- ('pr', 'Production'),
- ('ut', 'Development'),
- ('it', 'Testing'),
+ ('pr', "Production"),
+ ('ut', "Development"),
+ ('it', "Testing"),
)
def validate(value, what=None):
@@ -613,7 +613,6 @@ class Returns(GsxObject):
pdf = base64.b64decode(result.packingList)
of = tempfile.NamedTemporaryFile(suffix='.pdf', delete=False)
of.write(pdf)
-
result.packingList = of.name
return result
@@ -765,6 +764,7 @@ class Repair(GsxObject):
def lookup(self):
"""
+ Description:
The Repair Lookup API mimics the front-end repair search functionality.
It fetches up to 2500 repairs in a given criteria.
Subsequently, the extended Repair Status API can be used
@@ -909,6 +909,10 @@ class Product(GsxObject):
raise GsxError('Failed to fetch product image: %s' % e)
def init(env='ut', region='emea'):
+ """
+ Initialize the SOAP client
+ """
+
global CLIENT, REGION_CODES
envs = ('pr', 'it', 'ut',)
@@ -924,7 +928,8 @@ def init(env='ut', region='emea'):
url = url.format(env=hosts[env], region=region)
CLIENT = Client(url)
- CLIENT.options.cache.setduration(weeks=2)
+ cache = CLIENT.options.cache
+ cache.setduration(weeks=1)
def connect(
user_id,