Jose' Matos wrote:

> On Wednesday 10 December 2003 14:49, Angus Leeming wrote:
>> No need to pass the 'name' to each instance of InsetNoteMailer,
>> InsetBranchMailer as this name is fixed for each Mailer type.
>>
>> Committing now.
> 
>   Is the fileformat changed?

No, but my next one does change these

\begin_inset Note -> \begin_inset Note Note
\begin_inset Comment -> \begin_inset Note Comment
\begin_inset Greyedout -> \begin_inset Note Greyedout

I'll up the file format to 226 and have been thinking about 
lyxconvert_225.py

Currently it's rather ugly (and unfinished). Question what should I 
put in the ...

def convert_note(lines):
    i = 0
    while 1:
        j = find_token(lines, "\\begin_inset Note", i)
        if j == -1:
            j = find_token(lines, "\\begin_inset Comment", i)
        if j == -1:
            j = find_token(lines, "\\begin_inset Greyedout", i)
        if j == -1:
            break

        # Line j contains a note inset in one of its three forms.
        # Insert 'Note' immediately after '\begin_inset'.
        ...
        
        # update the line count and continue the loop
        i = j + 1;

More elegant would be to use a regex like
        note_re = re.compile(r'\(\\begin_inset \)\(Note|Comment|Greyedout\)')
and to insert 'Note ' between the two groups. However, I don't know if 
the above is a valid python RE. I don't know how to do the inserting 
either...

-- 
Angus

Reply via email to