automate.py 822 B

12345678910111213141516171819202122232425262728293031
  1. from conf import PathConfig
  2. import os
  3. import shutil
  4. class Automate:
  5. 'Initialization Class for Automation'
  6. files = []
  7. def Init(self):
  8. Path = PathConfig( )
  9. FolderPaths = []
  10. Path.SetPath( )
  11. FolderPaths = Path.getPath( )
  12. return FolderPaths
  13. # print (FolderPaths)
  14. def GetFiles(self, paths):
  15. for file in os.listdir( paths[0] ):
  16. Automate.files.append( file )
  17. return Automate.files
  18. def copyFiles(self, paths):
  19. for file in os.listdir( paths[0] ):
  20. print ("File being moved -----> " + file)
  21. full_file_name = os.path.join( paths[0], file )
  22. if os.path.isfile(full_file_name):
  23. shutil.move( full_file_name, paths[1] )
  24. #shutil.copy( full_file_name, paths[1] )