aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFilipp Lepalaan <filipp@mac.com>2014-10-18 13:02:25 +0300
committerFilipp Lepalaan <filipp@mac.com>2014-10-18 13:02:25 +0300
commit6181140aa557f222856f4bd1d6107baaf6f3191b (patch)
treea2b23b57f76e5072cb9b0b968a3bc8bbe61deed5
parentdb7685c4e2d3e60b1038ffd546a7bb9e57633ae4 (diff)
downloadpy-gsxws-6181140aa557f222856f4bd1d6107baaf6f3191b.tar.gz
py-gsxws-6181140aa557f222856f4bd1d6107baaf6f3191b.tar.bz2
py-gsxws-6181140aa557f222856f4bd1d6107baaf6f3191b.zip
Cleanup
-rw-r--r--gsxws/core.py56
1 files changed, 29 insertions, 27 deletions
diff --git a/gsxws/core.py b/gsxws/core.py
index 0940d75..e1e5a50 100644
--- a/gsxws/core.py
+++ b/gsxws/core.py
@@ -59,32 +59,32 @@ GSX_REGIONS = (
)
GSX_TIMEZONES = (
- ('PST', "UTC - 8h (Pacific Standard Time)"),
- ('PDT', "UTC - 7h (Pacific Daylight Time)"),
- ('CST', "UTC - 6h (Central Standard Time)"),
- ('CDT', "UTC - 5h (Central Daylight Time)"),
- ('EST', "UTC - 5h (Eastern Standard Time)"),
- ('EDT', "UTC - 4h (Eastern Daylight Time)"),
- ('GMT', "UTC (Greenwich Mean Time)"),
- ('CET', "UTC + 1h (Central European Time)"),
- ('CEST', "UTC + 2h (Central European Summer Time)"),
- ('USZ1', "UTC + 3h (Kaliningrad Time)"),
- ('MSK', "UTC + 4h (Moscow Time)"),
- ('IST', "UTC + 5.5h (Indian Standard Time)"),
- ('YEKST', "UTC + 6h (Yekaterinburg Time)"),
- ('OMSST', "UTC + 7h (Omsk Time)"),
- ('KRAST', "UTC + 8h (Krasnoyarsk Time)"),
- ('CCT', "UTC + 8h (Chinese Coast Time)"),
- ('IRKST', "UTC + 9h (Irkutsk Time)"),
- ('JST', "UTC + 9h (Japan Standard Time)"),
- ('YAKST', "UTC + 10h (Yakutsk Time)"),
- ('AEST', "UTC + 10h (Australian Eastern Standard Time)"),
- ('VLAST', "UTC + 11h (Vladivostok 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)"),
- ('MAGST', "UTC + 12h (Magadan Time)"),
+ ('PST', "UTC - 8h (Pacific Standard Time)"),
+ ('PDT', "UTC - 7h (Pacific Daylight Time)"),
+ ('CST', "UTC - 6h (Central Standard Time)"),
+ ('CDT', "UTC - 5h (Central Daylight Time)"),
+ ('EST', "UTC - 5h (Eastern Standard Time)"),
+ ('EDT', "UTC - 4h (Eastern Daylight Time)"),
+ ('GMT', "UTC (Greenwich Mean Time)"),
+ ('CET', "UTC + 1h (Central European Time)"),
+ ('CEST', "UTC + 2h (Central European Summer Time)"),
+ ('USZ1', "UTC + 3h (Kaliningrad Time)"),
+ ('MSK', "UTC + 4h (Moscow Time)"),
+ ('IST', "UTC + 5.5h (Indian Standard Time)"),
+ ('YEKST', "UTC + 6h (Yekaterinburg Time)"),
+ ('OMSST', "UTC + 7h (Omsk Time)"),
+ ('KRAST', "UTC + 8h (Krasnoyarsk Time)"),
+ ('CCT', "UTC + 8h (Chinese Coast Time)"),
+ ('IRKST', "UTC + 9h (Irkutsk Time)"),
+ ('JST', "UTC + 9h (Japan Standard Time)"),
+ ('YAKST', "UTC + 10h (Yakutsk Time)"),
+ ('AEST', "UTC + 10h (Australian Eastern Standard Time)"),
+ ('VLAST', "UTC + 11h (Vladivostok 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)"),
+ ('MAGST', "UTC + 12h (Magadan Time)"),
)
REGION_CODES = ('apac', 'am', 'la', 'emea',)
@@ -322,7 +322,7 @@ class GsxRequest(object):
return ET.tostring(self.env)
def __str__(self):
- return unicode(self).encode('utf-8')
+ return unicode(self).encode('utf-8')
class GsxObject(object):
@@ -379,6 +379,8 @@ class GsxObject(object):
"Shortcut for submitting a GsxObject"
self._req = GsxRequest(**{arg: self})
result = self._req._submit(method, ret, raw)
+ if result is None:
+ raise GsxError('GSX request returned empty result')
return result if len(result) > 1 else result[0]
def to_xml(self, root):