On 10/23/2010 10:38 AM, Gregory Jefferis wrote:


On 2010-10-23 15:19, "Richard Heck"<[email protected]>  wrote:

On 10/23/2010 07:18 AM, Gregory Jefferis wrote:
3) How should lyx2lyx be handled in this case?  I guess I need to layer a
conversion from vfr's patch (format 369) to my proposal.  Or if that file
format was never a stable release can it be ignored?

Now we only need to revert the hash numbers to 1,2,3... but I'm not
proficient at all when it comes to Python.

Nor me unfortunately. I presume that we could just convert to 1,2,3 based on
the order they appear in the document or sort by hash - I'm not sure it
makes much difference


I'm happy to do the python part if you give me exact instructions about
what we want to do.
Thanks for the offer!

Do we need to do forward and reverse in python?

Yes, in general, but see below.

Reverse back to 369
(Vincent's earlier patch for 2.0 svn) is easy - just convert the author IDs
from an integer hash value to a sequence (1,2,3). I think they can just be
in order of occurrence.

Do you mean order of occurrence in the header? Actually, what would really help here is if you could post a file of the sort we need to convert and tell me, basically, what the result should look like. Then I can see exactly what to do.

Forward would be a bit trickier if we had to calculate the hash function
value in python as well.  There's an example here for a different hash
function:

http://stackoverflow.com/questions/793761/built-in-python-hash-function

But this does remind me that we need to double check there are no problems
with a) string encoding or b) endianness.  The hash function obviously needs
to return the same value on every platform if the author name/email are the
same.

Yes, so we need to test that before deciding what to use. I'd guess the python function would return the same thing on all platforms, just because python itself is meant to be very cross-platform. But I don't know what we would be doing in C++.

BUT...perhaps we could avoid going forward by allowing LyX to calculate the hash value. I'd guess that it is easy to check if we have a hash value or not, right? If not, then we can calculate it. Maybe we need such code, anyway, in case there's some corruption of the headers?

Actually, is the hash value even stored in the LyX file? If so, why?

Richard

Reply via email to