143 for rec in csv.reader(open(os.path.join(os.curdir, ’subdivision1.csv’),
’rb’), delimiter=’;’):
144 subdivision[rec[0]] = Subdivision(rec[0])
145 if rec[1]:
146 subdivision[rec[1]].addSubdivision(subdivision[rec[0]])
147 else:
148 telephoneDir = TelephoneDir(Telephones(TelephoneTypes()),
subdivision[rec[0]])
149
150 telephones, telephoneTypes, collaborators = {}, {}, {}
151 for rec in csv.reader(open(os.path.join(os.curdir, ’ssu1.csv’), ’rb’),
delimiter=’;’):
152 if rec[6] not in telephoneTypes:
153 telephoneTypes[rec[6]] = TelephoneType(rec[6])
154 telephoneDir.telephones.telephoneTypes.add(telephoneTypes[rec[6]])
155 if rec[0] not in telephones:
156 telephones[rec[0]] = Telephone(rec[0], telephoneTypes[rec[6]])
157 telephoneDir.telephones.add(telephones[rec[0]])
158 key = int(rec[1])
159 if key not in collaborators:
160 collaborators[key] = Collaborator(key, rec[2], rec[3], rec[4])
161 subdivision[rec[5]].add(collaborators[key])
162 telephoneDir.add(TelephoneRecord(telephones[rec[0]],
collaborators[key]))
163
164 for s in telephoneDir.subdivision.iterSubdivision():
165 if s.name == ’помощник проректора’: