Re: listerrors followup
Kayvan == Kayvan A Sylvan [EMAIL PROTECTED] writes: Kayvan Hi Jean-Marc, Here is my latest followup to the listerrors Kayvan fixes. Hello Kayvan, I was away last week. Kayvan If you have not already done so, please apply this. Kayvan The backward-porting is important since many people don't have Kayvan python-2.2 installed as /usr/bin/python. I'll apply that. Kayvan The converter.C patch is important to allow people who have Kayvan the setting parselog=listerrors in their build-program Kayvan convertor to find listerrors without having to set an Kayvan additional path element outside of LyX. This would mean that Kayvan the listerrors change has no user-visible impact. I have some code in the tree that should work fine. I'll have a look tonight. I do not want to modifiy the path because I am not very sure of our implmentation of PutEnv on all architectures. Moreover, the solution I used in converter.C is simpler and looks also in .lyx and in the build directory. JMarc
Re: listerrors followup
> "Kayvan" == Kayvan A Sylvan <[EMAIL PROTECTED]> writes: Kayvan> Hi Jean-Marc, Here is my latest followup to the listerrors Kayvan> fixes. Hello Kayvan, I was away last week. Kayvan> If you have not already done so, please apply this. Kayvan> The backward-porting is important since many people don't have Kayvan> python-2.2 installed as /usr/bin/python. I'll apply that. Kayvan> The converter.C patch is important to allow people who have Kayvan> the setting "parselog=listerrors" in their build-program Kayvan> convertor to find "listerrors" without having to set an Kayvan> additional path element outside of LyX. This would mean that Kayvan> the "listerrors" change has no user-visible impact. I have some code in the tree that should work fine. I'll have a look tonight. I do not want to modifiy the path because I am not very sure of our implmentation of PutEnv on all architectures. Moreover, the solution I used in converter.C is simpler and looks also in .lyx and in the build directory. JMarc
Re: listerrors followup
Hi Jean-Marc, Here is my latest followup to the listerrors fixes. If you have not already done so, please apply this. The backward-porting is important since many people don't have python-2.2 installed as /usr/bin/python. The converter.C patch is important to allow people who have the setting parselog=listerrors in their build-program convertor to find listerrors without having to set an additional path element outside of LyX. This would mean that the listerrors change has no user-visible impact. ---Kayvan -- Kayvan A. Sylvan | Proud husband of | Father to my kids: Sylvan Associates, Inc. | Laura Isabella Sylvan | Katherine Yelena (8/8/89) http://sylvan.com/~kayvan | crown of her husband | Robin Gregory (2/28/92) Index: lib/ChangeLog === RCS file: /cvs/lyx/lyx-devel/lib/ChangeLog,v retrieving revision 1.189 diff -u -r1.189 ChangeLog --- lib/ChangeLog 2002/03/21 19:26:18 1.189 +++ lib/ChangeLog 2002/03/21 19:48:24 @@ -6,6 +6,13 @@ * ui/default.ui: Change What's this? to Tooltips. +2002-03-19 Kayvan A. Sylvan [EMAIL PROTECTED] + + * examples/listerrors.lyx: Fixed to run with python-1.5 as well + as with latest python-2.2 + + * scripts/listerrors: Re-generated from listerrors.lyx + 2002-03-19 Jean-Marc Lasgouttes [EMAIL PROTECTED] * create_fonts_dir: Index: lib/examples/listerrors.lyx === RCS file: /cvs/lyx/lyx-devel/lib/examples/listerrors.lyx,v retrieving revision 1.1 diff -u -r1.1 listerrors.lyx --- lib/examples/listerrors.lyx 2002/03/19 21:42:48 1.1 +++ lib/examples/listerrors.lyx 2002/03/21 19:48:24 @@ -259,7 +259,7 @@ \newline \newline -import sys +import sys, string \newline \newline @@ -363,10 +363,8 @@ \newline if lines: \newline -line = lines[-1] +line = lines.pop() \newline -lines = lines[:-1] -\newline else: \newline line = file.readline() @@ -391,7 +389,7 @@ \newline lines = __lines \newline - lines += (line,) # push a list onto the stack, not individual letters + lines.append(line) \newline \newline @@ -509,9 +507,9 @@ Look for the unescaped angle-brackets in documentation= \newline -if line.find(: unescaped in documentation chunk) != -1: +if string.find(line, : unescaped in documentation chunk) != -1: \newline - line_parts = line.split(':') + line_parts = string.split(line, ':') \newline num_str = line_parts[1] \newline @@ -519,7 +517,7 @@ \newline i = 0 \newline - while i num_len and num_str[i].isdigit(): i += 1 + while i num_len and (num_str[i] in string.digits): i = i + 1 \newline if i == num_len: \newline @@ -538,13 +536,13 @@ \newline if (not retval): \newline - left = line.find() + left = string.find(line, ) \newline if (left != -1) and ((left + 2) len(line)) and \backslash \newline - (line[left+2:].find() != -1): + (string.find(line[left+2:], ) != -1): \newline write_error(line, noweb); \newline @@ -586,7 +584,7 @@ \newline for msg in msgs_to_try: \newline -if line.find(msg) != -1: +if string.find(line, msg) != -1: \newline write_error(line, noweb) \newline @@ -647,7 +645,7 @@ Handle the gcc error message= \newline -first_space = line.find(' ') +first_space = string.find(line, ' ') \newline if first_space 1: # The smallest would be X: \newline @@ -661,7 +659,7 @@ \newline num_end = first_space \newline - while next_line[num_end].isdigit(): num_end += 1 + while next_line[num_end] in string.digits: num_end = num_end + 1 \newline if num_end first_space: # good! \newline @@ -685,12 +683,10 @@ Accumulate gcc error lines and print it= \newline num_str = next_line[first_space:num_end] -\newline -msgs = [] \newline -msgs += (line[first_space:],) +msgs = [line[first_space:]] \newline -msgs += (next_line[num_end + 1:],) +msgs.append(next_line[num_end + 1:]) \newline header_to_see = next_line[:num_end] \newline @@ -698,7 +694,7 @@ \newline while next_line and next_line[:num_end] == header_to_see: \newline - msgs += (next_line[num_end + 1:],) + msgs.append(next_line[num_end + 1:]) \newline next_line = getline() \newline @@ -754,9 +750,9 @@ \newline if line[0] == '': # This is the first character of all xlc errors \newline -next_quote = line.find('', 1) +next_quote = string.find(line, '', 1) \newline -first_space = line.find(' ') +first_space = string.find(line, ' ') \newline if (next_quote != -1) and (first_space next_quote): # no space inisde quotes @@ -765,7 +761,7 @@ \newline num_start = num_end = first_space + 6 \newline -while line[num_end].isdigit(): num_end += 1 +while line[num_end] in string.digits: num_end = num_end + 1 \newline if num_end
Re: listerrors followup
Hi Jean-Marc, Here is my latest followup to the listerrors fixes. If you have not already done so, please apply this. The backward-porting is important since many people don't have python-2.2 installed as /usr/bin/python. The converter.C patch is important to allow people who have the setting "parselog=listerrors" in their build-program convertor to find "listerrors" without having to set an additional path element outside of LyX. This would mean that the "listerrors" change has no user-visible impact. ---Kayvan -- Kayvan A. Sylvan | Proud husband of | Father to my kids: Sylvan Associates, Inc. | Laura Isabella Sylvan | Katherine Yelena (8/8/89) http://sylvan.com/~kayvan | "crown of her husband" | Robin Gregory (2/28/92) Index: lib/ChangeLog === RCS file: /cvs/lyx/lyx-devel/lib/ChangeLog,v retrieving revision 1.189 diff -u -r1.189 ChangeLog --- lib/ChangeLog 2002/03/21 19:26:18 1.189 +++ lib/ChangeLog 2002/03/21 19:48:24 @@ -6,6 +6,13 @@ * ui/default.ui: Change "What's this?" to "Tooltips". +2002-03-19 Kayvan A. Sylvan <[EMAIL PROTECTED]> + + * examples/listerrors.lyx: Fixed to run with python-1.5 as well + as with latest python-2.2 + + * scripts/listerrors: Re-generated from listerrors.lyx + 2002-03-19 Jean-Marc Lasgouttes <[EMAIL PROTECTED]> * create_fonts_dir: Index: lib/examples/listerrors.lyx === RCS file: /cvs/lyx/lyx-devel/lib/examples/listerrors.lyx,v retrieving revision 1.1 diff -u -r1.1 listerrors.lyx --- lib/examples/listerrors.lyx 2002/03/19 21:42:48 1.1 +++ lib/examples/listerrors.lyx 2002/03/21 19:48:24 @@ -259,7 +259,7 @@ \newline \newline -import sys +import sys, string \newline \newline @@ -363,10 +363,8 @@ \newline if lines: \newline -line = lines[-1] +line = lines.pop() \newline -lines = lines[:-1] -\newline else: \newline line = file.readline() @@ -391,7 +389,7 @@ \newline lines = __lines \newline - lines += (line,) # push a list onto the stack, not individual letters + lines.append(line) \newline \newline @@ -509,9 +507,9 @@ <>= \newline -if line.find(": unescaped << in documentation chunk") != -1: +if string.find(line, ": unescaped << in documentation chunk") != -1: \newline - line_parts = line.split(':') + line_parts = string.split(line, ':') \newline num_str = line_parts[1] \newline @@ -519,7 +517,7 @@ \newline i = 0 \newline - while i < num_len and num_str[i].isdigit(): i += 1 + while i < num_len and (num_str[i] in string.digits): i = i + 1 \newline if i == num_len: \newline @@ -538,13 +536,13 @@ \newline if (not retval): \newline - left = line.find("<<") + left = string.find(line, "<<") \newline if (left != -1) and ((left + 2) < len(line)) and \backslash \newline - (line[left+2:].find(">>") != -1): + (string.find(line[left+2:], ">>") != -1): \newline write_error(line, "noweb"); \newline @@ -586,7 +584,7 @@ \newline for msg in msgs_to_try: \newline -if line.find(msg) != -1: +if string.find(line, msg) != -1: \newline write_error(line, "noweb") \newline @@ -647,7 +645,7 @@ <>= \newline -first_space = line.find(' ') +first_space = string.find(line, ' ') \newline if first_space > 1: # The smallest would be "X: " \newline @@ -661,7 +659,7 @@ \newline num_end = first_space \newline - while next_line[num_end].isdigit(): num_end += 1 + while next_line[num_end] in string.digits: num_end = num_end + 1 \newline if num_end > first_space: # good! \newline @@ -685,12 +683,10 @@ <>= \newline num_str = next_line[first_space:num_end] -\newline -msgs = [] \newline -msgs += (line[first_space:],) +msgs = [line[first_space:]] \newline -msgs += (next_line[num_end + 1:],) +msgs.append(next_line[num_end + 1:]) \newline header_to_see = next_line[:num_end] \newline @@ -698,7 +694,7 @@ \newline while next_line and next_line[:num_end] == header_to_see: \newline - msgs += (next_line[num_end + 1:],) + msgs.append(next_line[num_end + 1:]) \newline next_line = getline() \newline @@ -754,9 +750,9 @@ \newline if line[0] == '"': # This is the first character of all xlc errors \newline -next_quote = line.find('"', 1) +next_quote = string.find(line, '"', 1) \newline -first_space = line.find(' ') +first_space = string.find(line, ' ') \newline if (next_quote != -1) and (first_space > next_quote): # no space inisde quotes @@ -765,7 +761,7 @@ \newline num_start = num_end = first_space + 6 \newline -while line[num_end].isdigit(): num_end += 1 +while line[num_end] in string.digits: num_end = num_end + 1 \newline if num_end > num_start: \newline Index: lib/scripts/listerrors