Report Dispatch Document¶
file:¶
reportDispatcher/reportDispatch.py
includes:¶
configReader.py
getFileList.py
reportCleanup.py
reportNameGen.py
production.cfg
to do:¶
clean up the input file.
remove any print statements.
document code
Notes¶
Program iterates through a list of inputfiles created by getFileList.py and creates .pdf files from the raw output of the printed file on the genisys server. It then names the newly created file based on the keystrokes to generate the report, the report store, the report name and the date. The program will move the .pdf to a specified directroy listed in the production.cfg file.
Object Oriented. The report Object is setup with defaults to handle a report that is not in the config.
class Report:
def __init__(self, inputFile):
# File to create the object from
self.inputFile = open(inputFile)
# Container to keep the attributes in
self.container = []
# Initial report type
self.reportType = None
# Initial report name
self.reportName = None
# Current Month for report name
self.reportDate = datetime.now().strftime('%m_%y')
# Access Keystokes
self.accessKeys = 'N_A'
# Report Output dir. Default is set here. If there isnt a record in the config file this is where the report will go
# testing Dir comment line below for production
#self.outputDir = '/usr/home/jeremy/reportDispatcher/testMisc/'
# Production directory. Uncomment Below for productoin
self.outputDir = '/srv/office/Misc_Reports/'
# Report complete output name.
self.outputName = None
# Report Store Location
self.reportStoreLocation = 'RPT'
self.setReportStoreLocation()
self.setReportType()
self.setReportName(self.reportType)
self.setAttributes()
Reading the raw printer file and pulling data with setter methods will override these values.
Currently i have a find script that runs to delete any input files. Trying a reportCleanup() on the inputfile instead.