app.py 837 B

123456789101112131415161718192021222324252627282930313233
  1. from automate import Automate
  2. from BussinessLogic import business_logic
  3. from conf import Config
  4. from logger import log
  5. import sys
  6. #Globals
  7. Files=[]
  8. log = log()
  9. Auto = Automate()
  10. #Initializes from the configuration file
  11. log.logger.info('Initialization called')
  12. status = Auto.Init()
  13. if status == 0:
  14. log.logger.error('Initialization failed.Exiting application')
  15. Path = Config()
  16. #Copy the files from src path to dest path inorder to create a backup
  17. status = Auto.copyFiles(Path.Original_Path,Path.Moved_Path)
  18. if status == 0:
  19. log.logger.error('Copying files failed. Exiting Application')
  20. sys.exit(0)
  21. else:
  22. log.logger.info('File copy successfull')
  23. #Get the files from the dest folder to start the conversion process
  24. Files=Auto.GetFiles(Path.Moved_Path)
  25. bi = business_logic()
  26. for file in Files:
  27. bi.convert_files(file)