From 11aa80276200a8a5912892cf74d60f0e480bda7c Mon Sep 17 00:00:00 2001 From: Filipp Lepalaan Date: Thu, 16 May 2013 13:14:25 +0300 Subject: Add full path to products.yaml --- gsxws/products.py | 9 +++++---- gsxws/products.yaml | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'gsxws') 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 -- cgit v1.2.3