From d182d60223c71915fdf16f8b3824aa02063f46ee Mon Sep 17 00:00:00 2001 From: Filipp Lepalaan Date: Thu, 16 May 2013 12:08:09 +0300 Subject: Added products.yaml --- gsxws/products.py | 23 ++++- gsxws/products.yaml | 258 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 277 insertions(+), 4 deletions(-) create mode 100644 gsxws/products.yaml (limited to 'gsxws') diff --git a/gsxws/products.py b/gsxws/products.py index b400ce7..3de7cfc 100644 --- a/gsxws/products.py +++ b/gsxws/products.py @@ -5,12 +5,20 @@ https://gsxwsut.apple.com/apidocs/ut/html/WSAPIChangeLog.html?user=asp import sys import urllib -import logging from lookups import Lookup from diagnostics import Diagnostics from core import GsxObject, GsxError +def models(): + """ + >>> models() # doctest: +ELLIPSIS + {'iPad': {'models': 'iPad iPad (3rd gen)... + """ + import yaml + return yaml.load(open("products.yaml")) + + class Product(GsxObject): "Something serviceable made by Apple" _namespace = "glob:" @@ -50,8 +58,13 @@ class Product(GsxObject): """ >>> Product('DGKFL06JDHJP').parts() # doctest: +ELLIPSIS [>> Product(productName='MacBook Pro (17-inch, Mid 2009)').parts() # doctest: +ELLIPSIS + [