Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class DriveManager:
- def __init__(self, hostname, log_file, remote_reports_active,
- notifications, pb, email, sms, new_drive, daily_update,
- per_plot, warnings, emails, phones, twilio_from, twilio_account,
- twilio_token, pb_api):
- self.hostname = hostname
- self.log_file = log_file
- self.remote_reports_active = remote_reports_active
- self.notifications = notifications
- self.pb = pb
- self.email = email
- self.sms = sms
- self.new_drive = new_drive
- self.daily_update = daily_update,
- self.per_plot = per_plot,
- self.warnings = warnings,
- self.emails = emails,
- self.phones = phones,
- self.twilio_from = twilio_from,
- self.twilio_account = twilio_account,
- self.twilio_token = twilio_token,
- self.pb_api = pb_api
- @classmethod
- def read_configs(cls, hostname):
- with open ('drivemanager.yaml', 'r') as config:
- server = yaml.safe_load(config)
- return cls(
- hostname=server['hostname'],
- log_file=server['log_file'],
- remote_reports_active=server['remote_reports_active'],
- notifications=server['notifications'],
- pb=server['pb'],
- email=server['email'],
- sms=server['sms'],
- new_drive=server['new_drive'],
- daily_update=server['daily_update'],
- per_plot=server['per_plot'],
- warnings=server['warnings'],
- emails=server['emails'],
- phones=server['phones'],
- twilio_from=server['twilio_from'],
- twilio_account=server['twilio_account'],
- twilio_token=server['twilio_token'],
- pb_api=server['pb_api'])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement