From: Sahithi Yarlagadda <sahi@swecha.net>
To: Ricardo Wurmus <rekado@elephly.net>
Cc: guix-devel <guix-devel@gnu.org>
Subject: Re: Next steps
Date: Sat, 30 Jun 2018 04:21:11 +0530 [thread overview]
Message-ID: <7769bf50-f0bd-8698-d40b-20fbcd005b2a@swecha.net> (raw)
In-Reply-To: <87k1qmmx0m.fsf@elephly.net>
[-- Attachment #1: Type: text/plain, Size: 1618 bytes --]
Hi
>> a spinning animation. For each line the animation could be advanced by
>> one (so it will spin really fast).
>>
>> Danny previously suggested this implementation:
>>
>> https://lists.gnu.org/archive/html/guix-patches/2017-07/msg00068.html
I have tried the Spinner code and it worked fine for me
https://paste.debian.net/1031385/
I used usleep so that I could to see the characters spinning with a
little delay to understand the code.
I tried to use the same for ui.scm, the i replaced str with
spinner-port in handle-string code. I got the following
15fb4d0>#<output: file 15fb4d0>#<output: file 15fb4d0>#<output: file
15fb4d0>#<output: file 15fb4d0>
I understood that i am working on a softport and unable to figure out
how to pass the string without invoking the display/write. I took a lot
of time and failed.
Here comes the actual part,
Later i discussed with #ArneBab in #guile who helped be finish the code.
I felt that invoking the spinner each time a string is triggered would
be sufficient and it doesnt matter whatever might be the string apart
from the expressions which are colorized, so went on to write the code
which i am submitting as a patch. For this i had to try a lot of new
syntaxes.
Now the spinner is working fine, build messages are colored and the
whole build process looks understandable to the user.
Actually im a bit excited!!!! to see the spinner code working and the
build output. Just wanted to share that to the community.
Please review the patch and push it to wip-sahithi if the progress is
correct.
> Have fun!
>
> --
> Ricardo
>
>
--
Regards
Sahithi
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-guix-Adding-Spinner-to-replace-the-Build-Messages.patch --]
[-- Type: text/x-patch; name="0001-guix-Adding-Spinner-to-replace-the-Build-Messages.patch", Size: 1321 bytes --]
From 9ff3dcf3a1f3b1b395659d956c15f07b5b028e38 Mon Sep 17 00:00:00 2001
From: Sahithi Yarlagadda <sahi@swecha.net>
Date: Sat, 30 Jun 2018 03:58:47 +0530
Subject: [PATCH] guix: Adding Spinner to replace the Build Messages.
* guix/ui.scm (handle-string): Calling the Spinner except for colored messages.
(spin-str): New variable.
---
guix/ui.scm | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/guix/ui.scm b/guix/ui.scm
index 88e5fa6b7..2bacffbf1 100644
--- a/guix/ui.scm
+++ b/guix/ui.scm
@@ -1662,8 +1662,9 @@ unmodified input string."
(colorize-string (match:substring m 5) 'RED))))
;; Didn’t match with any expression, returns back unmodified string.
- str)))
- (display message (current-error-port))))
+ (spin-str)
+ )))
+ (display (string-append (string #\backspace) message) (current-error-port))))
(define colorful-build-output-port
(make-soft-port
@@ -1677,5 +1678,12 @@ unmodified input string."
(lambda () (display "@" (current-error-port))))
"rw"))
+(define spin-str
+ (let ((chars (string->list "\\|/-"))
+ (index -1))
+ (lambda () (set! index (modulo (+ index 1)
+ (length chars)))
+ (list->string (list #\backspace(list-ref chars index) )))))
+
;;; ui.scm ends here
--
2.17.1
next prev parent reply other threads:[~2018-06-29 22:52 UTC|newest]
Thread overview: 68+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <8ea5d026-fab9-7b12-198e-610ad7743cb2@swecha.net>
[not found] ` <871sfxev9w.fsf@elephly.net>
[not found] ` <7626275c-3eee-bb05-ab9d-4c88ec6f0329@swecha.net>
[not found] ` <87r2nvjte6.fsf@elephly.net>
[not found] ` <5ab51417-b635-9725-9f48-3bc3f9b61fdf@swecha.net>
[not found] ` <87tvsko2wd.fsf@elephly.net>
[not found] ` <7290013c-990d-3f7d-d8db-38e090ed766a@swecha.net>
[not found] ` <87zi28kt82.fsf@elephly.net>
[not found] ` <8573e97d-d107-cde6-cd17-35f4ef6d2de3@swecha.net>
[not found] ` <87k1takumm.fsf@elephly.net>
[not found] ` <87o9hycwl6.fsf@elephly.net>
2018-05-11 21:16 ` Status of Submitted Patches Sahithi Yarlagadda
2018-05-11 22:21 ` Ricardo Wurmus
2018-05-12 7:50 ` Ricardo Wurmus
2018-05-15 17:41 ` Sahitihi
2018-05-20 9:40 ` Ricardo Wurmus
2018-05-20 10:47 ` Gábor Boskovits
2018-05-20 13:46 ` Ricardo Wurmus
2018-05-23 7:53 ` Sahitihi
2018-05-23 8:21 ` Ricardo Wurmus
2018-05-24 17:16 ` Sahitihi
2018-05-24 20:00 ` Ricardo Wurmus
2018-05-25 3:43 ` Sahitihi
2018-05-25 5:18 ` Ricardo Wurmus
2018-05-25 17:59 ` Patch file for colorize module Sahitihi
2018-05-26 6:06 ` Sahitihi
2018-05-26 9:35 ` Ricardo Wurmus
2018-05-26 12:06 ` Sahitihi
2018-05-26 14:16 ` Ricardo Wurmus
2018-05-26 18:22 ` Sahitihi
2018-05-26 18:38 ` Sahitihi
2018-05-26 21:20 ` Ricardo Wurmus
2018-05-27 15:49 ` Gábor Boskovits
2018-05-31 6:26 ` Fwd: " Ricardo Wurmus
2018-05-31 18:25 ` Sahitihi
2018-05-31 19:28 ` Ricardo Wurmus
2018-06-02 15:01 ` Ricardo Wurmus
2018-06-03 14:18 ` Sahitihi
2018-06-03 19:30 ` Ricardo Wurmus
2018-06-04 7:48 ` Sahitihi
2018-06-04 10:03 ` Ricardo Wurmus
2018-06-04 18:51 ` Sahitihi
2018-06-05 19:44 ` Ricardo Wurmus
2018-06-06 19:49 ` Sahitihi
2018-06-06 20:06 ` Ricardo Wurmus
2018-06-06 21:20 ` Sahitihi
2018-06-06 21:28 ` Ricardo Wurmus
2018-06-07 3:29 ` Sahitihi
2018-06-07 5:22 ` Ricardo Wurmus
2018-06-07 7:47 ` Sahitihi
2018-06-07 8:25 ` Ricardo Wurmus
2018-06-08 17:01 ` Sahitihi
2018-06-09 0:57 ` Ricardo Wurmus
2018-06-09 18:08 ` Sahitihi
2018-06-09 20:57 ` Ricardo Wurmus
2018-06-11 12:14 ` Sahitihi
2018-06-11 12:28 ` Gábor Boskovits
2018-06-11 16:21 ` Sahitihi
2018-06-12 14:12 ` Ricardo Wurmus
2018-06-12 21:06 ` Sahitihi
2018-06-12 22:12 ` Ricardo Wurmus
2018-06-13 16:08 ` Sahithi Yarlagadda
2018-06-13 19:15 ` Ricardo Wurmus
2018-06-15 20:16 ` Sahitihi
2018-06-15 21:47 ` Next steps Ricardo Wurmus
2018-06-16 14:55 ` Sahitihi
2018-06-21 11:05 ` Ricardo Wurmus
2018-06-21 16:54 ` Sahithi Yarlagadda
2018-06-25 20:13 ` Sahithi Yarlagadda
2018-06-25 20:28 ` Ricardo Wurmus
2018-06-26 20:01 ` Gábor Boskovits
2018-06-29 22:51 ` Sahithi Yarlagadda [this message]
2018-07-03 2:29 ` Sahithi Yarlagadda
2018-06-24 18:25 ` Sahithi Yarlagadda
2018-06-24 20:22 ` Ricardo Wurmus
2018-06-24 20:33 ` Sahithi Yarlagadda
2018-06-11 12:37 ` Fwd: Re: Patch file for colorize module Ricardo Wurmus
2018-06-11 16:31 ` Sahitihi
2018-06-04 11:41 ` Ludovic Courtès
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7769bf50-f0bd-8698-d40b-20fbcd005b2a@swecha.net \
--to=sahi@swecha.net \
--cc=guix-devel@gnu.org \
--cc=rekado@elephly.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.