19 lines
556 B
Python
19 lines
556 B
Python
from pprint import pprint
|
|||
|
|
import csv
|
||
|
|
from localconfig import BUYERS_REPAIRED
|
||
|
|
|
||
|
|
class RepairedBuyers():
|
||
|
|
def __init__(self):
|
||
|
|
'''
|
||
|
|
Get the repaired buyers detail from disk
|
||
|
|
|
||
|
|
'''
|
||
|
|
self.buyers = {}
|
||
|
|
with open(BUYERS_REPAIRED, newline="", encoding="utf-8") as f_in:
|
||
|
|
reader = csv.DictReader(f_in)
|
||
|
|
for row in reader:
|
||
|
|
self.buyers[row['Invoice']] = row
|
||
|
|
|
||
|
|
def get_buyer_for(self, invoiceid):
|
||
|
|
if invoiceid in self.buyers.keys():
|
||
|
|
return self.buyers[invoiceid]
|