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? 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.
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.
Best,
Greg.