Release 1.0.0
This commit is contained in:
+20
@@ -0,0 +1,20 @@
|
||||
from pprint import pprint
|
||||
import csv
|
||||
from localconfig import OFFICESFILE
|
||||
|
||||
class Offices():
|
||||
def __init__(self):
|
||||
'''
|
||||
Get the country - office detail from disk
|
||||
|
||||
'''
|
||||
self.offices = {}
|
||||
with open(OFFICESFILE, newline="", encoding="utf-8") as f_in:
|
||||
reader = csv.DictReader(f_in)
|
||||
for row in reader:
|
||||
self.offices[row['Country']] = row
|
||||
|
||||
def get_office_details(self, country):
|
||||
if country in self.offices.keys():
|
||||
return self.offices[country]
|
||||
return {'Name': '?', 'PartyId':'?', 'City': '?'}
|
||||
Reference in New Issue
Block a user