diff options
Diffstat (limited to 'src/ee/digikey')
-rw-r--r-- | src/ee/digikey/__init__.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/ee/digikey/__init__.py b/src/ee/digikey/__init__.py index 1315f96..23569f9 100644 --- a/src/ee/digikey/__init__.py +++ b/src/ee/digikey/__init__.py @@ -93,11 +93,13 @@ class DigikeyProduct(object): def to_ini(self): c = configparser.ConfigParser() - c["overview"] = {}; overview = c["overview"] + c["overview"] = {}; + overview = c["overview"] overview["part_number"] = self.part_number if self.mpn: overview["mpn"] = self.mpn - c["attributes"] = {}; attributes = c["attributes"] + c["attributes"] = {}; + attributes = c["attributes"] for a in self.attributes: key = "{}/{}".format(a.attribute_type.id, a.attribute_type.label) key = key.replace("%", "_") @@ -112,7 +114,6 @@ class DigikeyProduct(object): overview = c["overview"] attributes = [] for k, value in c.items("attributes"): -# print("k={}".format(k)) (type_id, label) = DigikeyProduct.from_ini_r.match(k).groups() a_type = digikey.get_attribute_type(type_id, label) attributes.append(DigikeyAttributeValue(value, a_type)) @@ -291,6 +292,7 @@ class DigikeyClient(object): else: return DigikeySearchResponse(1, SearchResponseTypes.NO_MATCHES) + class DigikeyRepository(object): def __init__(self, digikey, path): self._digikey = digikey |