from slack_messenger import SlackMessenger if __name__ == '__main__': slack_messenger = SlackMessenger() # print(slack_messenger.test_post_on_hg_slack("testing...")) print(slack_messenger.upload_file_to_hg_fantasy_football_channel("reports/Things-Won't-Change(363515)/Things-Won't-Change(363515)_week-1_report.pdf"))
use_chosen_week_function() report_info = use_default_league_function() fantasy_football_report = report_info[0] selected_league_id = report_info[1] generated_report = fantasy_football_report.create_pdf_report() upload_file_to_google_drive_bool = bool(distutils.strtobool(config.get("Google_Drive_Settings", "google_drive_upload"))) upload_message = "" if upload_file_to_google_drive_bool: # upload pdf to google drive google_drive_uploader = GoogleDriveUploader(generated_report) upload_message = google_drive_uploader.upload_file() print(upload_message) post_to_slack_bool = bool(distutils.strtobool(config.get("Slack_Settings", "post_to_slack"))) if post_to_slack_bool: if selected_league_id == config.get("Fantasy_Football_Report_Settings", "humangeo_id"): slack_messenger = SlackMessenger() # post shareable link to uploaded google drive pdf on slack # print(slack_messenger.post_to_hg_fantasy_football_channel(upload_message)) # upload pdf report directly to slack print(slack_messenger.upload_file_to_hg_fantasy_football_channel(generated_report)) print("DONE!") else: print("{}\n".format(upload_message)) print("DONE!")