Youfeng commited on
Commit
b7963ee
·
1 Parent(s): 9c3fb6c

update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -16,7 +16,7 @@ import pandas as pd
16
  from pathlib import Path
17
  import gradio as gr
18
 
19
- # %% slack_selenium_solution.ipynb 1
20
  class SlackAnalytics():
21
  def __init__(self,
22
  signin_url = 'https://thriveprojectgroup.slack.com/sign_in_with_password',
@@ -80,7 +80,7 @@ class SlackAnalytics():
80
  self.driver.quit()
81
 
82
 
83
- # %% slack_selenium_solution.ipynb 2
84
  class GoogleSheets():
85
  def __init__(self, creds_file='slack-analytics-creds.json', sh_file='gs_info.txt'):
86
  self.creds = creds_file
@@ -114,13 +114,13 @@ class GoogleSheets():
114
  wk.update([df.columns.values.tolist()] + df.values.tolist())
115
 
116
 
117
- # %% slack_selenium_solution.ipynb 6
118
  def run(account, creds_file, sh_file):
119
  SlackAnalytics().export_csv(account.name)
120
  GoogleSheets(creds_file.name, sh_file.name).update_worksheet()
121
  return 'Slack Analytics data update Google Sheets completed!'
122
 
123
- # %% slack_selenium_solution.ipynb 7
124
  iface = gr.Interface(fn=run,
125
  inputs=[gr.File(label='Slack Account File'),
126
  gr.File(label='Google Credentials Json File'),
@@ -129,4 +129,4 @@ iface = gr.Interface(fn=run,
129
  allow_flagging='never',
130
  title='Slack Analytics Members Data Getter',
131
  description='Download Slack analytics data From Slack and upload it to Google Sheets')
132
- iface.launch(height=450, width=500)
 
16
  from pathlib import Path
17
  import gradio as gr
18
 
19
+ # %% slack_selenium_solution.ipynb 2
20
  class SlackAnalytics():
21
  def __init__(self,
22
  signin_url = 'https://thriveprojectgroup.slack.com/sign_in_with_password',
 
80
  self.driver.quit()
81
 
82
 
83
+ # %% slack_selenium_solution.ipynb 3
84
  class GoogleSheets():
85
  def __init__(self, creds_file='slack-analytics-creds.json', sh_file='gs_info.txt'):
86
  self.creds = creds_file
 
114
  wk.update([df.columns.values.tolist()] + df.values.tolist())
115
 
116
 
117
+ # %% slack_selenium_solution.ipynb 7
118
  def run(account, creds_file, sh_file):
119
  SlackAnalytics().export_csv(account.name)
120
  GoogleSheets(creds_file.name, sh_file.name).update_worksheet()
121
  return 'Slack Analytics data update Google Sheets completed!'
122
 
123
+ # %% slack_selenium_solution.ipynb 8
124
  iface = gr.Interface(fn=run,
125
  inputs=[gr.File(label='Slack Account File'),
126
  gr.File(label='Google Credentials Json File'),
 
129
  allow_flagging='never',
130
  title='Slack Analytics Members Data Getter',
131
  description='Download Slack analytics data From Slack and upload it to Google Sheets')
132
+ iface.launch(height=450, width=500, debug=True)