Skip to content

Commit 7ebc2cc

Browse files
committed
Merge branch 'master' of https://github.com/raykamp/digiprice
2 parents fd55474 + 196b47b commit 7ebc2cc

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

digiprice.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def main():
2626
# We can only process so many part numbers at a time
2727
partNumberBatches = list(chunks(arguments, MAX_QUERY_ITEMS))
2828

29-
retultsTable = ""
29+
resultsTable = ""
3030

3131
for partNumbers in partNumberBatches:
3232
# Build a query for the Octopart API
@@ -64,7 +64,7 @@ def main():
6464

6565
for idx, result in enumerate(response['results']):
6666
if len(result['items']) == 0:
67-
retultsTable += "%s \t No results found \n" % partNumbers[idx]
67+
resultsTable += "%s \t No results found \n" % partNumbers[idx]
6868
continue
6969

7070
quotes = [] # [[quantity, unitPrice], ...]
@@ -80,16 +80,16 @@ def main():
8080
print "Seller: %s" % item['offers'][0]['seller']['name']
8181
quotes.sort(key=lambda x: x['price']) # find lowest price
8282
if quantity >= 1000:
83-
retultsTable += "%s \t $%s \t @ \t %sk \n" % (quotes[0]['mpn'], quotes[0]['price'], quotes[0]['quantity']/1000)
83+
resultsTable += "%s \t $%s \t @ \t %sk \n" % (quotes[0]['mpn'], quotes[0]['price'], quotes[0]['quantity']/1000)
8484
else:
85-
retultsTable += "%s \t $%s \t @ \t %s \n" % (quotes[0]['mpn'], quotes[0]['price'], quotes[0]['quantity'])
85+
resultsTable += "%s \t $%s \t @ \t %s \n" % (quotes[0]['mpn'], quotes[0]['price'], quotes[0]['quantity'])
8686

87-
print retultsTable
87+
print resultsTable
8888

8989
def chunks(l, n):
9090
"""Yield successive n-sized chunks from l."""
9191
for i in range(0, len(l), n):
9292
yield l[i:i + n]
9393

9494
if __name__ == '__main__':
95-
main()
95+
main()

0 commit comments

Comments
 (0)