conf.py 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. import xml.etree.ElementTree as ET
  2. class PathConfig:
  3. 'Configuration Class for File Paths'
  4. Original_Path = ""
  5. Moved_Path = ""
  6. #def __init__(self):
  7. # self.Original_Path = ''
  8. # self.Moved_Path = ''
  9. def SetPath(self):
  10. tree = ET.parse('configuration.xml')
  11. root = tree.getroot()
  12. #Get the folder path where the files are present
  13. path = root.find('Path')
  14. #PathConfig.filePaths.append(path.get('path1'))
  15. PathConfig.Original_Path = path.get('path1')
  16. #Get the folder path where files are to be moved
  17. move_path = root.find('MovePath')
  18. PathConfig.Moved_Path = move_path.get('path2')
  19. #PathConfig.filePaths.append(move_path.get('path2'))
  20. #for path in root:
  21. #PathConfig.filePaths.append(path.get('path1'))
  22. #PathConfig.filePaths.append(path.get('path2'))
  23. #print(path.get('path'))
  24. def get_Moved_Path(self):
  25. return PathConfig.Moved_Path
  26. def get_Original_Path(self):
  27. return PathConfig.Original_Path