-
-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(Kontaktdaten GUI): fix for pressing Cancel Btn in Kontaktdaten GUI raised error #436
Conversation
Hier wie man es replizieren kann: Kontaktdaten.json ist nicht vorhanden Termin suchen drücken Kontakdaten ausfüllen kommt "Abbrechen" Falsche/Unnötige Fehlermeldung da ja abgebrochen kommtHier wie man es replizieren kann: Kontaktdaten.json ist nicht vorhanden Termin suchen drücken Kontakdaten ausfüllen kommt "Abbrechen" Falsche/Unnötige Fehlermeldung da ja abgebrochen kommt @Floskinner passt das so?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was mir erst jetzt noch allgemein aufgefallen ist, du schreibst in CamelCase, wobei man in Python eher snake_case schreibt. Zudem verwenden wir eigentlich nur deutsche Begriffe sofern sinnvoll / Deutsche Kommentare. Das haben wir am Anfang angefangen, dass wirklich jeder leicht verstehen kann was genau im Code passiert :) (siehe 127 )
Quelle: PEP 8
Function and Variable Names
Function names should be lowercase, with words separated by underscores as necessary to improve readability.Variable names follow the same convention as function names.
mixedCase is allowed only in contexts where that's already the prevailing style (e.g. threading.py), to retain backwards compatibility.
gui.py
Outdated
bDialogAborted = False | ||
if not os.path.isfile(self.pfad_kontaktdaten): | ||
self.kontaktdaten_erstellen(modus) | ||
|
||
bDialogAborted = not self.kontaktdaten_erstellen(modus) | ||
kontaktdaten = kontak_tools.get_kontaktdaten(self.pfad_kontaktdaten) | ||
|
||
# we need to check data if we got no dict or the dialog was aborted | ||
if bDialogAborted is True and not kontaktdaten: | ||
return {} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mit dem Bool wert wo du nun zurück bekommst würde ich anders umgehen:
bDialogAborted = False | |
if not os.path.isfile(self.pfad_kontaktdaten): | |
self.kontaktdaten_erstellen(modus) | |
bDialogAborted = not self.kontaktdaten_erstellen(modus) | |
kontaktdaten = kontak_tools.get_kontaktdaten(self.pfad_kontaktdaten) | |
# we need to check data if we got no dict or the dialog was aborted | |
if bDialogAborted is True and not kontaktdaten: | |
return {} | |
if not os.path.isfile(self.pfad_kontaktdaten): | |
if not self.kontaktdaten_erstellen(modus): | |
return {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sowas hatte ich auch bereits gedacht aber du kannst ja im Dialog auch ein File öffnen und dann cancel drücken, dann hat er ja bereits da neue File als referenz und zieht das auch ran für die Suche, ausser man will das nicht dann ist dein Change natürlich deutlich schöner ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah ok, ja ich weiß was du meinst
Aber ich glaube das ist bisschen komisch, wenn ich auf "Termin suchen" drücke, dann ne Datei Lade und dann sage "halt abbrechen". Dann sollte man ja auch abbrechen und nicht auf einmal die Suche starten :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stimmt 😁😁😁😁😁😁😁.
Werde es abändern
This reverts commit a6d16c9.
Buttons wurden nicht korrekt zurück gemeldet. @Floskinner
* feat(search): Wenn angebracht, pausiere Vermittlungscodes (#431) * fix(Kontaktdaten GUI): fix for pressing Cancel Btn in Kontaktdaten GUI raised error (#436) * Fix for pressing Cancel Btn in Kontaktdaten GUI raised error Hier wie man es replizieren kann: Kontaktdaten.json ist nicht vorhanden Termin suchen drücken Kontakdaten ausfüllen kommt "Abbrechen" Falsche/Unnötige Fehlermeldung da ja abgebrochen kommtHier wie man es replizieren kann: Kontaktdaten.json ist nicht vorhanden Termin suchen drücken Kontakdaten ausfüllen kommt "Abbrechen" Falsche/Unnötige Fehlermeldung da ja abgebrochen kommt @Floskinner passt das so? * Docstring added * syntax change * Revert "syntax change" This reverts commit a6d16c9. * syntax fix * Fix for reject() / accept() Buttons wurden nicht korrekt zurück gemeldet. @Floskinner * fix(gender): added Kind and Divers as gender options (#442) * Added Kind and Divers (#448) * feat(code gen GUI): Added 3 retries of SMS PIN (if attempt failed) (#432) * fix(log): Ensure tools/log paths are constructed portably (#454) On Linux, the backslash in "tools\log\" was not interpreted as path separator, so screenshots etc. ended up in the project's root directory, named "tools\log\<filename>". Now they are named "<filename>" and stored in the log-directory under tools. * Don't throw and show error if loading of data was cancelled by the user (#456) Co-authored-by: Juri <j.robl@osram.com> * feat(GUI): Sprachsupport, Usability (#455) * Update .gitignore Added venv * Documentation * added language support and minor improvements * documentation * Updated .gitignore * Update .gitignore Added venv Documentation added language support and minor improvements documentation Updated .gitignore * typos * Adapt postition zip-code hometown * fix(cookie-gen): Improve cookie generation / enter v-code with updated mouse simulation (#453) * Improve mouse simulation for cookies / enter code * Add requirements for mouse simulation * Remove unecessary import * Fix imports * Remove imports which doesnt work on M1 * Generate coordinates without numpy/scipy * Update move mouse by offsets func * Add func to move from source x,y to target x,y * Improve enter vermittlungscode * Add mouse movements to driver_enter_code() * Add second try if "Es ist ein unerwarteter Fehler aufgetreten" occurs * Update tools/its.py Co-authored-by: Tim Reibe <38082956+iamnotturner@users.noreply.github.com> * Update tools/its.py Co-authored-by: Tim Reibe <38082956+iamnotturner@users.noreply.github.com> * Update tools/its.py Co-authored-by: Tim Reibe <38082956+iamnotturner@users.noreply.github.com> * Update tools/its.py Co-authored-by: Tim Reibe <38082956+iamnotturner@users.noreply.github.com> * Update tools/its.py Co-authored-by: Tim Reibe <38082956+iamnotturner@users.noreply.github.com> * Update tools/its.py Co-authored-by: Tim Reibe <38082956+iamnotturner@users.noreply.github.com> * Update tools/its.py Co-authored-by: Tim Reibe <38082956+iamnotturner@users.noreply.github.com> * Update tools/its.py Co-authored-by: Tim Reibe <38082956+iamnotturner@users.noreply.github.com> * Update tools/its.py Co-authored-by: Tim Reibe <38082956+iamnotturner@users.noreply.github.com> * Update tools/its.py Co-authored-by: Tim Reibe <38082956+iamnotturner@users.noreply.github.com> * Update tools/its.py Co-authored-by: Tim Reibe <38082956+iamnotturner@users.noreply.github.com> * Update tools/its.py Co-authored-by: Tim Reibe <38082956+iamnotturner@users.noreply.github.com> * Update tools/its.py Co-authored-by: Tim Reibe <38082956+iamnotturner@users.noreply.github.com> * Fix ugly if * Update tools/its.py Co-authored-by: Tim Reibe <38082956+iamnotturner@users.noreply.github.com> * Update tools/its.py Co-authored-by: Tim Reibe <38082956+iamnotturner@users.noreply.github.com> Co-authored-by: Jonas Mock <jonasmock97@gmail.com> Co-authored-by: Tim Reibe <38082956+iamnotturner@users.noreply.github.com> * Added a minimum of 30 seconds for retry-sec/check-delay (#452) * refactor(search): Rotiere durch PLZs, anstatt Zufallswahl (#444) * feat(notify): added notification configuration to GUI (#463) * added notifications to GUI * added tabstops * Update tools/gui/qtkontakt.py Co-authored-by: Florian Glaser <58706771+Floskinner@users.noreply.github.com> Co-authored-by: Florian Glaser <58706771+Floskinner@users.noreply.github.com> * Workaround für Generierung von Vermittlungscodes (#459) * Update requirements * Replace code_anfordern() * Fix wait for server response before continue * Accept cookies * Add queue bypass * Add retry counter for fetching server response * Revert from HEAD to 7efe793. * Add selenium_code_anfordern() * Replace its.code_anfordern() * Add logging * Add specific error messages * Add mouse simulation * Enter char by char * Fix random v-code Co-authored-by: Jonas Mock <jonasmock97@gmail.com> * fix(bugs): small bugfixes, added selenium debugging port (#466) * fix(notifications GUI): Fix for KeyError "notifications" after click Kontaktdaten bearbeiten over GUI (#468) * Draft for Code gen over GUI first draft for running Code Gen over GUI * Update tools/gui/qtcodegen.py Co-authored-by: Florian Glaser <58706771+Floskinner@users.noreply.github.com> * Update tools/gui/qtcodegen.py Co-authored-by: Florian Glaser <58706771+Floskinner@users.noreply.github.com> * Update tools/gui/qtcodegen.py Co-authored-by: Florian Glaser <58706771+Floskinner@users.noreply.github.com> * Update qtcodegen.py * Thread cancel optimization break while loops if stop called * update now checking missing kontakt data showing dialog to generate kontaktdaten if not present * remove help icon * added CodeGEn Checkbox to Kontaktdaten for now it just simply adds a XXXX dummy code to prevent code validation error (since it is not yet known ) * Update qtcodegen.py * Update qtcodegen.py * Revert "added CodeGEn Checkbox to Kontaktdaten" This reverts commit 3bf7b6f. * added QtCodeGen to SubProcess added QtCodeGen to SubProcess because Impfterminservice is blocking the Thread for termination * adapted to mainline beta and further improvements READY to TEST * Update main.py * Update utils.py * Update qtcodegen.py hard exit if cancelled * Revert "Update main.py" This reverts commit 8f082c5. * file permission fix git update-index --chmod=+x main.py under windows * File permissin change revert * Update gui.py small rearrangment * Update tools/gui/qtcodegen.py THX Co-authored-by: Florian Glaser <58706771+Floskinner@users.noreply.github.com> * Update tools/gui/qtcodegen.py Co-authored-by: Florian Glaser <58706771+Floskinner@users.noreply.github.com> * Update tools/gui/qtcodegen.py Co-authored-by: Florian Glaser <58706771+Floskinner@users.noreply.github.com> * Update tools/gui/qtcodegen.py Co-authored-by: Florian Glaser <58706771+Floskinner@users.noreply.github.com> * keep all data kontaktdaten.json and just set a dummy code for code gen task Rework to keep all data in kontaktdaten.json and just set a dummy code for code gen task if not file is present. Also added checks if kontaktdaten edit fenster was cancelled to not run processes. Also do a full validation check on input also if mode CODE_GENERIEREN, to have a valid config file * Update gui.py Co-authored-by: Florian Glaser <58706771+Floskinner@users.noreply.github.com> * Update tools/gui/qtcodegen.py Co-authored-by: Florian Glaser <58706771+Floskinner@users.noreply.github.com> * Update gui.py Co-authored-by: Florian Glaser <58706771+Floskinner@users.noreply.github.com> * Update qtkontakt.py changes from @Floskinner added * Revert "Merge branch 'beta' into ownBeta" This reverts commit cb67518, reversing changes made to 7e719ec. * Revert "Revert "Merge branch 'beta' into ownBeta"" This reverts commit fe4d9f5. * logger conflicts with redirect of qtgui * added fix from TIm Reibe * Added 3 Input Dlg retries if SMS PIN was wrong Change allows a wrong input of smspin and if code failed to accept the pin will be asked again * Fix for keyerror in GUI (Kontaktdaten bearbeiten) with old file tools\gui\qtkontakt.py", line 362, in __lade_alle_werte if kontaktdaten['notifications']: KeyError: 'notifications' Co-authored-by: Florian Glaser <58706771+Floskinner@users.noreply.github.com> * fix missing add-data in create spec for version.txt * selenium-wire hooks for pyinstaller * feat(notifications): Fire notification as soon as an appointment was found (#474) * Added title to telegram notification message * Fire notification as soon as an appointment was found * Added possibility to move the mouse negative values (#458) * Added possibility to move the mouse negative values * - Refactored, moved mouse movement and path generation to own file mousemover.py * - Reordered imports * - Fix calls to move_mouse_to_coordinates Co-authored-by: Juri <j.robl@osram.com> * feat(GUI): Verbesserte Oberfläche im Modus CODE_GENERIEREN (#471) * Update .gitignore Added venv * Improved Kontaktdateneingabe (CodeGen)) Verbesserung der UX. Felder wurden deaktiviert, Ladefunktion unterstüzt nun CodeGen * select correct tab * typo * added default arguments * Improve selenium vcode generation (#480) * Add second try if "Es ist ein unerwarteter Fehler aufgetreten" * Improve selenium_code_anfordern * Close browser if error occurs * Fixed unable to locate element * Fix unable to locate element #2 * Fix 'CLogger' object has no attribute 'warning' * Prevent unable locate sms_verifizierung_h1 after successful request * Cleaned up main Co-authored-by: Jonas Mock <jonasmock97@gmail.com> * fix(seleniumwire): added chrome_options to selenium-wire, added selenium-wire certificates (#485) * added chrome_options to seleniumwire, pep8 changes * added seleniumwire certificates * fix(PR #480 crahsed GUI): added selenium code generation to GUI (#486) * Draft for Code gen over GUI first draft for running Code Gen over GUI * Update tools/gui/qtcodegen.py Co-authored-by: Florian Glaser <58706771+Floskinner@users.noreply.github.com> * Update tools/gui/qtcodegen.py Co-authored-by: Florian Glaser <58706771+Floskinner@users.noreply.github.com> * Update tools/gui/qtcodegen.py Co-authored-by: Florian Glaser <58706771+Floskinner@users.noreply.github.com> * Update qtcodegen.py * Thread cancel optimization break while loops if stop called * update now checking missing kontakt data showing dialog to generate kontaktdaten if not present * remove help icon * added CodeGEn Checkbox to Kontaktdaten for now it just simply adds a XXXX dummy code to prevent code validation error (since it is not yet known ) * Update qtcodegen.py * Update qtcodegen.py * Revert "added CodeGEn Checkbox to Kontaktdaten" This reverts commit 3bf7b6f. * added QtCodeGen to SubProcess added QtCodeGen to SubProcess because Impfterminservice is blocking the Thread for termination * adapted to mainline beta and further improvements READY to TEST * Update main.py * Update utils.py * Update qtcodegen.py hard exit if cancelled * Revert "Update main.py" This reverts commit 8f082c5. * file permission fix git update-index --chmod=+x main.py under windows * File permissin change revert * Update gui.py small rearrangment * Update tools/gui/qtcodegen.py THX Co-authored-by: Florian Glaser <58706771+Floskinner@users.noreply.github.com> * Update tools/gui/qtcodegen.py Co-authored-by: Florian Glaser <58706771+Floskinner@users.noreply.github.com> * Update tools/gui/qtcodegen.py Co-authored-by: Florian Glaser <58706771+Floskinner@users.noreply.github.com> * Update tools/gui/qtcodegen.py Co-authored-by: Florian Glaser <58706771+Floskinner@users.noreply.github.com> * keep all data kontaktdaten.json and just set a dummy code for code gen task Rework to keep all data in kontaktdaten.json and just set a dummy code for code gen task if not file is present. Also added checks if kontaktdaten edit fenster was cancelled to not run processes. Also do a full validation check on input also if mode CODE_GENERIEREN, to have a valid config file * Update gui.py Co-authored-by: Florian Glaser <58706771+Floskinner@users.noreply.github.com> * Update tools/gui/qtcodegen.py Co-authored-by: Florian Glaser <58706771+Floskinner@users.noreply.github.com> * Update gui.py Co-authored-by: Florian Glaser <58706771+Floskinner@users.noreply.github.com> * Update qtkontakt.py changes from @Floskinner added * Revert "Merge branch 'beta' into ownBeta" This reverts commit cb67518, reversing changes made to 7e719ec. * Revert "Revert "Merge branch 'beta' into ownBeta"" This reverts commit fe4d9f5. * logger conflicts with redirect of qtgui * added fix from TIm Reibe * Added 3 Input Dlg retries if SMS PIN was wrong Change allows a wrong input of smspin and if code failed to accept the pin will be asked again * Fix for keyerror in GUI (Kontaktdaten bearbeiten) with old file tools\gui\qtkontakt.py", line 362, in __lade_alle_werte if kontaktdaten['notifications']: KeyError: 'notifications' * fix(PR #480 crahsed GUI) Merged changes to GUI from : #480 Co-authored-by: Florian Glaser <58706771+Floskinner@users.noreply.github.com> * bugfix notifications not working in GUI (#487) * fix(master): merge master into beta (#490) * Update README.md * Update README.md * Create CONTRIBUTING.md * Update README.md * Update CONTRIBUTING.md * Added Kind and Divers (#437) Kind and Divers are now also selectable ,) * Revert "Added Kind and Divers (#437)" (#443) This reverts commit 996878c. * Update README.md Co-authored-by: Julius Jacobitz <47418007+JuliusJacobitz@users.noreply.github.com> Co-authored-by: IAmWebSA <webmaster@zutroll.de> Co-authored-by: haslersn <sebastian.hasler@gmx.net> Co-authored-by: IAmWebSA <webmaster@zutroll.de> Co-authored-by: Andreas Wachowski <andreas.wachowski@gmail.com> Co-authored-by: Genmutant <github@jurirobl.de> Co-authored-by: Juri <j.robl@osram.com> Co-authored-by: Alex <a.suhrkamp@gmx.de> Co-authored-by: Jonas Mock <info@jonasmock.de> Co-authored-by: Jonas Mock <jonasmock97@gmail.com> Co-authored-by: Timo <43381667+pancakeDevelopment@users.noreply.github.com> Co-authored-by: Marco Rombach <36333308+marcorombach@users.noreply.github.com> Co-authored-by: Florian Glaser <58706771+Floskinner@users.noreply.github.com> Co-authored-by: JuliusJacobitz <julius@jacobitz.de> Co-authored-by: Julius Jacobitz <47418007+JuliusJacobitz@users.noreply.github.com> Co-authored-by: Sebastian Nagel <nagels@informatik.uni-tuebingen.de>
Hier wie man es replizieren kann:
Kontaktdaten.json ist nicht vorhanden
Termin suchen drücken
Kontakdaten ausfüllen kommt
"Abbrechen"
Falsche/Unnötige Fehlermeldung da ja abgebrochen kommtHier wie man es replizieren kann:
Kontaktdaten.json ist nicht vorhanden
Termin suchen drücken
Kontakdaten ausfüllen kommt
"Abbrechen"
Falsche/Unnötige Fehlermeldung da ja abgebrochen kommt
@Floskinner passt das so?