예제 #1
0
 def emailIsNotValidPopup(self):
     invalid_window = sg.Window('Invalid Email',
                               [[sg.T(text='Invalid Email', size=(25, 1), justification="centered")],
                                [sg.B('OK'), sg.B(content.cancel())]])
     event = invalid_window.read()
     print(f"event: {event},")
     if content.cancel() in event:
         sys.exit(0)
     if "OK" in event:
         invalid_window.close()
         return True
     invalid_window.close()
예제 #2
0
 def firstWindow(cls):
     layout = [[sg.Text(content.fistWindowText(), size=modification.firsWindowSize(), justification="center", font=modification.firstWindowFontSize())],
               [sg.T("  " * 27), sg.Button("Weiter"), sg.Button(content.cancel())]]
     window = sg.Window("FoddCalendar 2.0 / FoodCalendarAutomat 1.0", layout=layout)
     while True:
         event, values = window.read()
         print(f"")
         if event in (None, "Nichts wie raus hier"):
             sys.exit(0)
         else:
             window.close()
             break
예제 #3
0
    def completeRun(self):
        print(f"complete run: 1")
        now_time = datetime.datetime(*time.localtime()[:6])
        print(f"complete run: 2")
        self.firstWindow()
        print(f"complete run: 3")
        self.site_scraper = self.fsLogin()
        print(f"complete run: 4")
        all_fs_events = self.site_scraper.allFsEvents()
        print(f"complete run: 5")
        self.google_connection = google_tools.MyGoogleCalendarConnection()
        print(f"complete run: 6")
        all_google_events = self.google_connection.fetchEvents(
            min_time=now_time)
        print(f"complete run: 7")
        new_events, maybe_changed_events, conflicting_events = google_tools.Event.compareFsWithGoogleEvents(
            all_fs_events, all_google_events)
        print(f"complete run: 8")
        scoll_able = sg.Column(layout=[[
            sg.Text(text=self.guiFinalNotification(
                new_events, maybe_changed_events, conflicting_events))
        ]])
        window = sg.Window(
            layout=[[scoll_able],
                    [sg.Button("Ok"),
                     sg.Button(content.cancel())]],
            title="Zusammenfassung")
        response = window.read()
        print(f"complete run: 10; response: {response}")

        if response[0] == "Ok":
            print(
                f"complete run: 11; darstellung von n,mc,ce: {(new_events, maybe_changed_events, conflicting_events)}"
            )
            duplikate_free_events = google_tools.Event.stripDuplicates(
                maybe_changed_events, conflicting_events, all_google_events)
            all_events = [*new_events, *duplikate_free_events]
            self.google_connection.createEvents(all_events)