-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprod2qual.py
More file actions
24 lines (18 loc) · 766 Bytes
/
Copy pathprod2qual.py
File metadata and controls
24 lines (18 loc) · 766 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import csv
import os
class Prod2Qual(object):
nom_fichier = "QAS_vs_PRD.csv"
def __init__(self, dossier_source):
self.actif = dossier_source.existe(self.nom_fichier)
if not self.actif:
return
self._client_conv = dict((kv["PRD"], kv["QAS"])
for kv in list(dossier_source.DictReader(self.nom_fichier)))
def traduire_code_client(self, code_client_prod):
assert self.actif
if self.code_client_existe(code_client_prod):
return self._client_conv[code_client_prod]
else:
return "XXX" + str(code_client_prod)
def code_client_existe(self, code_client_prod):
return code_client_prod in self._client_conv