Re: File loading error.

2003-03-13 Thread Dekel Tsur
On Thu, Mar 13, 2003 at 01:18:36PM +0200, Dekel Tsur wrote:
> On Thu, Mar 13, 2003 at 10:43:34AM +, John Levon wrote:
> > 
> > Hmm OK, so lyx2lyx copes with versions its never asked to output in.
> > 
> > So, feel free to bump the number add an empty file, only to remove it
> > later, despite the fact everyone's fixed all their documents in the time
> > we've been having this silly argument.
> 
> We can use the suggestion I gave in a previous mail (always run lyx2lyx in
> the development LyX), or use the following patch which doesn't require
> new files for lyx2lyx.

Should I apply this patch ?
The other method has the advantage of having consecutive file version
numbers between stable releases, but it requires disabling a block of code
before a release.
Is it important to have consecutive versions ?


Re: File loading error.

2003-03-13 Thread Angus Leeming
Lars Gullik Bjønnes wrote:
> I read this as C/C++, and there negative subscripting means something
> completely different.

The "know your tools" mantra springs to mind..

-- 
Angus (who is python-ignorant too)



Re: File loading error.

2003-03-13 Thread Lars Gullik Bjønnes
[EMAIL PROTECTED] (Lars Gullik Bjønnes) writes:

| I read this as C/C++, and there negative subscripting means something
| completely different.

>From "The C Programming Language": 
"If one is sure that the elements exist, it is also possible
to index backwards in an array; p[-1], p[-2], and so on are
syntactically legal, and refer to the elements that
immediately precede p[0]. Of course, it is illegal to refer to
objects that are not within the array bounds."

-- 
Lgb


Re: File loading error.

2003-03-13 Thread Lars Gullik Bjønnes
Dekel Tsur <[EMAIL PROTECTED]> writes:

| On Thu, Mar 13, 2003 at 12:39:34PM +0100, Lars Gullik Bj?nnes wrote:
| > Dekel Tsur <[EMAIL PROTECTED]> writes:
| > 
| > | +if x < int(lst_ft[-1]) and x > int(lst_ft[-2]):
| > | +sys.stderr.write("lyx2lyx: A development version file.\n")
| > | +return lst_ft[-2]
| > 
| > Okay... what does this indexing mean?
| > 
| > indexes must be >= 0... are the converted to int? unsinged int?
| 
| A negative index -i in python means the i-th element from the end.
| So if the file version is in the interval (previous stable #, current dev #)
| we consider this file to be a development file, and decrease its version
| number to 'previous stable #'.

I read this as C/C++, and there negative subscripting means something
completely different.

-- 
Lgb


Re: File loading error.

2003-03-13 Thread Dekel Tsur
On Thu, Mar 13, 2003 at 12:39:34PM +0100, Lars Gullik Bj?nnes wrote:
> Dekel Tsur <[EMAIL PROTECTED]> writes:
> 
> | +if x < int(lst_ft[-1]) and x > int(lst_ft[-2]):
> | +sys.stderr.write("lyx2lyx: A development version file.\n")
> | +return lst_ft[-2]
> 
> Okay... what does this indexing mean?
> 
> indexes must be >= 0... are the converted to int? unsinged int?

A negative index -i in python means the i-th element from the end.
So if the file version is in the interval (previous stable #, current dev #)
we consider this file to be a development file, and decrease its version
number to 'previous stable #'.


Re: File loading error.

2003-03-13 Thread José Matos
On Thursday 13 March 2003 11:39, Lars Gullik Bjønnes wrote:
> Dekel Tsur <[EMAIL PROTECTED]> writes:
> | +if x < int(lst_ft[-1]) and x > int(lst_ft[-2]):
> | +sys.stderr.write("lyx2lyx: A development version file.\n")
> | +return lst_ft[-2]
>
> Okay... what does this indexing mean?
>
> indexes must be >= 0... are the converted to int? unsinged int?

  If they are negative that means start from end, so lst_ft[-1] is the last 
element and so on...

-- 
José Abílio


Re: File loading error.

2003-03-13 Thread Lars Gullik Bjønnes
Dekel Tsur <[EMAIL PROTECTED]> writes:

| +if x < int(lst_ft[-1]) and x > int(lst_ft[-2]):
| +sys.stderr.write("lyx2lyx: A development version file.\n")
| +return lst_ft[-2]

Okay... what does this indexing mean?

indexes must be >= 0... are the converted to int? unsinged int?

-- 
Lgb


Re: File loading error.

2003-03-13 Thread Dekel Tsur
On Thu, Mar 13, 2003 at 10:43:34AM +, John Levon wrote:
> 
> Hmm OK, so lyx2lyx copes with versions its never asked to output in.
> 
> So, feel free to bump the number add an empty file, only to remove it
> later, despite the fact everyone's fixed all their documents in the time
> we've been having this silly argument.

We can use the suggestion I gave in a previous mail (always run lyx2lyx in
the development LyX), or use the following patch which doesn't require
new files for lyx2lyx.
Index: src/buffer.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/buffer.C,v
retrieving revision 1.431
diff -u -p -r1.431 buffer.C
--- src/buffer.C12 Mar 2003 11:52:22 -  1.431
+++ src/buffer.C13 Mar 2003 11:15:51 -
@@ -115,7 +115,7 @@ extern BufferList bufferlist;
 
 namespace {
 
-const int LYX_FORMAT = 222;
+const int LYX_FORMAT = 223;
 
 } // namespace anon
 
Index: lib/lyx2lyx/lyx2lyx
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/lib/lyx2lyx/lyx2lyx,v
retrieving revision 1.7
diff -u -p -r1.7 lyx2lyx
--- lib/lyx2lyx/lyx2lyx 10 Feb 2003 10:27:46 -  1.7
+++ lib/lyx2lyx/lyx2lyx 13 Mar 2003 11:15:52 -
@@ -37,7 +37,7 @@ opt.quiet = 0
 
 format = re.compile(r"(\d)[\.,]?(\d\d)")
 fileformat = re.compile(r"\\lyxformat\s*(\S*)")
-lst_ft = ["210", "215", "216", "217", "218", "220", "221", "222"]
+lst_ft = ["210", "215", "216", "217", "218", "220", "221", "223"]
 
 def usage():
 print """Usage: lyx2lyx [options] file1
@@ -105,10 +105,17 @@ def lyxformat(fmt):
 else:
 sys.stderr.write(fmt + ": " + error.invalid_format)
 sys.exit(2)
-if fmt not in lst_ft:
-sys.stderr.write(fmt + ": " + error.format_not_supported)
-sys.exit(1)
-return fmt
+
+if fmt in lst_ft:
+return fmt
+
+x = int(fmt)
+if x < int(lst_ft[-1]) and x > int(lst_ft[-2]):
+sys.stderr.write("lyx2lyx: A development version file.\n")
+return lst_ft[-2]
+
+sys.stderr.write(fmt + ": " + error.format_not_supported)
+sys.exit(1)
 
 def read_file(file, header, body):
 """Reads a file into the header and body parts"""


Re: File loading error.

2003-03-13 Thread Lars Gullik Bjønnes
John Levon <[EMAIL PROTECTED]> writes:

| Or you could back out / fix the amsmath stuff instead

Stay on topic, bitte, please.

-- 
Lgb


Re: File loading error.

2003-03-13 Thread John Levon
On Thu, Mar 13, 2003 at 11:31:06AM +0100, Andre Poenitz wrote:

> Like version 219?

Hmm OK, so lyx2lyx copes with versions its never asked to output in.

So, feel free to bump the number add an empty file, only to remove it
later, despite the fact everyone's fixed all their documents in the time
we've been having this silly argument.

Or you could back out / fix the amsmath stuff instead

john


Re: File loading error.

2003-03-13 Thread Andre Poenitz
On Thu, Mar 13, 2003 at 10:34:14AM +, John Levon wrote:
> > | You may think it is sane to have 30 pointless files in lyx2lyx/ (or some
> > | stupid "no changes in this version" hack) for ever and ever in
> 


Like version 219?

Andre'

-- 
Those who desire to give up Freedom in order to gain Security,
will not have, nor do they deserve, either one. (T. Jefferson)


Re: File loading error.

2003-03-13 Thread John Levon
On Thu, Mar 13, 2003 at 11:32:04AM +0100, Lars Gullik Bj?nnes wrote:

> And why would we need files for non-existant version numbers?

> John Levon <[EMAIL PROTECTED]> writes:
>
> | You may think it is sane to have 30 pointless files in lyx2lyx/ (or some
> | stupid "no changes in this version" hack) for ever and ever in


john


Re: File loading error.

2003-03-13 Thread Lars Gullik Bjønnes
John Levon <[EMAIL PROTECTED]> writes:

| You may think it is sane to have 30 pointless files in lyx2lyx/ (or some
| stupid "no changes in this version" hack) for ever and ever in
| perpetuity, because 2 people needed to add a single line to a file or
| two every now and then

And why would we need files for non-existant version numbers?


-- 
Lgb


Re: File loading error.

2003-03-13 Thread John Levon
On Thu, Mar 13, 2003 at 10:57:55AM +0100, Andre Poenitz wrote:

> And believe me: User feedback _is_ usefull well before feature freeze,
> especially if it uncovers design errors which formally can't be rectified
> in feature freeze.

I wish people would stop putting words in my mouth. Especially when I
went to a special effort to clarify what I meant.

> Yeah, sure, we will run out of version numbers some day...

You may think it is sane to have 30 pointless files in lyx2lyx/ (or some
stupid "no changes in this version" hack) for ever and ever in
perpetuity, because 2 people needed to add a single line to a file or
two every now and then

john


Re: File loading error.

2003-03-13 Thread John Levon
On Thu, Mar 13, 2003 at 11:04:09AM +0100, Andre Poenitz wrote:

> In any case it would be nice if people are informed of such changes.

Yes, it was lacking of me not to mention it upfront.

john


Re: File loading error.

2003-03-13 Thread Lars Gullik Bjønnes
Andre Poenitz <[EMAIL PROTECTED]> writes:

| On Thu, Mar 13, 2003 at 02:06:57AM -0800, Kayvan A. Sylvan wrote:
| > As a person who builds and uses the most bleeding-edge versions of LyX,
| > I agree with John. A simple intermediate change with an easy workaround
| > ("just add \end_header to the end of the header") should not cause
| > a version number change.
| 
| Btw: Why is this \end_header necessary?

Making the lyx format have more "blocks" is only good, and help us in
the trasition to a more xml like format. Let's not discuss that.

BUT I think that changes in the format during a dev cycle should also
create some compability code that will be removed before actual
release.

-- 
Lgb


Re: File loading error.

2003-03-13 Thread Kayvan A. Sylvan
On Thu, Mar 13, 2003 at 11:04:51AM +0100, Andre Poenitz wrote:
> On Thu, Mar 13, 2003 at 02:06:57AM -0800, Kayvan A. Sylvan wrote:
> > As a person who builds and uses the most bleeding-edge versions of LyX,
> > I agree with John. A simple intermediate change with an easy workaround
> > ("just add \end_header to the end of the header") should not cause
> > a version number change.
> 
> Btw: Why is this \end_header necessary?

I don't know. Maybe it made it easier to parse? John?

-- 
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)


Re: File loading error.

2003-03-13 Thread Kayvan A. Sylvan
On Thu, Mar 13, 2003 at 11:04:09AM +0100, Andre Poenitz wrote:
> On Thu, Mar 13, 2003 at 02:06:57AM -0800, Kayvan A. Sylvan wrote:
> > As a person who builds and uses the most bleeding-edge versions of LyX,
> > I agree with John. A simple intermediate change with an easy workaround
> > ("just add \end_header to the end of the header") should not cause
> > a version number change.
> 
> In any case it would be nice if people are informed of such changes.
> 
> Andre'

Agreed.

Although John might say that LyX's "Unknown textclass" messages counts
as notification. ;-)

-- 
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)


Re: File loading error.

2003-03-13 Thread Andre Poenitz
On Thu, Mar 13, 2003 at 02:06:57AM -0800, Kayvan A. Sylvan wrote:
> As a person who builds and uses the most bleeding-edge versions of LyX,
> I agree with John. A simple intermediate change with an easy workaround
> ("just add \end_header to the end of the header") should not cause
> a version number change.

Btw: Why is this \end_header necessary?

Andre'

-- 
Those who desire to give up Freedom in order to gain Security,
will not have, nor do they deserve, either one. (T. Jefferson)


Re: File loading error.

2003-03-13 Thread Andre Poenitz
On Thu, Mar 13, 2003 at 02:06:57AM -0800, Kayvan A. Sylvan wrote:
> As a person who builds and uses the most bleeding-edge versions of LyX,
> I agree with John. A simple intermediate change with an easy workaround
> ("just add \end_header to the end of the header") should not cause
> a version number change.

In any case it would be nice if people are informed of such changes.

Andre'

-- 
Those who desire to give up Freedom in order to gain Security,
will not have, nor do they deserve, either one. (T. Jefferson)


Re: File loading error.

2003-03-13 Thread Alfredo Braunstein
John Levon wrote:

> Sorry, I have ZERO sympathy for people trying to use it when we're not

Hey!

Alfredo




Re: File loading error.

2003-03-13 Thread Kayvan A. Sylvan
On Thu, Mar 13, 2003 at 09:56:51AM +, John Levon wrote:
> On Thu, Mar 13, 2003 at 08:44:41AM +0100, Andre Poenitz wrote:
> 
> > > Add "\end_header" to the end of the header. I didn't bother bumping the
> > > format because we  already bumped it for the change tracking stuff.
> > 
> > The rule is to bump the format number for _every_ change.
> > 
> > Believe it or not, some people actually _use_ LyX.
> 
> Sorry, I have ZERO sympathy for people trying to use it when we're not
> in feature freeze. All testing is welcome (thanks Garst et al !) but to
> an extent you're on your own.
> 
> I'm not going to accept stupid version number bloat (with the
> corresponding number of empty lyx2lyx files) for no reason at all

As a person who builds and uses the most bleeding-edge versions of LyX,
I agree with John. A simple intermediate change with an easy workaround
("just add \end_header to the end of the header") should not cause
a version number change.

---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)


Re: File loading error.

2003-03-13 Thread Andre Poenitz
On Thu, Mar 13, 2003 at 09:56:51AM +, John Levon wrote:
> > > Add "\end_header" to the end of the header. I didn't bother bumping the
> > > format because we  already bumped it for the change tracking stuff.
> > 
> > The rule is to bump the format number for _every_ change.
> > 
> > Believe it or not, some people actually _use_ LyX.
> 
> Sorry, I have ZERO sympathy for people trying to use it when we're not
> in feature freeze.

Well. Another point where we differ.

And believe me: User feedback _is_ usefull well before feature freeze,
especially if it uncovers design errors which formally can't be rectified
in feature freeze.

> I'm not going to accept stupid version number bloat (with the
> corresponding number of empty lyx2lyx files) for no reason at all

Yeah, sure, we will run out of version numbers some day...

Andre'

-- 
Those who desire to give up Freedom in order to gain Security,
will not have, nor do they deserve, either one. (T. Jefferson)


Re: File loading error.

2003-03-13 Thread John Levon
On Thu, Mar 13, 2003 at 08:44:41AM +0100, Andre Poenitz wrote:

> > Add "\end_header" to the end of the header. I didn't bother bumping the
> > format because we  already bumped it for the change tracking stuff.
> 
> The rule is to bump the format number for _every_ change.
> 
> Believe it or not, some people actually _use_ LyX.

Sorry, I have ZERO sympathy for people trying to use it when we're not
in feature freeze. All testing is welcome (thanks Garst et al !) but to
an extent you're on your own.

I'm not going to accept stupid version number bloat (with the
corresponding number of empty lyx2lyx files) for no reason at all

john


Re: File loading error.

2003-03-13 Thread José Matos
On Wednesday 12 March 2003 21:56, Lars Gullik Bjønnes wrote:
> |
> | This means that lyx2lyx will be broken into a lot of modules, and it
> | might make it harder to maintain.
>
> Only temprary... the format versions that _only_ exists during the dev
> cycle should not be supported by lyx2lyx later, so then those modules
> can be collapsed into a single one.

  That is a valid point.

  Another possible solution we could implement would be to "taint" any lyx 
file wrote in the develpment version. Our problem with this was always to try 
to guess if some file was from development or not.

-- 
José Abílio


Re: File loading error.

2003-03-12 Thread Andre Poenitz
On Wed, Mar 12, 2003 at 08:17:45PM +, John Levon wrote:
> On Wed, Mar 12, 2003 at 09:13:56PM +0100, Lars Gullik Bj?nnes wrote:
> 
> > The error:
> > "Textclass error
> >  Document uses an unknown textclass 'Standard'.-- substituting"
> > 
> > Can this be the last paragraph changes?
> 
> Add "\end_header" to the end of the header. I didn't bother bumping the
> format because we  already bumped it for the change tracking stuff.

The rule is to bump the format number for _every_ change.

Believe it or not, some people actually _use_ LyX.

Andre'

-- 
Those who desire to give up Freedom in order to gain Security,
will not have, nor do they deserve, either one. (T. Jefferson)


Re: File loading error.

2003-03-12 Thread Lars Gullik Bjønnes
Dekel Tsur <[EMAIL PROTECTED]> writes:

| On Wed, Mar 12, 2003 at 09:41:00PM +0100, Lars Gullik Bj?nnes wrote:
| > | > The why is my Userguide loading?
| > | > (older format I guess)
| > | 
| > | Yes, lyx2lyx will be ok ...
| > | 
| > | > And at least temporary you need to handle this with some backwards
| > | > compability stuff.
| > | 
| > | Hmm OK.
| > | 
| > | I don't know how though, how do we detect the end of the header ?
| > Easier solution is perhaps to up the format.
| 
| This means that lyx2lyx will be broken into a lot of modules, and it might
| make it harder to maintain.

Only temprary... the format versions that _only_ exists during the dev
cycle should not be supported by lyx2lyx later, so then those modules
can be collapsed into a single one.
 
-- 
Lgb


Re: File loading error.

2003-03-12 Thread Dekel Tsur
On Wed, Mar 12, 2003 at 09:41:00PM +0100, Lars Gullik Bj?nnes wrote:
> | > The why is my Userguide loading?
> | > (older format I guess)
> | 
> | Yes, lyx2lyx will be ok ...
> | 
> | > And at least temporary you need to handle this with some backwards
> | > compability stuff.
> | 
> | Hmm OK.
> | 
> | I don't know how though, how do we detect the end of the header ?
> Easier solution is perhaps to up the format.

This means that lyx2lyx will be broken into a lot of modules, and it might
make it harder to maintain.

A possible solution: change the code in readFile() to
run 'lyx2lyx -f (LYX_FORMAT-1) filename' on files for which 
file_format == LYX_FORMAT, and disable this code when you think all user
have updated their file (it is possible to keep it enabled and disable it
only before a new release).


Re: File loading error.

2003-03-12 Thread John Levon
On Wed, Mar 12, 2003 at 09:41:00PM +0100, Lars Gullik Bj?nnes wrote:

> Ever wondered why the compability code was so hard to get right?
> 
> Easier solution is perhaps to up the format.

And the easiest and sanest solution is to get the 3 people who have
documents from 1.4.0cvs to add \end_header to their files...

john


Re: File loading error.

2003-03-12 Thread Lars Gullik Bjønnes
John Levon <[EMAIL PROTECTED]> writes:

| On Wed, Mar 12, 2003 at 09:25:14PM +0100, Lars Gullik Bj?nnes wrote:
| 
| > The why is my Userguide loading?
| > (older format I guess)
| 
| Yes, lyx2lyx will be ok ...
| 
| > And at least temporary you need to handle this with some backwards
| > compability stuff.
| 
| Hmm OK.
| 
| I don't know how though, how do we detect the end of the header ?

Ever wondered why the compability code was so hard to get right?

Easier solution is perhaps to up the format.

-- 
Lgb


Re: File loading error.

2003-03-12 Thread John Levon
On Wed, Mar 12, 2003 at 09:25:14PM +0100, Lars Gullik Bj?nnes wrote:

> The why is my Userguide loading?
> (older format I guess)

Yes, lyx2lyx will be ok ...

> And at least temporary you need to handle this with some backwards
> compability stuff.

Hmm OK.

I don't know how though, how do we detect the end of the header ?

john


Re: File loading error.

2003-03-12 Thread Lars Gullik Bjønnes
John Levon <[EMAIL PROTECTED]> writes:

| On Wed, Mar 12, 2003 at 09:13:56PM +0100, Lars Gullik Bj?nnes wrote:
| 
| > The error:
| > "Textclass error
| >  Document uses an unknown textclass 'Standard'.-- substituting"
| > 
| > Can this be the last paragraph changes?
| 
| Add "\end_header" to the end of the header. I didn't bother bumping the
| format because we  already bumped it for the change tracking stuff.

The why is my Userguide loading?
(older format I guess)

And at least temporary you need to handle this with some backwards
compability stuff.

-- 
Lgb


Re: File loading error.

2003-03-12 Thread John Levon
On Wed, Mar 12, 2003 at 09:13:56PM +0100, Lars Gullik Bj?nnes wrote:

> The error:
> "Textclass error
>  Document uses an unknown textclass 'Standard'.-- substituting"
> 
> Can this be the last paragraph changes?

Add "\end_header" to the end of the header. I didn't bother bumping the
format because we  already bumped it for the change tracking stuff.

john


File loading error.

2003-03-12 Thread Lars Gullik Bjønnes

The error:
"Textclass error
 Document uses an unknown textclass 'Standard'.-- substituting"

Can this be the last paragraph changes?

With this document:


newfile1.lyx
Description: Binary data

-- 
Lgb