automate.py 804 B

12345678910111213141516171819202122232425262728293031
  1. from conf import PathConfig
  2. import os
  3. import shutil
  4. class Automate:
  5. 'Initialization Class for Automation'
  6. def Init(self):
  7. Path = PathConfig( )
  8. FolderPaths = []
  9. Path.SetPath( )
  10. FolderPaths = Path.getPath()
  11. return FolderPaths
  12. # print (FolderPaths)
  13. def GetFiles(self, paths):
  14. files = []
  15. for file in os.listdir( paths ):
  16. files.append( file )
  17. return 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] )