diff options
author | Filipp Lepalaan <f@230.to> | 2013-05-16 13:14:25 +0300 |
---|---|---|
committer | Filipp Lepalaan <f@230.to> | 2013-05-16 13:14:25 +0300 |
commit | 11aa80276200a8a5912892cf74d60f0e480bda7c (patch) | |
tree | b24b7b033c69b5293e07fd695e05b5a35e84f88c | |
parent | 2d94ab17b2fa7dca9e81023e4194dccfc9d45d1a (diff) | |
download | py-gsxws-11aa80276200a8a5912892cf74d60f0e480bda7c.tar.gz py-gsxws-11aa80276200a8a5912892cf74d60f0e480bda7c.tar.bz2 py-gsxws-11aa80276200a8a5912892cf74d60f0e480bda7c.zip |
Add full path to products.yaml
-rw-r--r-- | gsxws/products.py | 9 | ||||
-rw-r--r-- | gsxws/products.yaml | 2 |
2 files changed, 6 insertions, 5 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 diff --git a/gsxws/products.yaml b/gsxws/products.yaml index 5451d36..c3f5ffe 100644 --- a/gsxws/products.yaml +++ b/gsxws/products.yaml @@ -67,7 +67,7 @@ ipad: iPad mini Wi-Fi, Cellular iPad mini Wi-Fi, Cellular (MM) -phone: +iphone: name: iPhone models: iPhone |