Re: [PATCH] lyxpreview_tools.py: fix a regular expression

2020-02-16 Thread Stephan Witt
Am 16.02.2020 um 04:26 schrieb Richard Kimberly Heck : > > On 2/15/20 10:07 PM, Scott Kostyshak wrote: >> >>> I'm curious, why is it necessary to support Python 2? >> I forget what the discussion is regarding why we chose those versions. >> From what I understand, requiring 2.7 (as opposed to som

Re: [PATCH] lyxpreview_tools.py: fix a regular expression

2020-02-15 Thread Scott Kostyshak
On Sat, Feb 15, 2020 at 10:26:15PM -0500, Richard Kimberly Heck wrote: > On 2/15/20 10:07 PM, Scott Kostyshak wrote: > > > >> I'm curious, why is it necessary to support Python 2? > > I forget what the discussion is regarding why we chose those versions. > > From what I understand, requiring 2.7 (a

Re: [PATCH] lyxpreview_tools.py: fix a regular expression

2020-02-15 Thread Richard Kimberly Heck
On 2/15/20 10:07 PM, Scott Kostyshak wrote: > >> I'm curious, why is it necessary to support Python 2? > I forget what the discussion is regarding why we chose those versions. > From what I understand, requiring 2.7 (as opposed to some earlier 2.x) > makes things easier. Probably we will not allow

Re: [PATCH] lyxpreview_tools.py: fix a regular expression

2020-02-15 Thread Scott Kostyshak
On Sat, Feb 15, 2020 at 09:25:40PM +0100, Kornel Benko wrote: > Am Sat, 15 Feb 2020 21:15:17 +0100 > schrieb Kornel Benko : > > > Am Sat, 15 Feb 2020 14:03:43 -0500 > > schrieb Scott Kostyshak : > > > > > Attached is a patch for lyxpreview_tools.py, but I don't know Python > > > well and I don't

Re: [PATCH] lyxpreview_tools.py: fix a regular expression

2020-02-15 Thread Scott Kostyshak
On Sat, Feb 15, 2020 at 07:46:56PM +, Neven Sajko wrote: > Hmm, after looking at the last few commits, it seems this may be a > more involved issue > than I first thought. On the one hand one has to take care to use the > proper choice > between "Unicode" and "byte" strings, Thanks for the sug

Re: [PATCH] lyxpreview_tools.py: fix a regular expression

2020-02-15 Thread Scott Kostyshak
On Sun, Feb 16, 2020 at 01:37:34AM +0100, Enrico Forestieri wrote: > On Sat, Feb 15, 2020 at 02:03:43PM -0500, Scott Kostyshak wrote: > > > Attached is a patch for lyxpreview_tools.py, but I don't know Python > > well and I don't know how to test whether this code works as intended > > now or not.

Re: [PATCH] lyxpreview_tools.py: fix a regular expression

2020-02-15 Thread Enrico Forestieri
On Sat, Feb 15, 2020 at 02:03:43PM -0500, Scott Kostyshak wrote: > Attached is a patch for lyxpreview_tools.py, but I don't know Python > well and I don't know how to test whether this code works as intended > now or not. All I know is it gets rid of the error. > > I originally saw that error on

Re: [PATCH] lyxpreview_tools.py: fix a regular expression

2020-02-15 Thread Kornel Benko
Am Sat, 15 Feb 2020 21:15:17 +0100 schrieb Kornel Benko : > Am Sat, 15 Feb 2020 14:03:43 -0500 > schrieb Scott Kostyshak : > > > Attached is a patch for lyxpreview_tools.py, but I don't know Python > > well and I don't know how to test whether this code works as intended > > now or not. All I kno

Re: [PATCH] lyxpreview_tools.py: fix a regular expression

2020-02-15 Thread Kornel Benko
Am Sat, 15 Feb 2020 14:03:43 -0500 schrieb Scott Kostyshak : > Attached is a patch for lyxpreview_tools.py, but I don't know Python > well and I don't know how to test whether this code works as intended > now or not. All I know is it gets rid of the error. > > I originally saw that error on mast

Re: [PATCH] lyxpreview_tools.py: fix a regular expression

2020-02-15 Thread Neven Sajko
Hmm, after looking at the last few commits, it seems this may be a more involved issue than I first thought. On the one hand one has to take care to use the proper choice between "Unicode" and "byte" strings, on the other hand it seems like the Lyx guys want the script to work for both Python 2 and

Re: [PATCH] lyxpreview_tools.py: fix a regular expression

2020-02-15 Thread Neven Sajko
Actually, do something like this (no "using distributivity" like in my first message, to get a minimal git diff) def_re = re.compile(r"(\newcommandx|\renewcommandx|\global\long\def)(\[a-zA-Z]+)(.+)") Regards, Neven Sajko -- lyx-devel mailing list lyx-devel@lists.lyx.org http://lists.lyx.org/mai

Re: [PATCH] lyxpreview_tools.py: fix a regular expression

2020-02-15 Thread Neven Sajko
Two notes: it would be better to use raw strings (r"string") and to maybe do r"\(a|b|c|d)" instead of r"(\a|\b|\c|\d)" (use distributivity, in other words). So, I think you want this: def_re = re.compile(r"\(newcommandx|renewcommandx|global\long\def)(\[a-zA-Z]+)(.+)") Regards, Neven Sajko -- l

[PATCH] lyxpreview_tools.py: fix a regular expression

2020-02-15 Thread Scott Kostyshak
meone give the patch a check? Best, Scott From b3e30d0f2c21d195415e7d44fbf7b9d17d084c52 Mon Sep 17 00:00:00 2001 From: Scott Kostyshak Date: Sat, 15 Feb 2020 13:27:45 -0500 Subject: [PATCH] lyxpreview_tools.py: fix a regular expression Three backslashes are needed before a LaTeX command, not o