<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.3199" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=214203606-16122007><FONT face=Arial 
color=#0000ff size=2>Try initializing the request with:</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=214203606-16122007><FONT face=Arial 
color=#0000ff size=2><SPAN><FONT face=Arial color=#0000ff size=2>subreq = 
RequestCLI('localhost/' + wikiname, 
properties={'script_name':'/'+wikiname})</FONT></SPAN></FONT></SPAN></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=214203606-16122007>(may 
need to me adjusted for 1.6+)</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN 
class=214203606-16122007></SPAN></FONT> </DIV>
<DIV><SPAN class=214203606-16122007><FONT face=Arial color=#0000ff 
size=2>Vitaliy</FONT></SPAN></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT><FONT face=Arial color=#0000ff 
size=2></FONT><FONT face=Arial color=#0000ff size=2></FONT><FONT face=Arial 
color=#0000ff size=2></FONT><BR></DIV>
<BLOCKQUOTE style="MARGIN-RIGHT: 0px">
  <DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
  <HR tabIndex=-1>
  <FONT face=Tahoma size=2><B>From:</B> jbardin.bu@gmail.com 
  [mailto:jbardin.bu@gmail.com] <B>On Behalf Of </B>james bardin<BR><B>Sent:</B> 
  Sunday, December 16, 2007 1:00 AM<BR><B>To:</B> Shchupak, 
  Vitaliy<BR><B>Cc:</B> moin-user@lists.sourceforge.net<BR><B>Subject:</B> Re: 
  [Moin-user] interwiki include macro<BR></FONT><BR></DIV>
  <DIV></DIV>On Dec 15, 2007 2:10 PM, Shchupak, Vitaliy <<A 
  href="mailto:Vitaliy.Shchupak@deshaw.com">Vitaliy.Shchupak@deshaw.com</A>> 
  wrote:<BR>
  <DIV class=gmail_quote>
  <BLOCKQUOTE class=gmail_quote 
  style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
    <DIV>
    <DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff size=2>You 
    could use RequestCLI to execute the Include macro in another request using 
    something like this:</FONT></SPAN></DIV>
    <DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff 
    size=2></FONT></SPAN> </DIV>
    <DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff size=2>from 
    MoinMoin.request import RequestCLI</FONT></SPAN></DIV>
    <DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff size=2>from 
    MoinMion.user import User</FONT></SPAN></DIV>
    <DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff size=2>from 
    MoinMoin.formatter.text_html import Formatter</FONT></SPAN></DIV>
    <DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff size=2>def 
    execute(macro, args):</FONT></SPAN></DIV>
    <DIV dir=ltr align=left><SPAN>    <FONT face=Arial 
    color=#0000ff size=2># <extract wikiname from 
args></FONT></SPAN></DIV>
    <DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff 
    size=2>    </FONT></SPAN><SPAN><FONT face=Arial color=#0000ff 
    size=2>subreq = RequestCLI('localhost/' + wikiname)</FONT></SPAN></DIV>
    <DIV dir=ltr align=left><SPAN>    <FONT face=Arial 
    color=#0000ff size=2>subreq.user = user.User(subreq, name=<A 
    href="http://macro.request.user.name" 
    target=_blank>macro.request.user.name</A>)</FONT></SPAN></DIV>
    <DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff 
    size=2>    formatter = 
    Formatter(subreq)<BR>    subreq.formatter = 
    formatter<BR></FONT></SPAN><SPAN><FONT face=Arial color=#0000ff 
    size=2>    # now call the Include macro from here on 
    subreq...</FONT></SPAN></DIV>
    <DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff 
    size=2>    ...</FONT></SPAN></DIV>
    <DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff 
    size=2></FONT></SPAN> </DIV>
    <DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff 
    size=2>Vitaliy</FONT></SPAN></DIV><BR></DIV></BLOCKQUOTE></DIV><BR>Thanks! 
  That's too easy! I'm working on 1.6+1.7 code, so I had to use 
  request_cli.Request, but otherwise I just inserted the above into the Request 
  macro. Now comes something a little trickier - I need to rewrite the links. I 
  know I can do this the dirty way (by parsing the html output from the macro), 
  but I'd like a cleaner solution, and I'm a little confused whats getting 
  formatted where? <BR><BR>The links come out formatted for the current wiki, 
  but the css class="nonexistent" is set from the included wiki. In the end I 
  think I want to rewrite the links as interwiki links pointing to the same page 
  as was originally intended, but currently I just don't want valid-looking 
  links pointing to nonexistent pages. 
<BR><BR>Thanks<BR>-jim<BR><BR><BR><BR><BR></BLOCKQUOTE></BODY></HTML>