Advertisement
MD500_Pilot

Untitled

May 30th, 2021
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.86 KB | None | 0 0
  1. class DriveManager:
  2. def __init__(self, hostname, log_file, remote_reports_active,
  3. notifications, pb, email, sms, new_drive, daily_update,
  4. per_plot, warnings, emails, phones, twilio_from, twilio_account,
  5. twilio_token, pb_api):
  6. self.hostname = hostname
  7. self.log_file = log_file
  8. self.remote_reports_active = remote_reports_active
  9. self.notifications = notifications
  10. self.pb = pb
  11. self.email = email
  12. self.sms = sms
  13. self.new_drive = new_drive
  14. self.daily_update = daily_update,
  15. self.per_plot = per_plot,
  16. self.warnings = warnings,
  17. self.emails = emails,
  18. self.phones = phones,
  19. self.twilio_from = twilio_from,
  20. self.twilio_account = twilio_account,
  21. self.twilio_token = twilio_token,
  22. self.pb_api = pb_api
  23.  
  24. @classmethod
  25. def read_configs(cls, hostname):
  26. with open ('drivemanager.yaml', 'r') as config:
  27. server = yaml.safe_load(config)
  28. return cls(
  29. hostname=server['hostname'],
  30. log_file=server['log_file'],
  31. remote_reports_active=server['remote_reports_active'],
  32. notifications=server['notifications'],
  33. pb=server['pb'],
  34. email=server['email'],
  35. sms=server['sms'],
  36. new_drive=server['new_drive'],
  37. daily_update=server['daily_update'],
  38. per_plot=server['per_plot'],
  39. warnings=server['warnings'],
  40. emails=server['emails'],
  41. phones=server['phones'],
  42. twilio_from=server['twilio_from'],
  43. twilio_account=server['twilio_account'],
  44. twilio_token=server['twilio_token'],
  45. pb_api=server['pb_api'])
  46.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement