conf.py 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. import xml.etree.ElementTree as ET
  2. class Config:
  3. 'Configuration Class for File Paths'
  4. Original_Path = ""
  5. Moved_Path = ""
  6. Dialogs = 0
  7. Trial = ""
  8. Share_Btn_X = 0
  9. Share_Btn_Y = 0
  10. Water_Mark_Btn_X = 0
  11. Water_Mark_Btn_Y = 0
  12. #def __init__(self):
  13. # self.Original_Path = ''
  14. # self.Moved_Path = ''
  15. def read_config(self):
  16. tree = ET.parse('configuration.xml')
  17. root = tree.getroot()
  18. #Get the folder path where the files are present
  19. path = root.find('Path')
  20. #PathConfig.filePaths.append(path.get('path1'))
  21. Config.Original_Path = path.get('path1')
  22. #Get the folder path where files are to be moved
  23. move_path = root.find('MovePath')
  24. Config.Moved_Path = move_path.get('path2')
  25. #Get the no. of dialogs screens during coversion
  26. no_screens = root.find('No_Screens')
  27. Config.Dialogs = no_screens.get('dialog')
  28. Config.Dialogs = int(Config.Dialogs)
  29. #Get if Camtasia has Trial license
  30. trial = root.find('TRIAL')
  31. Config.Trial = trial.get('trial')
  32. #Get the co-ordinates of the share button
  33. share_btn = root.find('Share_BTN_COOR')
  34. Config.Share_Btn_X = share_btn.get('x')
  35. Config.Share_Btn_X = int(Config.Share_Btn_X)
  36. Config.Share_Btn_Y = share_btn.get('y')
  37. Config.Share_Btn_Y = int(Config.Share_Btn_Y)
  38. #Get the co-ordinates Watermark
  39. watermark_btn = root.find('WATER_MARK_COOR')
  40. Config.Water_Mark_Btn_X = watermark_btn.get('x')
  41. Config.Water_Mark_Btn_X = int(Config.Water_Mark_Btn_X)
  42. Config.Water_Mark_Btn_Y = watermark_btn.get('y')
  43. Config.Water_Mark_Btn_Y = int(Config.Water_Mark_Btn_Y)
  44. def get_Moved_Path(self):
  45. return Config.Moved_Path
  46. def get_Original_Path(self):
  47. return Config.Original_Path