diff options
| author | Bobby <[email protected]> | 2022-12-02 20:30:41 -0500 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-12-02 20:30:41 -0500 |
| commit | b035d592e4afa2f824211eccd52f3c2bc9746bc7 (patch) | |
| tree | 74b5052e075561fcdb51b977abb5fe0316f25b2a | |
| parent | 1e92e76fedcbb37781131c4d909b4baace704579 (diff) | |
| parent | 8192a2265bfbc294e5091b01e8ec879de49efd25 (diff) | |
| download | RedditEngagementPrediction-b035d592e4afa2f824211eccd52f3c2bc9746bc7.tar.xz RedditEngagementPrediction-b035d592e4afa2f824211eccd52f3c2bc9746bc7.zip | |
Merge pull request #12 from luciferreeves/main
remove data download popup
| -rw-r--r-- | src/app.py | 17 |
1 files changed, 6 insertions, 11 deletions
@@ -15,18 +15,13 @@ def fetch_data(): return downloader.posts if DatabaseHandler().read().empty: - # show a message box - response = tkinter.messagebox.askokcancel('No Data Found', 'No data found in database. Do you want to fetch data from Reddit?', icon='warning') + posts = fetch_data() + # ask if user wants to save the data + response = tkinter.messagebox.askokcancel('Save Data', 'Do you want to save the data for future use?', icon='warning') + posts = pd.DataFrame(posts) + posts = Preprocessor(posts).get_preprocessed_data() if response: - posts = fetch_data() - # ask if user wants to save the data - root = tkinter.Tk() - root.withdraw() - response = tkinter.messagebox.askokcancel('Save Data', 'Do you want to save the data for future use?', icon='warning') - posts = pd.DataFrame(posts) - posts = Preprocessor(posts).get_preprocessed_data() - if response: - DatabaseHandler().write(posts) + DatabaseHandler().write(posts) else: posts = DatabaseHandler().read() |
