Skip to content

Commit

Permalink
Added dialog to not scan for unsafe pictures
Browse files Browse the repository at this point in the history
  • Loading branch information
Allexio committed Apr 4, 2021
1 parent 64f8613 commit f7d27ae
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions src/fb_data_analyser.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from tkinter import Button, ttk, Tk, Label
from tkinter import ttk, Tk, Label
from tkinter.filedialog import askopenfilename
from tkinter.messagebox import showinfo, showerror
from tkinter.messagebox import showinfo, showerror, askyesno
from zipfile import ZipFile
import os
import time
Expand Down Expand Up @@ -94,6 +94,8 @@ def main():
update_status("Selecting a Facebook data zip file", status, root)
zip_path = file_picker()

skip_nudity_check = askyesno("Nudity Check?","Do you want to perform a nudity check on all your photos sent in messages? This task is very time consuming, so if you are sure that there are no compromising pictures, it is recommended that you select \"no\"")

info_text["text"] = "The tool is now running, this can take up to a few minutes, depending on the amount of data and speed of your computer."

update_status("Unzipping Facebook data archive", status, root)
Expand Down Expand Up @@ -155,8 +157,11 @@ def main():
user_data = parse_peer_group(user_data)
update_progress(progress, 1, root)

update_status("Scanning photos for unsafe content", status, root)
user_data = check_for_nudity(user_data)
if skip_nudity_check:
update_status("Scanning photos for unsafe content", status, root)
user_data = check_for_nudity(user_data)
else:
user_data["nbr_of_unsafe_photos"] = "Skipped"
update_progress(progress, 10, root)

update_status("Generating Report", status, root)
Expand All @@ -167,8 +172,9 @@ def main():
profile_picture_mover()
update_progress(progress, 3, root)

update_status("Moving Unsafe Pictures", status, root)
unsafe_photo_mover(user_data)
if skip_nudity_check:
update_status("Moving Unsafe Pictures", status, root)
unsafe_photo_mover(user_data)
update_progress(progress, 3, root)

update_status("Deleting Temporary Folder", status, root)
Expand All @@ -183,7 +189,6 @@ def update_status(new_status: str, label: Label, gui_root: Tk):
label["text"] = new_status
gui_root.update()
time.sleep(0.5) # wait half a sec so people can actually see the message


def update_progress(progress_bar: ttk.Progressbar, increment: int, gui_root: Tk):
progress_bar.step(increment)
Expand Down

0 comments on commit f7d27ae

Please sign in to comment.