[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#57168] [PATCH 12/14] marionette: Improve the error message of 'wait
From: |
Maxim Cournoyer |
Subject: |
[bug#57168] [PATCH 12/14] marionette: Improve the error message of 'wait-for-screen-text'. |
Date: |
Sat, 13 Aug 2022 02:54:31 -0400 |
* gnu/build/marionette.scm (wait-for-screen-text): Return the last OCR'd text
when the predicate fails to match instead of the not useful predicate object.
---
gnu/build/marionette.scm | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/gnu/build/marionette.scm b/gnu/build/marionette.scm
index 4f409166db..24170bbd30 100644
--- a/gnu/build/marionette.scm
+++ b/gnu/build/marionette.scm
@@ -1,6 +1,7 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2016-2022 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2018 Chris Marusich <cmmarusich@gmail.com>
+;;; Copyright © 2022 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -308,13 +309,14 @@ (define start
(define end
(+ start timeout))
- (let loop ()
+ (let loop ((last-text #f))
(if (> (car (gettimeofday)) end)
- (error "'wait-for-screen-text' timeout" predicate)
- (or (predicate (marionette-screen-text marionette #:ocrad ocrad))
- (begin
- (sleep 1)
- (loop))))))
+ (error "'wait-for-screen-text' timeout" 'ocr-text: last-text)
+ (let ((text (marionette-screen-text marionette #:ocrad ocrad)))
+ (or (predicate text)
+ (begin
+ (sleep 1)
+ (loop text)))))))
(define %qwerty-us-keystrokes
;; Maps "special" characters to their keystrokes.
--
2.36.1
- [bug#57168] [PATCH 00/14] Add a LightDM service., Maxim Cournoyer, 2022/08/13
- [bug#57168] [PATCH 01/14] services: configuration: Add a 'maybe-value-set?' procedure., Maxim Cournoyer, 2022/08/13
- [bug#57168] [PATCH 07/14] gnu: lightdm-gtk-greeter: Adjust default config file path., Maxim Cournoyer, 2022/08/13
- [bug#57168] [PATCH 02/14] gnu: accountsservice: Update to 22.08.8, enable doc and test suite., Maxim Cournoyer, 2022/08/13
- [bug#57168] [PATCH 06/14] gnu: lightdm-gtk-greeter: Enable libklavier support., Maxim Cournoyer, 2022/08/13
- [bug#57168] [PATCH 03/14] gnu: accountsservice: Provide a means to locate extensions., Maxim Cournoyer, 2022/08/13
- [bug#57168] [PATCH 14/14] services: Add lightdm-service-type., Maxim Cournoyer, 2022/08/13
- [bug#57168] [PATCH 08/14] gnu: lightdm-gtk-greeter: Adjust --enable-at-spi-command value., Maxim Cournoyer, 2022/08/13
- [bug#57168] [PATCH 12/14] marionette: Improve the error message of 'wait-for-screen-text'.,
Maxim Cournoyer <=
- [bug#57168] [PATCH 10/14] gnu: lightdm: Apply patch to allow using VNC options., Maxim Cournoyer, 2022/08/13
- [bug#57168] [PATCH 09/14] gnu: lightdm: Apply patch to fix a problem with VNC integration., Maxim Cournoyer, 2022/08/13
- [bug#57168] [PATCH 11/14] gnu: lightdm: Apply patch to fix color depth issue with VNC., Maxim Cournoyer, 2022/08/13
- [bug#57168] [PATCH 04/14] gnu: lightdm-gtk-greeter: Add GDK_PIXBUF_MODULE_FILE to wrapper., Maxim Cournoyer, 2022/08/13
- [bug#57168] [PATCH 05/14] gnu: lightdm-gtk-greeter: Use the glib-or-gtk-wrap phase as-is., Maxim Cournoyer, 2022/08/13
- [bug#57168] [PATCH 13/14] build: marionette: Add support for Tesseract OCR., Maxim Cournoyer, 2022/08/13