Re: [LyX/master] fix get_quoted_value

2024-08-16 Thread Jürgen Spitzmüller
Am Freitag, dem 16.08.2024 um 10:00 +0100 schrieb José Matos: > Thank you for implementing these changes in the code. :-) I have to thank for the instruction! -- Jürgen -- lyx-devel mailing list lyx-devel@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-devel

Re: [LyX/master] fix get_quoted_value

2024-08-16 Thread José Matos
On Thu, 2024-08-15 at 15:28 +0200, Jürgen Spitzmüller wrote: > Am Donnerstag, dem 15.08.2024 um 13:03 +0100 schrieb José Matos: > > Honestly here the code, in this context, makes more sense like > > this: > > > > if val.startswith('"') and val.endswith('"'): > >     val =  val[1:-1] > > > > So it

Re: [LyX/master] fix get_quoted_value

2024-08-15 Thread Jürgen Spitzmüller
Am Donnerstag, dem 15.08.2024 um 13:03 +0100 schrieb José Matos: > Honestly here the code, in this context, makes more sense like this: > > if val.startswith('"') and val.endswith('"'): >     val =  val[1:-1] > > So it only makes sense to remove both at once.  Yes, I agree. > Again on practice

Re: [LyX/master] fix get_quoted_value

2024-08-15 Thread José Matos
On Thu, 2024-08-15 at 13:07 +0200, Jürgen Spitzmüller wrote: > My case was escaped quote as last content of the quoted string (e.g., > "\"" which returned \ rather than \") > That makes sense. :-) > > BTW I usually prefer code that is more expressive: > > > > if val.startswith('"'): > >     val

Re: [LyX/master] fix get_quoted_value

2024-08-15 Thread Jürgen Spitzmüller
Am Donnerstag, dem 15.08.2024 um 09:35 +0100 schrieb José Matos: > This will only fail for cases where there are multiple opening and > closing quotes. > Is that our case? My case was escaped quote as last content of the quoted string (e.g., "\"" which returned \ rather than \") > BTW I usually p

Re: [LyX/master] fix get_quoted_value

2024-08-15 Thread José Matos
On Thu, 2024-08-15 at 06:06 +, Juergen Spitzmueller wrote: > -    return val.strip('"') > +    # remove only outer pair of quotes, > +    # hence do not use strip('"') > +    if val[:1] == '"': > +    val = val[1:] > +    if val[-1:] == '"': > +    val = val[:-1] > +    > +    return v