| 1 |
nino.borges |
561 |
"""
|
| 2 |
|
|
|
| 3 |
|
|
HPPR_ReportParser.py
|
| 4 |
|
|
|
| 5 |
|
|
This program will take a history export from the HPPR and parse and hten make a spreadsheet
|
| 6 |
|
|
with the results.
|
| 7 |
|
|
"""
|
| 8 |
|
|
|
| 9 |
|
|
|
| 10 |
|
|
class DB_View:
|
| 11 |
|
|
def __init__(self,begno):
|
| 12 |
|
|
self.BegNo = begno
|
| 13 |
|
|
def ReturnInformation(self,info):
|
| 14 |
|
|
data = getattr(self,info)
|
| 15 |
|
|
return data
|
| 16 |
|
|
def SaveInformation(self,field,info):
|
| 17 |
|
|
data = setattr(self,field,info)
|
| 18 |
|
|
|
| 19 |
|
|
class DB_Print:
|
| 20 |
|
|
def __init__(self,begno):
|
| 21 |
|
|
self.BegNo = begno
|
| 22 |
|
|
def ReturnInformation(self,info):
|
| 23 |
|
|
data = getattr(self,info)
|
| 24 |
|
|
return data
|
| 25 |
|
|
def SaveInformation(self,field,info):
|
| 26 |
|
|
data = setattr(self,field,info)
|
| 27 |
|
|
|
| 28 |
|
|
class DB_Query:
|
| 29 |
|
|
def __init__(self,begno):
|
| 30 |
|
|
self.BegNo = begno
|
| 31 |
|
|
def ReturnInformation(self,info):
|
| 32 |
|
|
data = getattr(self,info)
|
| 33 |
|
|
return data
|
| 34 |
|
|
def SaveInformation(self,field,info):
|
| 35 |
|
|
data = setattr(self,field,info)
|
| 36 |
|
|
|
| 37 |
|
|
if __name__ == '__main__':
|
| 38 |
|
|
reportFile = r"W:\Manny\Client\honeywell\HPPR\Don_report.dat"
|
| 39 |
|
|
contents = open(reportFile).readlines()
|
| 40 |
|
|
for line in contents:
|
| 41 |
|
|
line- line.replace("\n","")
|
| 42 |
|
|
line = line.split("|")
|
| 43 |
|
|
|