aboutsummaryrefslogtreecommitdiff
path: root/src/ee/digikey
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2017-09-30 23:10:47 +0200
committerTrygve Laugstøl <trygvis@inamo.no>2017-09-30 23:10:47 +0200
commitdbd1000240535771a45912a18b38ed240a4efa18 (patch)
tree819291a711ad5bd168c5b366af5f5ca9def14b28 /src/ee/digikey
parent122850d7a90428b6d7b92fe6100a1f2a6df2a1eb (diff)
downloadee-python-dbd1000240535771a45912a18b38ed240a4efa18.tar.gz
ee-python-dbd1000240535771a45912a18b38ed240a4efa18.tar.bz2
ee-python-dbd1000240535771a45912a18b38ed240a4efa18.tar.xz
ee-python-dbd1000240535771a45912a18b38ed240a4efa18.zip
o Reformat all.
Diffstat (limited to 'src/ee/digikey')
-rw-r--r--src/ee/digikey/__init__.py8
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