Changeset 2112

Show
Ignore:
Timestamp:
03/21/07 00:11:43 (2 years ago)
Author:
BryanTsai
Message:

LotusNotesParserMacro:

Banched to pre-0.9 and 0.9 version. 0.9 version is upgraded to be a new Macro (implementing IHTMLPreviewRenderer).

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • lotusnotesparsermacro/0.8/notes.py

    r604 r2112  
    1414 
    1515def parse(hdf, txt, env): 
    16     txt = txt.lstrip(); 
     16    req = None 
     17 
     18    txt = txt.lstrip() 
    1719    if (0 == len(txt)): 
    1820        return "" 
    1921     
    2022    html = "" 
    21     match = re.search(r"^(from:?\s+?)?(.*)$\s+?^(sent:?\s*)?(.*)$\s+?^to:?\s+?(.*)$\s+?^(cc:?\s+?(.*)$\s+?)?^subject:?\s+(.*)$", txt, re.IGNORECASE | re.MULTILINE) 
     23    match = re.search(r"^(from:?\s+?)?(.*)$\s+?^(sent:?\s*)?(.*)$\s+?^\s*to:?\s+?(.*)$\s+?^(\s*cc:?\s+?(.*)$\s+?)?^\s*subject:?\s+(.*)$", txt, re.IGNORECASE | re.MULTILINE) 
    2224    if match: 
    2325        if (-1 == match.start(1)): 
     
    3537        content = match.string[match.end(8):] 
    3638    else: 
    37         return wiki_to_html(txt, env, hdf, env.get_db_cnx(), escape_newlines=True) 
     39        return wiki_to_html(txt, env, req, escape_newlines=True) 
    3840     
    3941    html = '%s<br />'\ 
     
    4143           '<legend style="%s">%s</legend>'\ 
    4244           'From: %s<br />'\ 
    43            'To: %s<br />' % (wiki_to_html(pre_content, env, hdf, env.get_db_cnx(), escape_newlines=True),  
     45           'To: %s<br />' % (wiki_to_html(pre_content, env, req, escape_newlines=True),  
    4446                             STYLE,  
    4547                             STYLE,