Re: UTF-8 progress bar

2023-01-28 Thread Akib Azmain Turja
Julien Lepiller  writes:

> Hi Guix!
>
> I have a patch waiting (https://issues.guix.gnu.org/59975) that will
> change progress bars to use some unicode characters. I think they look
> better, but I'm a bit afraid they might not look right on some config,
> so I'd like to know if your terminal is able to show these characters:
>
> "▏▎▍▌▋▊▉█▏▕"
>
> If you are not using a unicode locale, this change will not affect you
> as guix will fallback to the ascii style. If your terminal can't show
> these characters and you have a UTF-8 locale (you'd run echo $LANG to
> know that), please report your config (name of terminal app, locale,
> fonts, …)!
>

They won't work in Linux (kernel) console, despite $LANG="en_US.utf8".

-- 
Akib Azmain Turja, GPG key: 70018CE5819F17A3BBA666AFE74F0EFA922AE7F5
Fediverse: akib@hostux.social
Codeberg: akib
emailselfdefense.fsf.org | "Nothing can be secure without encryption."


signature.asc
Description: PGP signature


Re: ¿ How can I get qutebrowser to use Guix installed Python deps ?

2023-01-28 Thread jgart
Oops, ignore this one. I misread the backtrace. Qutebrowser can import from 
Guix installed Python packages just fine.



Re: Guix QA: trigger rebuild

2023-01-28 Thread Andy Tai
to answer this question: Guix QA can re-start a build if patch with
new version like [PATCH V2] sent tot eh issue email address og debbugs

On Sat, Jan 21, 2023 at 12:30 PM Andy Tai  wrote:
>
> Hi,  if Guix QA shows a patch build is failing and an updated patch
> has been sent, how to trigger the build to be restarted? Thanks for
> info



Re: guix lint false positives and RFC patch

2023-01-28 Thread Maxime Devos



On 28-01-2023 22:07, Vagrant Cascadian wrote:

The other thing I remember being caught up on, which was not a
deal-breaker, per se, was hoping for a way to loop through a bunch of
@SOMETHING things ... I was not happy with:

+(if (>= (string-length (string-replace-substring
+(string-replace-substring synopsis "@acronym" "")
+"@code" ""))
+   80)

And then adding @command, @file, @acronym, etc. ... using increasingly
nested levels string-replace-substring would eventually become difficult
to read and surely there is a better way!


How about some regex:

(define regexp
  (delay (make-regexp "@(code|acronym|file)\\b")))

(define example "stuff @acronym @code @file")
(regexp-substitute/global #f (force regexp) example 'pre "" 'post)

$4 = "stuff   ".


Greetings,
Maxime.


OpenPGP_0x49E3EE22191725EE.asc
Description: OpenPGP public key


OpenPGP_signature
Description: OpenPGP digital signature


Re: guix lint false positives and RFC patch

2023-01-28 Thread Vagrant Cascadian
On 2023-01-27, Simon Tournier wrote:
> On sam., 12 nov. 2022 at 17:54, Vagrant Cascadian  wrote:
>> On 2022-11-05, Ludovic Courtès wrote:
>>> Vagrant Cascadian  skribis:
 From bfa13fdd3616839883e50efbbc05fb132610ce67 Mon Sep 17 00:00:00 2001
 From: Vagrant Cascadian 
 Date: Wed, 2 Nov 2022 19:56:12 -0700
 Subject: [PATCH 01/12] guix: lint: Exclude some "@" symbols from various
  checks.

 The visual representation of "@code{}" or similar in the description and
 synopsis do not include the string, so exclude it from checks to avoid 
 false
 positives.

 FIXME handle @command, @file, @acronym, etc.

 * guix/linx.scm (properly-starts-sentence): Exclude leading "@".
   (check-synopsis-length): Exclude "@code" and "@acronym".
>>>
>>> LGTM!  Bonus points for a test in ‘tests/lint.scm’.  :-)
>>
>> No bonus points for me just yet...
>
> [...]
>
>> What is failing to match what here?
>
> Well, almost done but not merged, right?
>
> Still an issue this ’match’?

Thanks for bringing this back up to the surface! I struggled with it a
bit and honestly do not remember where I last left it... I think I made
some further progress... and then hit a new blocker and the sun went
down and slept on it ... and never got back to it.

So I was definitely stuck writing a test. From vague memory, I think
once I figured out how to have the test not fail wit guile complaining
inscrutibly... it did not effectively test the thing it was supposed to.

The other thing I remember being caught up on, which was not a
deal-breaker, per se, was hoping for a way to loop through a bunch of
@SOMETHING things ... I was not happy with:

+(if (>= (string-length (string-replace-substring
+(string-replace-substring synopsis "@acronym" "")
+"@code" ""))
+   80)

And then adding @command, @file, @acronym, etc. ... using increasingly
nested levels string-replace-substring would eventually become difficult
to read and surely there is a better way!

I might be able to take another look at this in february, but I would
welcome help wrapping this up regardless!

live well,
  vagrant


signature.asc
Description: PGP signature


¿ How can I get qutebrowser to use Guix installed Python deps ?

2023-01-28 Thread jgart
Hi Guixers,

How can I get qutebrowser to use Guix installed Python dependencies?

I'm able to install a python dep and load it in the repl but I can't import the 
dep into ~/.config/qutebrowser/config.py



Re: CLI flag to ignore guix channel

2023-01-28 Thread Csepp


Simon Tournier  writes:

> Hi,
>
> On jeu., 03 nov. 2022 at 21:51, jgart  wrote:
>
>> I'd like a CLI flag to be able to ignore channels.
>>
>> Where should I look if I'd like to implement something like this?
>>
>> I prefer not to edit and comment out channels in ~/.config/guix/channels.scm
>>
>> I'd prefer to do the following
>>
>> guix import crate behemoth-rust-package-foo -r --ignore-channel=guixrus
>
> Well, this would be nice but we have nothing in this direction.
>
> From my point of view, the best is to have several channels.scm files
> where some or other channels are defined.  Then, you switch using “guix
> time-machine”, for example:
>
> guix time-machine -C path/to/channels-wo-guixrus.scm \
>  -- import crate behemoth-rust-package-foo -r
>
> HTH,
> simon

How fast is that?  If new commits come in during time-machine
invocations, won't it keep doing new builds of guix?



Re: Struggling to write Dissecting Guix, Part 2

2023-01-28 Thread david larsson

On 2023-01-26 07:34, ( wrote:

On Wed Jan 25, 2023 at 7:39 PM GMT, david larsson wrote:

https://towardsdatascience.com/monads-from-the-lens-of-imperative-programmer-af1ab8c8790c


I'm not too sure about this one, I'm afraid.

-- (


What are you not too sure about?

There is also pseudo-code (so not python) version of it on Wikipedia 
that's almost identical: 
https://en.wikipedia.org/wiki/Monad_(functional_programming)#Program_logging


I thought the wikipedia version is kind of clearer mainly because it's a 
little more "complete"-feeling. I added some stuff myself to the first 
article making it more like the wikipedia, etc, the and attached it here 
if anyone's interested. That's still in python, but if I ever were to 
write a monad in guile, I'd almost certainly start with trying to 
translate this one.



Best regards,
David
from typing import Tuple
def square(num: int) -> int:
return num * num
def double(num: int) -> int:
return num + num
def square_with_print_return(num: int) -> Tuple[int, str]:
logs = "Currrent num " + str(num) + ". "
return (square(num), logs)
def double_with_print_return(num: int) -> Tuple[int, str]:
logs = "Currrent num " + str(num) + ". "
return (double(num), logs)
def bind(func, tuple: Tuple[int, str]) -> Tuple[int, str]:
res = func(tuple[0])
return (res[0], tuple[1] + res[1])
def unit(number: int) -> Tuple[int, str]:
   return (number, "")

# Now you can do this, more or less nested:
#print(bind(square_with_print_return, unit(5)))
#print(bind(square_with_print_return, (bind(square_with_print_return, bind(square_with_print_return,bind(square_with_print_return,unit(5)))

# it's nicer with infix. This class is a hack.
class Infix:
def __init__(self, function):
self.function = function
def __ror__(self, other):
return Infix(lambda x, self=self, other=other: self.function(other, x))
def __or__(self, other):
return self.function(other)
def __rlshift__(self, other):
return Infix(lambda x, self=self, other=other: self.function(other, x))
def __rshift__(self, other):
return self.function(other)
def __call__(self, value1, value2):
return self.function(value1, value2)

x=Infix(lambda f,x: bind(f,x))
print( square_with_print_return |x| (double_with_print_return |x| unit(4) ) )

# And some extra functional stuff
def curry(f,x):
def curried_function(*args, **kw):
return f(*((x,)+args),**kw)
return curried_function
curry=Infix(curry)

import operator
add5 = operator.add |curry| 5
print(add5(6))

def add5_with_print_return(num: int) -> Tuple[int,str]:
logs = "Current num is " + str(num) + ". "
return (5+num,logs)

print( add5_with_print_return |x| (double_with_print_return |x| unit(4) ) )


Re: UTF-8 progress bar

2023-01-28 Thread Kaelyn
--- Original Message ---
On Saturday, January 28th, 2023 at 1:17 PM, Julien Lepiller 
 wrote:


> 
> 
> Hi Guix!
> 
> I have a patch waiting (https://issues.guix.gnu.org/59975) that will
> change progress bars to use some unicode characters. I think they look
> better, but I'm a bit afraid they might not look right on some config,
> so I'd like to know if your terminal is able to show these characters:
> 
> "▏▎▍▌▋▊▉█▏▕"
> 
> If you are not using a unicode locale, this change will not affect you
> as guix will fallback to the ascii style. If your terminal can't show
> these characters and you have a UTF-8 locale (you'd run echo $LANG to
> know that), please report your config (name of terminal app, locale,
> fonts, …)!

I can see those characters in both xfce4-terminal and kitty.

Cheers,
Kaelyn



Re: UTF-8 progress bar

2023-01-28 Thread Maxime Devos



On 28-01-2023 14:17, Julien Lepiller wrote:

Hi Guix!

I have a patch waiting (https://issues.guix.gnu.org/59975) that will
change progress bars to use some unicode characters. I think they look
better, but I'm a bit afraid they might not look right on some config,
so I'd like to know if your terminal is able to show these characters:

"▏▎▍▌▋▊▉█▏▕"


It is (mate-terminal).


OpenPGP_0x49E3EE22191725EE.asc
Description: OpenPGP public key


OpenPGP_signature
Description: OpenPGP digital signature


UTF-8 progress bar

2023-01-28 Thread Julien Lepiller
Hi Guix!

I have a patch waiting (https://issues.guix.gnu.org/59975) that will
change progress bars to use some unicode characters. I think they look
better, but I'm a bit afraid they might not look right on some config,
so I'd like to know if your terminal is able to show these characters:

"▏▎▍▌▋▊▉█▏▕"

If you are not using a unicode locale, this change will not affect you
as guix will fallback to the ascii style. If your terminal can't show
these characters and you have a UTF-8 locale (you'd run echo $LANG to
know that), please report your config (name of terminal app, locale,
fonts, …)!