aboutsummaryrefslogtreecommitdiffstats
path: root/gsxws/products.py
diff options
context:
space:
mode:
authorFilipp Lepalaan <f@230.to>2013-05-16 13:14:25 +0300
committerFilipp Lepalaan <f@230.to>2013-05-16 13:14:25 +0300
commit11aa80276200a8a5912892cf74d60f0e480bda7c (patch)
treeb24b7b033c69b5293e07fd695e05b5a35e84f88c /gsxws/products.py
parent2d94ab17b2fa7dca9e81023e4194dccfc9d45d1a (diff)
downloadpy-gsxws-11aa80276200a8a5912892cf74d60f0e480bda7c.tar.gz
py-gsxws-11aa80276200a8a5912892cf74d60f0e480bda7c.tar.bz2
py-gsxws-11aa80276200a8a5912892cf74d60f0e480bda7c.zip
Add full path to products.yaml
Diffstat (limited to 'gsxws/products.py')
-rw-r--r--gsxws/products.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/gsxws/products.py b/gsxws/products.py
index 3de7cfc..38f5b01 100644
--- a/gsxws/products.py
+++ b/gsxws/products.py
@@ -1,8 +1,6 @@
"""
https://gsxwsut.apple.com/apidocs/ut/html/WSAPIChangeLog.html?user=asp
"""
-
-import sys
import urllib
from lookups import Lookup
@@ -13,10 +11,12 @@ from core import GsxObject, GsxError
def models():
"""
>>> models() # doctest: +ELLIPSIS
- {'iPad': {'models': 'iPad iPad (3rd gen)...
+ {'iphone_acc': {'models': 'Bluetooth Headset',...
"""
+ import os
import yaml
- return yaml.load(open("products.yaml"))
+ filepath = os.path.join(os.path.dirname(__file__), "products.yaml")
+ return yaml.load(open(filepath, 'r'))
class Product(GsxObject):
@@ -112,6 +112,7 @@ class Product(GsxObject):
if __name__ == '__main__':
+ import sys
import doctest
import logging
from core import connect