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 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'gsxws/products.py') 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 -- cgit v1.2.3