From jhermann at users.sourceforge.net Wed Apr 3 13:31:19 2002 From: jhermann at users.sourceforge.net (J?rgen Hermann) Date: Wed Apr 3 13:31:19 2002 Subject: [Moin-devel] CVS: MoinMoin config.py,1.64,1.65 Message-ID: Update of /cvsroot/moin/MoinMoin In directory usw-pr-cvs1:/tmp/cvs-serv7602/MoinMoin Modified Files: config.py Log Message: Proper url_prefix default Index: config.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/config.py,v retrieving revision 1.64 retrieving revision 1.65 diff -C2 -r1.64 -r1.65 *** config.py 27 Mar 2002 22:41:14 -0000 1.64 --- config.py 3 Apr 2002 21:22:23 -0000 1.65 *************** *** 120,124 **** 'umask': 0777, 'upperletters': 'A-Z\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd2\xd3\xd4\xd5\xd6\xd8\xd9\xda\xdb\xdc\xdd\xc7\xd0\xd1\xde', ! 'url_prefix': '/wiki-moinmoin', 'url_schemas': [], 'url_mappings': {}, --- 120,124 ---- 'umask': 0777, 'upperletters': 'A-Z\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd2\xd3\xd4\xd5\xd6\xd8\xd9\xda\xdb\xdc\xdd\xc7\xd0\xd1\xde', ! 'url_prefix': '/wiki', 'url_schemas': [], 'url_mappings': {}, From lele at seldati.it Thu Apr 4 03:29:04 2002 From: lele at seldati.it (Lele Gaifax) Date: Thu Apr 4 03:29:04 2002 Subject: [Moin-devel] DateTime macro bug Message-ID: <15532.14559.180785.84382@paci.nautilus> Hi, I have this situation: I changed a page at 11:37 (local time), with a @SIG@ variable in it, that was translated as Lele Gaifax [[DateTime(2002-04-04T11:37:36)]] but when I look at the page, that gets translated again in my local time, thus adding one hour. This is done in User.getTime() to adapt to user's timezone. I think the clean solution would be storing UTC times in the page, that is changing PageEditor._expand_variables() to use .gmtime() instead of .localtime()... What do you think? ciao&grazie, lele. -- nickname: Lele Gaifax | Quando vivro' di quello che ho pensato ieri real: Emanuele Gaifas | comincero' ad aver paura di chi mi copia. email: lele at seldati.it | -- Fortunato Depero, 1929. From jh at web.de Thu Apr 4 16:51:45 2002 From: jh at web.de (Juergen Hermann) Date: Thu Apr 4 16:51:45 2002 Subject: [Moin-devel] DateTime macro bug In-Reply-To: <15532.14559.180785.84382@paci.nautilus> Message-ID: On Thu, 4 Apr 2002 13:28:31 +0200, Lele Gaifax wrote: >but when I look at the page, that gets translated again in my local >time, thus adding one hour. This is done in User.getTime() to adapt to >user's timezone. Settings are an offset to the server's local time, NOT a timezone setting. I.e. if you work locally, you have to use 00:00. Ciao, J?rgen From jhermann at users.sourceforge.net Thu Apr 4 17:30:52 2002 From: jhermann at users.sourceforge.net (J?rgen Hermann) Date: Thu Apr 4 17:30:52 2002 Subject: [Moin-devel] CVS: MoinMoin/parser wiki.py,1.84,1.85 Message-ID: Update of /cvsroot/moin/MoinMoin/parser In directory usw-pr-cvs1:/tmp/cvs-serv17835/parser Modified Files: wiki.py Log Message: Fix for multi-digit list item leaders Index: wiki.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/parser/wiki.py,v retrieving revision 1.84 retrieving revision 1.85 diff -C2 -r1.84 -r1.85 *** wiki.py 17 Mar 2002 13:46:16 -0000 1.84 --- wiki.py 4 Apr 2002 19:45:49 -0000 1.85 *************** *** 49,53 **** } ! ol_rule = r"^\s+[0-9aAiI]\.(?:#\d+)?\s" dl_rule = r"^\s+.*?::\s" --- 49,53 ---- } ! ol_rule = r"^\s+(?:[0-9]+|[aAiI])\.(?:#\d+)?\s" dl_rule = r"^\s+.*?::\s" *************** *** 836,839 **** --- 836,840 ---- if match: numtype, numstart = string.split(string.strip(match.group(0)), '.') + numtype = numtype[0] if numstart and numstart[0] == "#": From lele at seldati.it Fri Apr 5 08:23:54 2002 From: lele at seldati.it (Lele Gaifax) Date: Fri Apr 5 08:23:54 2002 Subject: [Moin-devel] DateTime macro bug In-Reply-To: <15532.14559.180785.84382@paci.nautilus> References: <15532.14559.180785.84382@paci.nautilus> Message-ID: <15533.53070.753293.121207@paci.nautilus> Juergen, replying to me, said: >On Thu, 4 Apr 2002 13:28:31 +0200, Lele Gaifax wrote: > > >but when I look at the page, that gets translated again in my local > >time, thus adding one hour. This is done in User.getTime() to adapt to > >user's timezone. > > Settings are an offset to the server's local time, NOT a timezone > setting. I.e. if you work locally, you have to use 00:00. Mmm, but it *is* set to 0 in my profile, and for that matter, even an anonymous reader get "12:37" instead of the right "11:37"... I will investigate some further.... I'm still biased to prefer UTC timestamps in the pages. Imagine that you need to share the pages (the files themselves, I mean) with someone in another country.... ciao&grazie, lele. -- nickname: Lele Gaifax | Quando vivro' di quello che ho pensato ieri real: Emanuele Gaifas | comincero' ad aver paura di chi mi copia. email: lele at seldati.it | -- Fortunato Depero, 1929. From tforeman at ibsys.com Fri Apr 5 09:22:56 2002 From: tforeman at ibsys.com (tforeman at ibsys.com) Date: Fri Apr 5 09:22:56 2002 Subject: [Moin-devel] Newbie: I seem to have busted my Wiki Message-ID: <2193306919172547B8B169B499184FEA0688EFA7@osiris-a.ibsys.com> I upgraded glibc to 2.2.4-18.7.0.3 last night as part of upgrading another package and now my Wiki seems to be choking on the = tags for formatting. I have recompiled Python 2.2, and even installed Python 2.2c1 with no luck. I re-ran the setup.py script for the Wiki and still no luck. Anyone who would like to take a look and see if the tracebacks make any sense to them can see a non-functional page at: http://wiki.anansi-web.com/wiki/moin.cgi and a functional page (with no = tags) at: http://wiki.anansi-web.com/wiki/moin.cgi/test Thanks! -- Timothy W. Foreman ~ System Administrator ~ (651) 365-4181 Internet Broadcasting Systems, Inc. ~ tforeman at ibsys.com From noreply at sourceforge.net Sun Apr 7 14:40:01 2002 From: noreply at sourceforge.net (noreply at sourceforge.net) Date: Sun Apr 7 14:40:01 2002 Subject: [Moin-devel] [ moin-Bugs-540715 ] info page crashes if show_hosts=0 Message-ID: Bugs item #540715, was opened at 2002-04-07 17:39 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=108482&aid=540715&group_id=8482 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Mark Pilgrim (f8dy) Assigned to: Nobody/Anonymous (nobody) Summary: info page crashes if show_hosts=0 Initial Comment: set config.show_hosts to 0, now info page crashes at line 335 of wikiaction.py because log is only defined if show_hosts = 1. Hacked my local copy to move log definition outside if statement (line 300) and appears to work, but don't know if there are other ramifications of this solution. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=108482&aid=540715&group_id=8482 From jhermann at users.sourceforge.net Mon Apr 8 11:48:17 2002 From: jhermann at users.sourceforge.net (J?rgen Hermann) Date: Mon Apr 8 11:48:17 2002 Subject: [Moin-devel] CVS: MoinMoin/webapi cgiMoin.py,1.11,1.12 Message-ID: Update of /cvsroot/moin/MoinMoin/webapi In directory usw-pr-cvs1:/tmp/cvs-serv26067 Modified Files: cgiMoin.py Log Message: Return empty string for script name "/" Index: cgiMoin.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/webapi/cgiMoin.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -r1.11 -r1.12 *** cgiMoin.py 13 Feb 2002 21:13:55 -0000 1.11 --- cgiMoin.py 8 Apr 2002 18:47:41 -0000 1.12 *************** *** 24,30 **** os.environ.get('SSL_PROTOCOL_VERSION', '') != '' def getScriptname(): """ Return the scriptname part of the URL ("/path/to/my.cgi"). """ ! return os.environ.get('SCRIPT_NAME', '') --- 24,33 ---- os.environ.get('SSL_PROTOCOL_VERSION', '') != '' + def getScriptname(): """ Return the scriptname part of the URL ("/path/to/my.cgi"). """ ! name = os.environ.get('SCRIPT_NAME', '') ! if name == '/': return '' ! return name From jhermann at users.sourceforge.net Mon Apr 8 11:51:08 2002 From: jhermann at users.sourceforge.net (J?rgen Hermann) Date: Mon Apr 8 11:51:08 2002 Subject: [Moin-devel] CVS: MoinMoin wikiaction.py,1.62,1.63 Message-ID: Update of /cvsroot/moin/MoinMoin In directory usw-pr-cvs1:/tmp/cvs-serv26576 Modified Files: wikiaction.py Log Message: Always create log object Index: wikiaction.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/wikiaction.py,v retrieving revision 1.62 retrieving revision 1.63 diff -C2 -r1.62 -r1.63 *** wikiaction.py 27 Mar 2002 21:46:50 -0000 1.62 --- wikiaction.py 8 Apr 2002 18:50:07 -0000 1.63 *************** *** 308,311 **** --- 308,316 ---- revisions.append(os.path.join(config.backup_dir, file)) + # open log for this page + from MoinMoin import editlog + log = editlog.EditLog() + log.filter(pagename=pagename) + print '

' + _('Revision History') + '

\n' print '\n' *************** *** 314,320 **** print '' if config.show_hosts: - from MoinMoin import editlog - log = editlog.EditLog() - log.filter(pagename=pagename) print '' print '' --- 319,322 ---- *************** *** 333,336 **** --- 335,340 ---- ##print count, mtime, st[ST_MTIME], "
" + log.find(ed_time=mtime) + actions = "" if file != currentpage: *************** *** 347,351 **** if config.show_hosts: - log.find(ed_time=mtime) print '' % (log.getEditor() or _("N/A"),) --- 351,354 ---- From noreply at sourceforge.net Mon Apr 8 11:52:15 2002 From: noreply at sourceforge.net (noreply at sourceforge.net) Date: Mon Apr 8 11:52:15 2002 Subject: [Moin-devel] [ moin-Bugs-540715 ] info page crashes if show_hosts=0 Message-ID: Bugs item #540715, was opened at 2002-04-07 23:39 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=108482&aid=540715&group_id=8482 Category: None Group: None >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Mark Pilgrim (f8dy) Assigned to: Nobody/Anonymous (nobody) Summary: info page crashes if show_hosts=0 Initial Comment: set config.show_hosts to 0, now info page crashes at line 335 of wikiaction.py because log is only defined if show_hosts = 1. Hacked my local copy to move log definition outside if statement (line 300) and appears to work, but don't know if there are other ramifications of this solution. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=108482&aid=540715&group_id=8482 From jhermann at users.sourceforge.net Tue Apr 9 14:26:07 2002 From: jhermann at users.sourceforge.net (J?rgen Hermann) Date: Tue Apr 9 14:26:07 2002 Subject: [Moin-devel] CVS: MoinMoin config.py,1.65,1.66 Message-ID: Update of /cvsroot/moin/MoinMoin In directory usw-pr-cvs1:/tmp/cvs-serv7780/MoinMoin Modified Files: config.py Log Message: New print icon; permission fix for new uploads Index: config.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/config.py,v retrieving revision 1.65 retrieving revision 1.66 diff -C2 -r1.65 -r1.66 *** config.py 3 Apr 2002 21:22:23 -0000 1.65 --- config.py 9 Apr 2002 21:25:31 -0000 1.66 *************** *** 102,106 **** Subscribe XML ! Print View ''', --- 102,106 ---- Subscribe XML ! Print View ''', From jhermann at users.sourceforge.net Tue Apr 9 14:26:08 2002 From: jhermann at users.sourceforge.net (J?rgen Hermann) Date: Tue Apr 9 14:26:08 2002 Subject: [Moin-devel] CVS: MoinMoin/action AttachFile.py,1.29,1.30 Message-ID: Update of /cvsroot/moin/MoinMoin/action In directory usw-pr-cvs1:/tmp/cvs-serv7780/MoinMoin/action Modified Files: AttachFile.py Log Message: New print icon; permission fix for new uploads Index: AttachFile.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/action/AttachFile.py,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -r1.29 -r1.30 *** AttachFile.py 27 Mar 2002 22:51:03 -0000 1.29 --- AttachFile.py 9 Apr 2002 21:25:31 -0000 1.30 *************** *** 361,364 **** --- 361,366 ---- finally: stream.close() + os.chmod(fpath, 0666 & config.umask) + bytes = len(content) msg = _("Attachment '%(target)s' (remote name '%(filename)s')" From jhermann at users.sourceforge.net Tue Apr 9 14:26:08 2002 From: jhermann at users.sourceforge.net (J?rgen Hermann) Date: Tue Apr 9 14:26:08 2002 Subject: [Moin-devel] CVS: dist/wiki/htdocs/img moin-print.gif,1.1,1.2 Message-ID: Update of /cvsroot/moin/dist/wiki/htdocs/img In directory usw-pr-cvs1:/tmp/cvs-serv7780/wiki/htdocs/img Modified Files: moin-print.gif Log Message: New print icon; permission fix for new uploads Index: moin-print.gif =================================================================== RCS file: /cvsroot/moin/dist/wiki/htdocs/img/moin-print.gif,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 Binary files /tmp/cvsrjPdme and /tmp/cvsCvXUzi differ From asf at void.at Wed Apr 10 11:10:04 2002 From: asf at void.at (Andreas Fuchs) Date: Wed Apr 10 11:10:04 2002 Subject: [Moin-devel] Embedding LaTeX (or other text formatters) code into a wiki page Message-ID: I just tried out LaTeXWiki (http://www.rootnode.com/Wiki/Ebusiness/LatexWiki) for a collaborative mathematical wiki I have in mind. The problem with it is that its code base is far too old (and the ZWiki on which it put its base is far too buggy) and that it does not seem to get much development anymore. It is written in python, and I guess it should not be too hard to integrate it into MoinMoin. Do you think it is worth the effort? If so, what do you recommend, Making it a parser, or making it a macro? If anyone wonders, yes I probably will dig into the code and do it myself if nobody wants to help me with that. Anything to get away from ZWiki. (-: Thanks, -- Andreas Fuchs, , asf at jabber.at, antifuchs From jh at web.de Wed Apr 10 17:45:25 2002 From: jh at web.de (Juergen Hermann) Date: Wed Apr 10 17:45:25 2002 Subject: [Moin-devel] Embedding LaTeX (or other text formatters) code into a wiki page In-Reply-To: Message-ID: On Wed, 10 Apr 2002 20:09:04 +0200, Andreas Fuchs wrote: >I just tried out LaTeXWiki >(http://www.rootnode.com/Wiki/Ebusiness/LatexWiki) for a collaborative http://latexwiki.rootnode.com/wiki/FrontPage is dead, and I see no code anywhere. >It is written in python, and I guess it should not be too hard to >integrate it into MoinMoin. Do you think it is worth the effort? If so, >what do you recommend, Making it a parser, or making it a macro? So, w/o having looked at source code, your best bet is a processor. >If anyone wonders, yes I probably will dig into the code and do it >myself if nobody wants to help me with that. Anything to get away from >ZWiki. (-: I thought myself about adding some math support (http://hutchinson.belmont.ma.us/tth/, or MathML), so if you work on it, you can expect some help from me. Ciao, J?rgen From whisper at oz.net Wed Apr 10 19:10:03 2002 From: whisper at oz.net (David LeBlanc) Date: Wed Apr 10 19:10:03 2002 Subject: [Moin-devel] Embedding LaTeX (or other text formatters) code into a wiki page In-Reply-To: Message-ID: http://latexwiki.rootnode.com/wiki/FrontPage came right up for me. Source is at http://latexwiki.rootnode.com/wiki/LatexWiki It's 100% python. If this can be made to work on Windows, this would be really awesome! I wonder if mathml isn't an alternative? Of course, the only browser I know of that supports mathml is the W3C Amaya. http://www.w3.org/TR/REC-MathML/ Regards, David LeBlanc Seattle, WA USA > -----Original Message----- > From: moin-devel-admin at lists.sourceforge.net > [mailto:moin-devel-admin at lists.sourceforge.net]On Behalf Of Juergen > Hermann > Sent: Wednesday, April 10, 2002 13:42 > To: Andreas Fuchs; moin-devel at lists.sourceforge.net > Subject: Re: [Moin-devel] Embedding LaTeX (or other text formatters) > code into a wiki page > > > On Wed, 10 Apr 2002 20:09:04 +0200, Andreas Fuchs wrote: > > >I just tried out LaTeXWiki > >(http://www.rootnode.com/Wiki/Ebusiness/LatexWiki) for a collaborative > > http://latexwiki.rootnode.com/wiki/FrontPage > > is dead, and I see no code anywhere. > > >It is written in python, and I guess it should not be too hard to > >integrate it into MoinMoin. Do you think it is worth the effort? If so, > >what do you recommend, Making it a parser, or making it a macro? > > So, w/o having looked at source code, your best bet is a processor. > > >If anyone wonders, yes I probably will dig into the code and do it > >myself if nobody wants to help me with that. Anything to get away from > >ZWiki. (-: > > I thought myself about adding some math support > (http://hutchinson.belmont.ma.us/tth/, or MathML), so if you work on it, > you can expect some help from me. > > > Ciao, J?rgen > > > > _______________________________________________ > Moin-devel mailing list > Moin-devel at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/moin-devel From asf at void.at Wed Apr 10 21:58:05 2002 From: asf at void.at (Andreas Fuchs) Date: Wed Apr 10 21:58:05 2002 Subject: [Moin-devel] Embedding LaTeX (or other text formatters) code into a wiki page References: Message-ID: On 2002-04-10, Juergen Hermann wrote: > On Wed, 10 Apr 2002 20:09:04 +0200, Andreas Fuchs wrote: >>I just tried out LaTeXWiki >>(http://www.rootnode.com/Wiki/Ebusiness/LatexWiki) for a collaborative > > http://latexwiki.rootnode.com/wiki/FrontPage > is dead, and I see no code anywhere. Strange, it works for me (surely did when I posted the URL). >>It is written in python, and I guess it should not be too hard to >>integrate it into MoinMoin. Do you think it is worth the effort? If >>so, what do you recommend, Making it a parser, or making it a macro? > > So, w/o having looked at source code, your best bet is a processor. *takes note* are there any existing processors available, so I could take a look at some example code? >>If anyone wonders, yes I probably will dig into the code and do it >>myself if nobody wants to help me with that. Anything to get away from >>ZWiki. (-: > > I thought myself about adding some math support > (http://hutchinson.belmont.ma.us/tth/, or MathML), so if you work on > it, you can expect some help from me. This is great news! The alternatives you mention look good, though I think that MathML would be better (-: TtH needs time-expensive setup on each non-windows client accessing the Wiki. I don't think having to weed through X font configuration would make a maths wiki very attractive (-: MathML does work in Mozilla (don't know about opera or IE): try http://www.mozilla.org/projects/mathml/demo/basics.xhtml for an example. Latexwiki generates images from the LaTeX code, which puts a severe load on the server. I don't think that we would want that in MoinMoin, but it's another alternative. > Ciao, J?rgen Thanks, -- Andreas Fuchs, , asf at jabber.at, antifuchs From noreply at sourceforge.net Thu Apr 11 06:13:02 2002 From: noreply at sourceforge.net (noreply at sourceforge.net) Date: Thu Apr 11 06:13:02 2002 Subject: [Moin-devel] [ moin-Feature Requests-542490 ] Added user permission 'view' Message-ID: Feature Requests item #542490, was opened at 2002-04-11 06:12 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=358482&aid=542490&group_id=8482 Category: None Group: None Status: Open Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: Added user permission 'view' Initial Comment: Please add permission 'view' Must work similar to 'edit' and 'delete'. I've added it to security.py, but don't know how to implement it in Page.py properly... ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=358482&aid=542490&group_id=8482 From noreply at sourceforge.net Thu Apr 11 06:19:02 2002 From: noreply at sourceforge.net (noreply at sourceforge.net) Date: Thu Apr 11 06:19:02 2002 Subject: [Moin-devel] [ moin-Feature Requests-542490 ] Added user permission 'view' Message-ID: Feature Requests item #542490, was opened at 2002-04-11 06:12 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=358482&aid=542490&group_id=8482 Category: None Group: None Status: Open Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: Added user permission 'view' Initial Comment: Please add permission 'view' Must work similar to 'edit' and 'delete'. I've added it to security.py, but don't know how to implement it in Page.py properly... ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2002-04-11 06:18 Message: Logged In: NO i experimented with this awhile ago and changed cgimain.py to check the view permission. If it was false, I would send the UserPreferences page with a message saying you needed to login. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=358482&aid=542490&group_id=8482 From jeff at corrt.com Thu Apr 11 08:25:07 2002 From: jeff at corrt.com (Jeff Kunce) Date: Thu Apr 11 08:25:07 2002 Subject: [Moin-devel] [ moin-Feature Requests-542490 ] Added user permission 'view' In-Reply-To: Message-ID: <5.1.0.14.0.20020411101001.00a922f0@corrt.com> At 06:12 AM 4/11/2002 -0700, noreply at sourceforge.net wrote: >Initial Comment: >Please add permission 'view' > >Must work similar to 'edit' and 'delete'. > >I've added it to security.py, but don't know how to >implement it in Page.py properly... Don't have diffs for latest CVS, but the way I do it is to add (in Page.py): elif hasattr(user.current.may, 'read') and (not user.current.may.read): print "
You are not allowed to read this page
" right before: else: # parse the text and send the page content Parser(body).format(self.formatter, form) --Jeff From knaas at netjets.com Thu Apr 11 09:39:23 2002 From: knaas at netjets.com (Keith Naas) Date: Thu Apr 11 09:39:23 2002 Subject: [Moin-devel] [ moin-Feature Requests-542490 ] Added userpermission 'view' Message-ID: Wouldn't you also need to protect all of the actions you can do on a page? print info diff search >>> Jeff Kunce 04/11/02 11:15AM >>> At 06:12 AM 4/11/2002 -0700, noreply at sourceforge.net wrote: >Initial Comment: >Please add permission 'view' > >Must work similar to 'edit' and 'delete'. > >I've added it to security.py, but don't know how to >implement it in Page.py properly... Don't have diffs for latest CVS, but the way I do it is to add (in Page.py): elif hasattr(user.current.may, 'read') and (not user.current.may.read): print "
You are not allowed to read this page
" right before: else: # parse the text and send the page content Parser(body).format(self.formatter, form) --Jeff _______________________________________________ Moin-devel mailing list Moin-devel at lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/moin-devel From lele at seldati.it Thu Apr 11 10:12:03 2002 From: lele at seldati.it (Lele Gaifax) Date: Thu Apr 11 10:12:03 2002 Subject: [Moin-devel] Navigation bar Message-ID: <15541.50100.519887.334247@paci.nautilus> Hi all, I noticed a bad interaction between the navigation bar and the icon bar when the browser window isn't large enough. On Mozilla, the icons win and appears "above" the navigation bar, while with IE the result is worst since it badly mixes the two. This happens in particular when seeing the translated page names, that in Italian are a little longer. So I patched Moin to integrate the two, by putting all the icons in the rightmost cell of the table containing the navbar: * wikiutil.py (send_title): Put the iconbar as the rightmost column of the navigation bar. Removed the 'valign="top"' from the table's cells. * config.py (page_icons): Removed the 'align="right"' attribute. I seem to like this solution... :) The icons are even more "readable" with the gray background. If anybody interested, I can easily provide the patch. bye, lele. -- nickname: Lele Gaifax | Quando vivro' di quello che ho pensato ieri real: Emanuele Gaifas | comincero' ad aver paura di chi mi copia. email: lele at seldati.it | -- Fortunato Depero, 1929. From jh at web.de Thu Apr 11 10:41:07 2002 From: jh at web.de (Juergen Hermann) Date: Thu Apr 11 10:41:07 2002 Subject: [Moin-devel] Embedding LaTeX (or other text formatters) code into a wiki page In-Reply-To: Message-ID: On Thu, 11 Apr 2002 06:56:50 +0200, Andreas Fuchs wrote: >*takes note* are there any existing processors available, so I could >take a look at some example code? See the CVS archive. >Latexwiki generates images from the LaTeX code, which puts a severe load >on the server. I don't think that we would want that in MoinMoin, but >it's another alternative. That is easily solved by caching. Ciao, J?rgen From asf at void.at Thu Apr 11 12:52:57 2002 From: asf at void.at (Andreas Fuchs) Date: Thu Apr 11 12:52:57 2002 Subject: [Moin-devel] Embedding LaTeX (or other text formatters) code into a wiki page References: Message-ID: Today, Juergen Hermann wrote: >>Latexwiki generates images from the LaTeX code, which puts a severe >>load on the server. I don't think that we would want that in MoinMoin, >>but it's another alternative. > > That is easily solved by caching. Right, that's what the makers of latexwiki thought, too. It optimizes image generation and access heavily (with hash values generated from the formula used for the file name and by running only one latex instance per page), but even then, it's straining the server quite badly. From noreply at sourceforge.net Fri Apr 12 07:31:40 2002 From: noreply at sourceforge.net (noreply at sourceforge.net) Date: Fri Apr 12 07:31:40 2002 Subject: [Moin-devel] [ moin-Feature Requests-542490 ] Added user permission 'view' Message-ID: Feature Requests item #542490, was opened at 2002-04-11 06:12 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=358482&aid=542490&group_id=8482 Category: None Group: None Status: Open Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: Added user permission 'view' Initial Comment: Please add permission 'view' Must work similar to 'edit' and 'delete'. I've added it to security.py, but don't know how to implement it in Page.py properly... ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2002-04-12 07:29 Message: Logged In: NO So where do I get these experiments? I cannot see anything in my copy, is there a diff someplace? ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2002-04-11 06:18 Message: Logged In: NO i experimented with this awhile ago and changed cgimain.py to check the view permission. If it was false, I would send the UserPreferences page with a message saying you needed to login. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=358482&aid=542490&group_id=8482 From jhermann at users.sourceforge.net Tue Apr 16 13:25:06 2002 From: jhermann at users.sourceforge.net (J?rgen Hermann) Date: Tue Apr 16 13:25:06 2002 Subject: [Moin-devel] CVS: MoinMoin version.py,1.155,1.156 Message-ID: Update of /cvsroot/moin/MoinMoin In directory usw-pr-cvs1:/tmp/cvs-serv6369 Modified Files: version.py Log Message: Bumped revision Index: version.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/version.py,v retrieving revision 1.155 retrieving revision 1.156 diff -C2 -r1.155 -r1.156 From j.her at t-online.de Tue Apr 16 13:34:04 2002 From: j.her at t-online.de (Juergen Hermann) Date: Tue Apr 16 13:34:04 2002 Subject: [Moin-devel] "request" refactoring Message-ID: <16xZap-2IJuO8C@fwd00.sul.t-online.com> Hi! Refactoring to hand around a request object started, note that this will break quite some interfaces (I could change them in an upgradeable way, but that would add a lot of cruft). Especially, the action, macro etc. call interfaces will change, i.e. you'll have to adapt your extensions when I'm finished. Ciao, J?rgen From jhermann at users.sourceforge.net Tue Apr 16 14:04:08 2002 From: jhermann at users.sourceforge.net (J?rgen Hermann) Date: Tue Apr 16 14:04:08 2002 Subject: [Moin-devel] CVS: MoinMoin PageEditor.py,1.1,1.2 cgimain.py,1.49,1.50 wikiaction.py,1.63,1.64 Message-ID: Update of /cvsroot/moin/MoinMoin In directory usw-pr-cvs1:/tmp/cvs-serv18462 Modified Files: PageEditor.py cgimain.py wikiaction.py Log Message: Handing request object to form actions Index: PageEditor.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/PageEditor.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** PageEditor.py 27 Mar 2002 21:46:50 -0000 1.1 --- PageEditor.py 16 Apr 2002 21:03:33 -0000 1.2 *************** *** 169,173 **** form.has_key('button_spellcheck') or form.has_key('button_newwords')): ! badwords, badwords_re, msg = SpellCheck.checkSpelling(self, form, own_form=0) print "

", msg print '' --- 169,173 ---- form.has_key('button_spellcheck') or form.has_key('button_newwords')): ! badwords, badwords_re, msg = SpellCheck.checkSpelling(self, request, own_form=0) print "

", msg print '' Index: cgimain.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/cgimain.py,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -r1.49 -r1.50 *** cgimain.py 21 Mar 2002 00:18:24 -0000 1.49 --- cgimain.py 16 Apr 2002 21:03:33 -0000 1.50 *************** *** 168,172 **** handler = wikiaction.getHandler(action) if handler: ! handler(pagename or wikiutil.getSysPage(config.page_front_page).page_name, request.form) else: webapi.http_headers() --- 168,172 ---- handler = wikiaction.getHandler(action) if handler: ! handler(pagename or wikiutil.getSysPage(config.page_front_page).page_name, request) else: webapi.http_headers() Index: wikiaction.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/wikiaction.py,v retrieving revision 1.63 retrieving revision 1.64 diff -C2 -r1.63 -r1.64 *** wikiaction.py 8 Apr 2002 18:50:07 -0000 1.63 --- wikiaction.py 16 Apr 2002 21:03:34 -0000 1.64 *************** *** 32,36 **** ############################################################################# ! def do_fullsearch(pagename, form, fieldname='value'): start = time.clock() --- 32,36 ---- ############################################################################# ! def do_fullsearch(pagename, request, fieldname='value'): start = time.clock() *************** *** 39,52 **** # get parameters ! if form.has_key(fieldname): ! needle = form[fieldname].value else: needle = '' try: ! case = int(form['case'].value) except (KeyError, ValueError): case = 0 try: ! context = int(form['context'].value) except (KeyError, ValueError): context = 0 --- 39,52 ---- # get parameters ! if request.form.has_key(fieldname): ! needle = request.form[fieldname].value else: needle = '' try: ! case = int(request.form['case'].value) except (KeyError, ValueError): case = 0 try: ! context = int(request.form['context'].value) except (KeyError, ValueError): context = 0 *************** *** 58,62 **** # search the pages pagecount, hits = wikiutil.searchPages(needle, ! literal=form.has_key('literal'), context=context, case=case) --- 58,62 ---- # search the pages pagecount, hits = wikiutil.searchPages(needle, ! literal=request.form.has_key('literal'), context=context, case=case) *************** *** 77,90 **** print_search_stats(len(hits), pagecount, start) ! wikiutil.send_footer(pagename, editable=0, showactions=0, form=form) ! def do_titlesearch(pagename, form, fieldname='value'): start = time.clock() webapi.http_headers() ! if form.has_key(fieldname): ! needle = form[fieldname].value else: needle = '' --- 77,90 ---- print_search_stats(len(hits), pagecount, start) ! wikiutil.send_footer(pagename, editable=0, showactions=0, form=request.form) ! def do_titlesearch(pagename, request, fieldname='value'): start = time.clock() webapi.http_headers() ! if request.form.has_key(fieldname): ! needle = request.form[fieldname].value else: needle = '' *************** *** 106,128 **** print_search_stats(len(hits), len(all_pages), start) ! wikiutil.send_footer(pagename, editable=0, showactions=0, form=form) ! def do_inlinesearch(pagename, form): ! if form.has_key('button_title.x'): ! if form['button_title.x'].value == "0" and \ ! form.has_key('text_full') and \ ! not form.has_key('text_title'): search = 'full' else: search = 'title' ! elif form.has_key('button_full.x'): search = 'full' ! elif form.has_key('text_full'): search = 'full' else: search = 'title' ! globals()["do_%ssearch" % search](pagename, form, fieldname = "text_" + search) --- 106,128 ---- print_search_stats(len(hits), len(all_pages), start) ! wikiutil.send_footer(pagename, editable=0, showactions=0, form=request.form) ! def do_inlinesearch(pagename, request): ! if request.form.has_key('button_title.x'): ! if request.form['button_title.x'].value == "0" and \ ! request.form.has_key('text_full') and \ ! not request.form.has_key('text_title'): search = 'full' else: search = 'title' ! elif request.form.has_key('button_full.x'): search = 'full' ! elif request.form.has_key('text_full'): search = 'full' else: search = 'title' ! globals()["do_%ssearch" % search](pagename, request, fieldname = "text_" + search) *************** *** 132,138 **** ! def do_highlight(pagename, form): ! if form.has_key('value'): ! needle = form["value"].value else: needle = '' --- 132,138 ---- ! def do_highlight(pagename, request): ! if request.form.has_key('value'): ! needle = request.form["value"].value else: needle = '' *************** *** 144,148 **** needle_re = re.compile(needle, re.IGNORECASE) ! Page(pagename).send_page(form, hilite_re=needle_re) --- 144,148 ---- needle_re = re.compile(needle, re.IGNORECASE) ! Page(pagename).send_page(request.form, hilite_re=needle_re) *************** *** 151,155 **** ############################################################################# ! def do_diff(pagename, form): """ Handle "action=diff", checking for a "date=backupdate" parameter """ webapi.http_headers() --- 151,155 ---- ############################################################################# ! def do_diff(pagename, request): """ Handle "action=diff", checking for a "date=backupdate" parameter """ webapi.http_headers() *************** *** 157,161 **** # try to get a specific date to compare to, or None for one-before-current try: ! diff_date = form['date'].value try: diff_date = float(diff_date) --- 157,161 ---- # try to get a specific date to compare to, or None for one-before-current try: ! diff_date = request.form['date'].value try: diff_date = float(diff_date) *************** *** 167,171 **** # spacing flag? try: ! ignorews = int(form['ignorews'].value) except (KeyError, ValueError, TypeError): ignorews = 0 --- 167,171 ---- # spacing flag? try: ! ignorews = int(request.form['ignorews'].value) except (KeyError, ValueError, TypeError): ignorews = 0 *************** *** 174,178 **** oldversions = wikiutil.getBackupList(config.backup_dir, pagename) if not oldversions: ! Page(pagename).send_page(form, msg=_("No older revisions available!")) return --- 174,178 ---- oldversions = wikiutil.getBackupList(config.backup_dir, pagename) if not oldversions: ! Page(pagename).send_page(request.form, msg=_("No older revisions available!")) return *************** *** 202,206 **** 'count': edit_count, 'times': (_(' time'), _(' times'))[edit_count != 1]} ! Page(pagename).send_page(form, msg=msg) return --- 202,206 ---- 'count': edit_count, 'times': (_(' time'), _(' times'))[edit_count != 1]} ! Page(pagename).send_page(request.form, msg=msg) return *************** *** 269,273 **** ! def do_info(pagename, form): from stat import ST_MTIME, ST_SIZE from MoinMoin.stats import hitcounts --- 269,273 ---- ! def do_info(pagename, request): from stat import ST_MTIME, ST_SIZE from MoinMoin.stats import hitcounts *************** *** 286,290 **** # show attachments (if allowed) attachment_info = getHandler('AttachFile', 'info') ! if attachment_info: attachment_info(pagename, form) # show links --- 286,290 ---- # show attachments (if allowed) attachment_info = getHandler('AttachFile', 'info') ! if attachment_info: attachment_info(pagename, request.form) # show links *************** *** 363,422 **** ! def do_recall(pagename, form): ! Page(pagename, date=form['date'].value).send_page(form) ! def do_show(pagename, form): ! Page(pagename).send_page(form, count_hit=1) ! def do_refresh(pagename, form): ! if form.has_key('arena') and form.has_key('key'): from MoinMoin import caching ! cache = caching.CacheEntry(form["arena"].value, form["key"].value) cache.remove() ! do_show(pagename, form) ! def do_print(pagename, form): ! do_show(pagename, form) ! def do_content(pagename, form): webapi.http_headers() page = Page(pagename) print '' % webapi.getQualifiedURL(page.url()) ! page.send_page(form, count_hit=0, content_only=1) sys.exit(0) ! def do_edit(pagename, form): from MoinMoin.PageEditor import PageEditor ! PageEditor(pagename).send_editor(form) ! def do_savepage(pagename, form): from MoinMoin.PageEditor import PageEditor pg = PageEditor(pagename) try: ! savetext = form['savetext'].value except KeyError: savetext = "" try: ! datestamp = form['datestamp'].value except KeyError: datestamp = "" try: ! rstrip = int(form['rstrip'].value) except (KeyError, ValueError): rstrip = 0 try: ! notify = int(form['notify'].value) except (KeyError, ValueError): notify = 0 try: ! comment = form['comment'].value except KeyError: comment = "" --- 363,422 ---- ! def do_recall(pagename, request): ! Page(pagename, date=request.form['date'].value).send_page(request.form) ! def do_show(pagename, request): ! Page(pagename).send_page(request.form, count_hit=1) ! def do_refresh(pagename, request): ! if request.form.has_key('arena') and request.form.has_key('key'): from MoinMoin import caching ! cache = caching.CacheEntry(request.form["arena"].value, request.form["key"].value) cache.remove() ! do_show(pagename, request) ! def do_print(pagename, request): ! do_show(pagename, request) ! def do_content(pagename, request): webapi.http_headers() page = Page(pagename) print '' % webapi.getQualifiedURL(page.url()) ! page.send_page(request.form, count_hit=0, content_only=1) sys.exit(0) ! def do_edit(pagename, request): from MoinMoin.PageEditor import PageEditor ! PageEditor(pagename).send_editor(request.form) ! def do_savepage(pagename, request): from MoinMoin.PageEditor import PageEditor pg = PageEditor(pagename) try: ! savetext = request.form['savetext'].value except KeyError: savetext = "" try: ! datestamp = request.form['datestamp'].value except KeyError: datestamp = "" try: ! rstrip = int(request.form['rstrip'].value) except (KeyError, ValueError): rstrip = 0 try: ! notify = int(request.form['notify'].value) except (KeyError, ValueError): notify = 0 try: ! comment = request.form['comment'].value except KeyError: comment = "" *************** *** 428,443 **** comment = string.translate(comment, remap_chars, control_chars) ! if form.has_key('button_preview') or form.has_key('button_spellcheck') \ ! or form.has_key('button_newwords'): ! pg.send_editor(form, preview=1, comment=comment) ! elif form.has_key('button_cancel'): ! pg.send_page(form, msg=_('Edit was cancelled.')) else: savemsg = pg.save_text(savetext, datestamp, stripspaces=rstrip, notify=notify, comment=comment) ! pg.send_page(form, msg=savemsg) ! def do_subscribe(pagename, form): """ Add the current wiki page to the subscribed_page property in current user profile. --- 428,443 ---- comment = string.translate(comment, remap_chars, control_chars) ! if request.form.has_key('button_preview') or request.form.has_key('button_spellcheck') \ ! or request.form.has_key('button_newwords'): ! pg.send_editor(request.form, preview=1, comment=comment) ! elif request.form.has_key('button_cancel'): ! pg.send_page(request.form, msg=_('Edit was cancelled.')) else: savemsg = pg.save_text(savetext, datestamp, stripspaces=rstrip, notify=notify, comment=comment) ! pg.send_page(request.form, msg=savemsg) ! def do_subscribe(pagename, request): """ Add the current wiki page to the subscribed_page property in current user profile. *************** *** 484,500 **** ''') ! Page(pagename).send_page(form, msg=msg) ! def do_userform(pagename, form): from MoinMoin import userform ! savemsg=userform.savedata(pagename, form) ! Page(pagename).send_page(form, msg=savemsg) ! def do_bookmark(pagename, form): ! if form.has_key('time'): try: ! tm = int(form["time"].value) except StandardError: tm = time.time() --- 484,500 ---- ''') ! Page(pagename).send_page(request.form, msg=msg) ! def do_userform(pagename, request): from MoinMoin import userform ! savemsg=userform.savedata(pagename, request.form) ! Page(pagename).send_page(request.form, msg=savemsg) ! def do_bookmark(pagename, request): ! if request.form.has_key('time'): try: ! tm = int(request.form["time"].value) except StandardError: tm = time.time() *************** *** 503,513 **** user.current.setBookmark(tm) ! Page(pagename).send_page(form) ! def do_formtest(pagename, form): # test a user defined form from MoinMoin import wikiform ! wikiform.do_formtest(pagename, form) --- 503,513 ---- user.current.setBookmark(tm) ! Page(pagename).send_page(request.form) ! def do_formtest(pagename, request): # test a user defined form from MoinMoin import wikiform ! wikiform.do_formtest(pagename, request) *************** *** 516,524 **** ############################################################################# ! def do_raw(pagename, form): webapi.http_headers(["Content-type: text/plain"]) try: ! page = Page(pagename, date=form['date'].value) except KeyError: page = Page(pagename) --- 516,524 ---- ############################################################################# ! def do_raw(pagename, request): webapi.http_headers(["Content-type: text/plain"]) try: ! page = Page(pagename, date=request.form['date'].value) except KeyError: page = Page(pagename) *************** *** 528,535 **** ! def do_format(pagename, form): # get the MIME type ! if form.has_key('mimetype'): ! mimetype = form['mimetype'].value else: mimetype = "text/plain" --- 528,535 ---- ! def do_format(pagename, request): # get the MIME type ! if request.form.has_key('mimetype'): ! mimetype = request.form['mimetype'].value else: mimetype = "text/plain" *************** *** 547,568 **** webapi.http_headers(["Content-Type: " + 'text/plain']) ! Page(pagename, formatter = Formatter()).send_page(form) sys.exit(0) ! def do_rss_rc(pagename, form): from MoinMoin.macro import RecentChanges ! RecentChanges.rss(pagename, form) ! def do_chart(pagename, form): ! chart_type = form['type'].value func = util.importName("MoinMoin.stats." + chart_type, "draw") ! apply(func, (pagename, form)) sys.exit(0) ! def do_dumpform(pagename, form): ! data = util.dumpFormData(form) webapi.http_headers() --- 547,568 ---- webapi.http_headers(["Content-Type: " + 'text/plain']) ! Page(pagename, formatter = Formatter()).send_page(request.form) sys.exit(0) ! def do_rss_rc(pagename, request): from MoinMoin.macro import RecentChanges ! RecentChanges.rss(pagename, request.form) ! def do_chart(pagename, request): ! chart_type = request.form['type'].value func = util.importName("MoinMoin.stats." + chart_type, "draw") ! apply(func, (pagename, request.form)) sys.exit(0) ! def do_dumpform(pagename, request): ! data = util.dumpFormData(request.form) webapi.http_headers() *************** *** 573,582 **** ! def do_export(pagename, form): import shutil, cStringIO from MoinMoin.wikixml import wikiexport # get parameters ! compression = form.getvalue('compression', None) # prepare output stream --- 573,582 ---- ! def do_export(pagename, request): import shutil, cStringIO from MoinMoin.wikixml import wikiexport # get parameters ! compression = request.form.getvalue('compression', None) # prepare output stream From jhermann at users.sourceforge.net Tue Apr 16 14:04:09 2002 From: jhermann at users.sourceforge.net (J?rgen Hermann) Date: Tue Apr 16 14:04:09 2002 Subject: [Moin-devel] CVS: MoinMoin/action AttachFile.py,1.30,1.31 DeletePage.py,1.10,1.11 LikePages.py,1.10,1.11 LocalSiteMap.py,1.3,1.4 SpellCheck.py,1.20,1.21 __init__.py,1.4,1.5 links.py,1.2,1.3 titleindex.py,1.3,1.4 Message-ID: Update of /cvsroot/moin/MoinMoin/action In directory usw-pr-cvs1:/tmp/cvs-serv18462/action Modified Files: AttachFile.py DeletePage.py LikePages.py LocalSiteMap.py SpellCheck.py __init__.py links.py titleindex.py Log Message: Handing request object to form actions Index: AttachFile.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/action/AttachFile.py,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -r1.30 -r1.31 *** AttachFile.py 9 Apr 2002 21:25:31 -0000 1.30 --- AttachFile.py 16 Apr 2002 21:03:34 -0000 1.31 *************** *** 268,274 **** ############################################################################# ! def execute(pagename, form): """ Main dispatcher for the 'AttachFile' action. """ msg = None if action_name in config.excluded_actions: --- 268,276 ---- ############################################################################# ! def execute(pagename, request): """ Main dispatcher for the 'AttachFile' action. """ + form = request.form + msg = None if action_name in config.excluded_actions: Index: DeletePage.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/action/DeletePage.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -r1.10 -r1.11 *** DeletePage.py 27 Mar 2002 21:46:51 -0000 1.10 --- DeletePage.py 16 Apr 2002 21:03:34 -0000 1.11 *************** *** 18,22 **** ! def execute(pagename, form): actname = string.split(__name__, '.')[-1] page = PageEditor(pagename) --- 18,24 ---- ! def execute(pagename, request): ! form = request.form ! actname = string.split(__name__, '.')[-1] page = PageEditor(pagename) Index: LikePages.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/action/LikePages.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -r1.10 -r1.11 *** LikePages.py 27 Mar 2002 22:51:03 -0000 1.10 --- LikePages.py 16 Apr 2002 21:03:34 -0000 1.11 *************** *** 19,25 **** ! def execute(pagename, form, s_re=re.compile('([%s][%s]+)' % (config.upperletters, config.lowerletters)), e_re=re.compile('([%s][%s]+)$' % (config.upperletters, config.lowerletters))): # figure the start and end words --- 19,27 ---- ! def execute(pagename, request, s_re=re.compile('([%s][%s]+)' % (config.upperletters, config.lowerletters)), e_re=re.compile('([%s][%s]+)$' % (config.upperletters, config.lowerletters))): + + form = request.form # figure the start and end words Index: LocalSiteMap.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/action/LocalSiteMap.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** LocalSiteMap.py 13 Feb 2002 21:13:52 -0000 1.3 --- LocalSiteMap.py 16 Apr 2002 21:03:34 -0000 1.4 *************** *** 36,40 **** ! def execute(pagename, form): webapi.http_headers() wikiutil.send_title(_('Local Site Map for "%s"') % (pagename), --- 36,42 ---- ! def execute(pagename, request): ! form = request.form ! webapi.http_headers() wikiutil.send_title(_('Local Site Map for "%s"') % (pagename), Index: SpellCheck.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/action/SpellCheck.py,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -r1.20 -r1.21 *** SpellCheck.py 27 Mar 2002 21:46:51 -0000 1.20 --- SpellCheck.py 16 Apr 2002 21:03:34 -0000 1.21 *************** *** 26,30 **** from MoinMoin import config, user, util, wikiutil from MoinMoin.Page import Page - from MoinMoin.cgimain import request from MoinMoin.i18n import _ --- 26,29 ---- *************** *** 51,55 **** ! def _loadWordsFile(dict, filename): request.clock.start('spellread') file = open(filename, 'rt') --- 50,54 ---- ! def _loadWordsFile(request, dict, filename): request.clock.start('spellread') file = open(filename, 'rt') *************** *** 66,70 **** ! def _loadDict(): """ Load words from words files or cached dict """ # check for "dbhash" module --- 65,69 ---- ! def _loadDict(request): """ Load words from words files or cached dict """ # check for "dbhash" module *************** *** 87,91 **** for wordsfile in wordsfiles: ! _loadWordsFile(wordsdict, wordsfile) if dbhash: wordsdict.sync() --- 86,90 ---- for wordsfile in wordsfiles: ! _loadWordsFile(request, wordsdict, wordsfile) if dbhash: wordsdict.sync() *************** *** 95,99 **** ! def _addLocalWords(form): from MoinMoin.PageEditor import PageEditor --- 94,98 ---- ! def _addLocalWords(request): from MoinMoin.PageEditor import PageEditor *************** *** 104,108 **** # get the new words as a string import types ! newwords = form['newwords'] if type(newwords) is not types.ListType: newwords = [newwords] --- 103,107 ---- # get the new words as a string import types ! newwords = request.form['newwords'] if type(newwords) is not types.ListType: newwords = [newwords] *************** *** 115,130 **** ! def checkSpelling(page, form, own_form=1): """ Do spell checking, return a tuple with the result. """ # first check to see if we we're called with a "newwords" parameter ! if form.has_key('button_newwords'): _addLocalWords(form) # load words ! wordsdict = _loadDict() localwords = {} lsw_page = Page(config.page_local_spelling_words) ! if lsw_page.exists(): _loadWordsFile(localwords, lsw_page._text_filename()) # init status vars & load page --- 114,129 ---- ! def checkSpelling(page, request, own_form=1): """ Do spell checking, return a tuple with the result. """ # first check to see if we we're called with a "newwords" parameter ! if request.form.has_key('button_newwords'): _addLocalWords(request) # load words ! wordsdict = _loadDict(request) localwords = {} lsw_page = Page(config.page_local_spelling_words) ! if lsw_page.exists(): _loadWordsFile(request, localwords, lsw_page._text_filename()) # init status vars & load page *************** *** 203,213 **** ! def execute(pagename, form): page = Page(pagename) ! badwords, badwords_re, msg = checkSpelling(page, form) if badwords: ! page.send_page(form, msg=msg, hilite_re=badwords_re) else: ! page.send_page(form, msg=msg) --- 202,212 ---- ! def execute(pagename, request): page = Page(pagename) ! badwords, badwords_re, msg = checkSpelling(page, request) if badwords: ! page.send_page(request.form, msg=msg, hilite_re=badwords_re) else: ! page.send_page(request.form, msg=msg) Index: __init__.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/action/__init__.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** __init__.py 13 Feb 2002 21:13:52 -0000 1.4 --- __init__.py 16 Apr 2002 21:03:34 -0000 1.5 *************** *** 11,16 **** --- 11,18 ---- from MoinMoin import config, util + # create a list of extension actions from the subpackage directory extension_actions = util.getPackageModules(__file__) + # remove actions excluded by the configuration for action in config.excluded_actions: try: Index: links.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/action/links.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** links.py 16 Mar 2002 00:17:34 -0000 1.2 --- links.py 16 Apr 2002 21:03:34 -0000 1.3 *************** *** 15,19 **** ! def execute(pagename, form): # get the MIME type if form.has_key('mimetype'): --- 15,21 ---- ! def execute(pagename, request): ! form = request.form ! # get the MIME type if form.has_key('mimetype'): Index: titleindex.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/action/titleindex.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** titleindex.py 15 Mar 2001 22:20:25 -0000 1.3 --- titleindex.py 16 Apr 2002 21:03:34 -0000 1.4 *************** *** 16,20 **** ! def execute(pagename, form): # get the MIME type if form.has_key('mimetype'): --- 16,22 ---- ! def execute(pagename, request): ! form = request.form ! # get the MIME type if form.has_key('mimetype'): From jhermann at users.sourceforge.net Tue Apr 16 14:13:01 2002 From: jhermann at users.sourceforge.net (J?rgen Hermann) Date: Tue Apr 16 14:13:01 2002 Subject: [Moin-devel] CVS: MoinMoin PageEditor.py,1.2,1.3 wikiaction.py,1.64,1.65 Message-ID: Update of /cvsroot/moin/MoinMoin In directory usw-pr-cvs1:/tmp/cvs-serv21749 Modified Files: PageEditor.py wikiaction.py Log Message: send_editor() takes a request object Index: PageEditor.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/PageEditor.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** PageEditor.py 16 Apr 2002 21:03:33 -0000 1.2 --- PageEditor.py 16 Apr 2002 21:12:03 -0000 1.3 *************** *** 11,15 **** import cStringIO, os, re, sys, string, time, urllib from MoinMoin import caching, config, eventlog, user, util, wikiutil, webapi - from MoinMoin.cgimain import request from MoinMoin.Page import Page from MoinMoin.i18n import _ --- 11,14 ---- *************** *** 33,37 **** ! def send_editor(self, form, **kw): """ Send the editor form page. --- 32,36 ---- ! def send_editor(self, request, **kw): """ Send the editor form page. *************** *** 45,48 **** --- 44,49 ---- except ImportError: SpellCheck = None + + form = request.form # check edit permissions Index: wikiaction.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/wikiaction.py,v retrieving revision 1.64 retrieving revision 1.65 diff -C2 -r1.64 -r1.65 *** wikiaction.py 16 Apr 2002 21:03:34 -0000 1.64 --- wikiaction.py 16 Apr 2002 21:12:06 -0000 1.65 *************** *** 394,398 **** def do_edit(pagename, request): from MoinMoin.PageEditor import PageEditor ! PageEditor(pagename).send_editor(request.form) --- 394,398 ---- def do_edit(pagename, request): from MoinMoin.PageEditor import PageEditor ! PageEditor(pagename).send_editor(request) *************** *** 430,434 **** if request.form.has_key('button_preview') or request.form.has_key('button_spellcheck') \ or request.form.has_key('button_newwords'): ! pg.send_editor(request.form, preview=1, comment=comment) elif request.form.has_key('button_cancel'): pg.send_page(request.form, msg=_('Edit was cancelled.')) --- 430,434 ---- if request.form.has_key('button_preview') or request.form.has_key('button_spellcheck') \ or request.form.has_key('button_newwords'): ! pg.send_editor(request, preview=1, comment=comment) elif request.form.has_key('button_cancel'): pg.send_page(request.form, msg=_('Edit was cancelled.')) From jhermann at users.sourceforge.net Wed Apr 17 12:32:46 2002 From: jhermann at users.sourceforge.net (J?rgen Hermann) Date: Wed Apr 17 12:32:46 2002 Subject: [Moin-devel] CVS: MoinMoin Page.py,1.112,1.113 Message-ID: Update of /cvsroot/moin/MoinMoin In directory usw-pr-cvs1:/tmp/cvs-serv2785 Modified Files: Page.py Log Message: request passing: processors and parsers Index: Page.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/Page.py,v retrieving revision 1.112 retrieving revision 1.113 diff -C2 -r1.112 -r1.113 *** Page.py 27 Mar 2002 22:41:14 -0000 1.112 --- Page.py 17 Apr 2002 19:24:57 -0000 1.113 *************** *** 378,382 **** else: # parse the text and send the page content ! Parser(body).format(self.formatter, form) # check for pending footnotes --- 378,382 ---- else: # parse the text and send the page content ! Parser(body, request).format(self.formatter, form) # check for pending footnotes From jhermann at users.sourceforge.net Wed Apr 17 12:44:37 2002 From: jhermann at users.sourceforge.net (J?rgen Hermann) Date: Wed Apr 17 12:44:37 2002 Subject: [Moin-devel] CVS: MoinMoin/parser plain.py,1.6,1.7 python.py,1.9,1.10 wiki.py,1.85,1.86 xslt.py,1.10,1.11 Message-ID: Update of /cvsroot/moin/MoinMoin/parser In directory usw-pr-cvs1:/tmp/cvs-serv2785/parser Modified Files: plain.py python.py wiki.py xslt.py Log Message: request passing: processors and parsers Index: plain.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/parser/plain.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** plain.py 13 Feb 2002 21:13:54 -0000 1.6 --- plain.py 17 Apr 2002 19:24:58 -0000 1.7 *************** *** 21,25 **** """ ! def __init__(self, raw, **kw): self.raw = raw --- 21,25 ---- """ ! def __init__(self, raw, request, **kw): self.raw = raw Index: python.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/parser/python.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -r1.9 -r1.10 *** python.py 4 Mar 2002 19:12:57 -0000 1.9 --- python.py 17 Apr 2002 19:24:58 -0000 1.10 *************** *** 85,89 **** """ ! def __init__(self, raw, lineinfo={}, **kw): """ Store the source text. """ --- 85,89 ---- """ ! def __init__(self, raw, request, lineinfo={}, **kw): """ Store the source text. """ *************** *** 167,171 **** # write colorized version to "python.html" ! Parser(source, out = open('python.html', 'wt')).format(None, None) # load HTML page into browser --- 167,171 ---- # write colorized version to "python.html" ! Parser(source, None, out = open('python.html', 'wt')).format(None, None) # load HTML page into browser Index: wiki.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/parser/wiki.py,v retrieving revision 1.85 retrieving revision 1.86 diff -C2 -r1.85 -r1.86 *** wiki.py 4 Apr 2002 19:45:49 -0000 1.85 --- wiki.py 17 Apr 2002 19:24:58 -0000 1.86 *************** *** 87,92 **** 'smiley': string.join(map(re.escape, wikiutil.smileys.keys()), '|')} ! def __init__(self, raw, **kw): self.raw = raw self.macro = None --- 87,93 ---- 'smiley': string.join(map(re.escape, wikiutil.smileys.keys()), '|')} ! def __init__(self, raw, request, **kw): self.raw = raw + self.request = request self.macro = None *************** *** 236,240 **** buff = cStringIO.StringIO() ! colorizer = python.Parser(open(fpath, 'r').read(), out = buff) colorizer.format(self.formatter, self.form) return self.formatter.preformatted(1) + \ --- 237,241 ---- buff = cStringIO.StringIO() ! colorizer = python.Parser(open(fpath, 'r').read(), self.request, out = buff) colorizer.format(self.formatter, self.form) return self.formatter.preformatted(1) + \ *************** *** 804,808 **** continue ! self.processor(self.formatter, self.colorize_lines) del self.colorize_lines self.in_pre = 0 --- 805,809 ---- continue ! self.processor(self.request, self.formatter, self.colorize_lines) del self.colorize_lines self.in_pre = 0 Index: xslt.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/parser/xslt.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -r1.10 -r1.11 *** xslt.py 1 Dec 2001 20:08:42 -0000 1.10 --- xslt.py 17 Apr 2002 19:24:58 -0000 1.11 *************** *** 24,28 **** """ ! def __init__(self, raw, **kw): self.raw = raw --- 24,28 ---- """ ! def __init__(self, raw, request, **kw): self.raw = raw From jhermann at users.sourceforge.net Wed Apr 17 12:44:41 2002 From: jhermann at users.sourceforge.net (J?rgen Hermann) Date: Wed Apr 17 12:44:41 2002 Subject: [Moin-devel] CVS: MoinMoin/processor CSV.py,1.1,1.2 Colorize.py,1.2,1.3 Message-ID: Update of /cvsroot/moin/MoinMoin/processor In directory usw-pr-cvs1:/tmp/cvs-serv2785/processor Modified Files: CSV.py Colorize.py Log Message: request passing: processors and parsers Index: CSV.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/processor/CSV.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** CSV.py 17 Mar 2002 13:46:17 -0000 1.1 --- CSV.py 17 Apr 2002 19:24:58 -0000 1.2 *************** *** 10,14 **** import string, sys ! def process(formatter, lines): # parse bangpath for arguments exclude = [] --- 10,14 ---- import string, sys ! def process(request, formatter, lines): # parse bangpath for arguments exclude = [] Index: Colorize.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/processor/Colorize.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** Colorize.py 17 Mar 2002 11:03:57 -0000 1.2 --- Colorize.py 17 Apr 2002 19:24:58 -0000 1.3 *************** *** 11,15 **** from MoinMoin.parser import python ! def process(formatter, lines): if not formatter.in_pre: sys.stdout.write(formatter.preformatted(1)) --- 11,15 ---- from MoinMoin.parser import python ! def process(request, formatter, lines): if not formatter.in_pre: sys.stdout.write(formatter.preformatted(1)) *************** *** 22,26 **** buff = cStringIO.StringIO() ! colorizer = python.Parser(string.join(lines, '\n'), out = buff) colorizer.format(formatter, {}) --- 22,26 ---- buff = cStringIO.StringIO() ! colorizer = python.Parser(string.join(lines, '\n'), request, out = buff) colorizer.format(formatter, {}) From jhermann at users.sourceforge.net Wed Apr 17 13:02:14 2002 From: jhermann at users.sourceforge.net (J?rgen Hermann) Date: Wed Apr 17 13:02:14 2002 Subject: [Moin-devel] CVS: MoinMoin Page.py,1.113,1.114 wikiaction.py,1.65,1.66 Message-ID: Update of /cvsroot/moin/MoinMoin In directory usw-pr-cvs1:/tmp/cvs-serv12084/MoinMoin Modified Files: Page.py wikiaction.py Log Message: Passing request to formatters, short docs for macro interface Index: Page.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/Page.py,v retrieving revision 1.113 retrieving revision 1.114 diff -C2 -r1.113 -r1.114 *** Page.py 17 Apr 2002 19:24:57 -0000 1.113 --- Page.py 17 Apr 2002 19:54:35 -0000 1.114 *************** *** 184,188 **** if self.default_formatter: from formatter.text_html import Formatter ! self.formatter = Formatter(store_pagelinks=1) self.formatter.setPage(self) --- 184,188 ---- if self.default_formatter: from formatter.text_html import Formatter ! self.formatter = Formatter(request, store_pagelinks=1) self.formatter.setPage(self) Index: wikiaction.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/wikiaction.py,v retrieving revision 1.65 retrieving revision 1.66 diff -C2 -r1.65 -r1.66 *** wikiaction.py 16 Apr 2002 21:12:06 -0000 1.65 --- wikiaction.py 17 Apr 2002 19:54:35 -0000 1.66 *************** *** 547,551 **** webapi.http_headers(["Content-Type: " + 'text/plain']) ! Page(pagename, formatter = Formatter()).send_page(request.form) sys.exit(0) --- 547,551 ---- webapi.http_headers(["Content-Type: " + 'text/plain']) ! Page(pagename, formatter = Formatter(request)).send_page(request.form) sys.exit(0) From jhermann at users.sourceforge.net Wed Apr 17 13:02:22 2002 From: jhermann at users.sourceforge.net (J?rgen Hermann) Date: Wed Apr 17 13:02:22 2002 Subject: [Moin-devel] CVS: dist README,1.6,1.7 Message-ID: Update of /cvsroot/moin/dist In directory usw-pr-cvs1:/tmp/cvs-serv12084 Modified Files: README Log Message: Passing request to formatters, short docs for macro interface Index: README =================================================================== RCS file: /cvsroot/moin/dist/README,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** README 27 Feb 2002 21:02:53 -0000 1.6 --- README 17 Apr 2002 19:54:35 -0000 1.7 *************** *** 106,110 **** USA ! The PikiPiki homepage is (was) at http://www.linuxcare.com.au/mbp/piki/. --- 106,110 ---- USA ! The PikiPiki homepage is at http://sourcefrog.net/projects/piki/. From jhermann at users.sourceforge.net Wed Apr 17 13:02:28 2002 From: jhermann at users.sourceforge.net (J?rgen Hermann) Date: Wed Apr 17 13:02:28 2002 Subject: [Moin-devel] CVS: MoinMoin/formatter base.py,1.21,1.22 text_html.py,1.39,1.40 text_plain.py,1.17,1.18 text_xml.py,1.26,1.27 Message-ID: Update of /cvsroot/moin/MoinMoin/formatter In directory usw-pr-cvs1:/tmp/cvs-serv12084/MoinMoin/formatter Modified Files: base.py text_html.py text_plain.py text_xml.py Log Message: Passing request to formatters, short docs for macro interface Index: base.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/formatter/base.py,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -r1.21 -r1.22 *** base.py 20 Mar 2002 23:57:07 -0000 1.21 --- base.py 17 Apr 2002 19:54:35 -0000 1.22 *************** *** 26,30 **** hardspace = ' ' ! def __init__(self, **kw): self._store_pagelinks = kw.get('store_pagelinks', 0) self.pagelinks = [] --- 26,32 ---- hardspace = ' ' ! def __init__(self, request, **kw): ! self.request = request ! self._store_pagelinks = kw.get('store_pagelinks', 0) self.pagelinks = [] Index: text_html.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/formatter/text_html.py,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -r1.39 -r1.40 *** text_html.py 20 Mar 2002 23:57:07 -0000 1.39 --- text_html.py 17 Apr 2002 19:54:35 -0000 1.40 *************** *** 10,17 **** # Imports import cgi, string, sys, time ! from base import FormatterBase from MoinMoin import wikiutil, config, user from MoinMoin.Page import Page - from MoinMoin.cgimain import request from MoinMoin.i18n import _ --- 10,16 ---- # Imports import cgi, string, sys, time ! from MoinMoin.formatter.base import FormatterBase from MoinMoin import wikiutil, config, user from MoinMoin.Page import Page from MoinMoin.i18n import _ *************** *** 40,45 **** ! def __init__(self, **kw): ! apply(FormatterBase.__init__, (self,), kw) self._in_li = 0 self._in_code = 0 --- 39,44 ---- ! def __init__(self, request, **kw): ! apply(FormatterBase.__init__, (self, request), kw) self._in_li = 0 self._in_code = 0 *************** *** 147,151 **** if self._show_section_numbers is None: self._show_section_numbers = config.show_section_numbers ! numbering = string.lower(request.getPragma('section-numbers', '')) if numbering in ['0', 'off']: self._show_section_numbers = 0 --- 146,150 ---- if self._show_section_numbers is None: self._show_section_numbers = config.show_section_numbers ! numbering = string.lower(self.request.getPragma('section-numbers', '')) if numbering in ['0', 'off']: self._show_section_numbers = 0 *************** *** 157,165 **** if self._show_section_numbers: # count headings on all levels ! request._fmt_hd_counters = request._fmt_hd_counters[:depth] ! while len(request._fmt_hd_counters) < depth: ! request._fmt_hd_counters.append(0) ! request._fmt_hd_counters[-1] = request._fmt_hd_counters[-1] + 1 ! number = string.join(map(str, request._fmt_hd_counters), ".") + " " return '%s%s%s\n' % ( --- 156,164 ---- if self._show_section_numbers: # count headings on all levels ! self.request._fmt_hd_counters = self.request._fmt_hd_counters[:depth] ! while len(self.request._fmt_hd_counters) < depth: ! self.request._fmt_hd_counters.append(0) ! self.request._fmt_hd_counters[-1] = self.request._fmt_hd_counters[-1] + 1 ! number = string.join(map(str, self.request._fmt_hd_counters), ".") + " " return '%s%s%s\n' % ( Index: text_plain.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/formatter/text_plain.py,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -r1.17 -r1.18 *** text_plain.py 20 Mar 2002 23:57:07 -0000 1.17 --- text_plain.py 17 Apr 2002 19:54:35 -0000 1.18 *************** *** 10,14 **** # Imports import sys ! from base import FormatterBase --- 10,14 ---- # Imports import sys ! from MoinMoin.formatter.base import FormatterBase *************** *** 24,29 **** hardspace = ' ' ! def __init__(self, **kw): ! apply(FormatterBase.__init__, (self,), kw) def startDocument(self, pagename): --- 24,29 ---- hardspace = ' ' ! def __init__(self, request, **kw): ! apply(FormatterBase.__init__, (self, request), kw) def startDocument(self, pagename): Index: text_xml.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/formatter/text_xml.py,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -r1.26 -r1.27 *** text_xml.py 20 Mar 2002 23:57:07 -0000 1.26 --- text_xml.py 17 Apr 2002 19:54:35 -0000 1.27 *************** *** 15,19 **** from xml.sax import saxutils ! from base import FormatterBase from MoinMoin import wikiutil from MoinMoin.Page import Page --- 15,19 ---- from xml.sax import saxutils ! from MoinMoin.formatter.base import FormatterBase from MoinMoin import wikiutil from MoinMoin.Page import Page *************** *** 31,36 **** hardspace = ' ' ! def __init__(self, **kw): ! apply(FormatterBase.__init__, (self,), kw) self._current_depth = 1 self._base_depth = 0 --- 31,36 ---- hardspace = ' ' ! def __init__(self, request, **kw): ! apply(FormatterBase.__init__, (self, request), kw) self._current_depth = 1 self._base_depth = 0 From jhermann at users.sourceforge.net Wed Apr 17 13:02:32 2002 From: jhermann at users.sourceforge.net (J?rgen Hermann) Date: Wed Apr 17 13:02:32 2002 Subject: [Moin-devel] CVS: MoinMoin/macro __init__.py,1.1,1.2 Message-ID: Update of /cvsroot/moin/MoinMoin/macro In directory usw-pr-cvs1:/tmp/cvs-serv12084/MoinMoin/macro Modified Files: __init__.py Log Message: Passing request to formatters, short docs for macro interface Index: __init__.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/macro/__init__.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** __init__.py 25 Nov 2000 16:11:16 -0000 1.1 --- __init__.py 17 Apr 2002 19:54:35 -0000 1.2 *************** *** 5,8 **** --- 5,19 ---- All rights reserved, see COPYING for details. + The canonical interface to macros is their execute() function, + which gets passed an instance of the Macro class. Such an instance + has the four members parser, formatter, form and request. + + Using "form" directly is deprecated and should be replaced + by "request.form". + + Besides the execute() function, macros can export additional + functions to offer services to other macros or actions. A few + actually do that, e.g. AttachFile. + $Id$ """ From jhermann at users.sourceforge.net Wed Apr 17 13:02:35 2002 From: jhermann at users.sourceforge.net (J?rgen Hermann) Date: Wed Apr 17 13:02:35 2002 Subject: [Moin-devel] CVS: MoinMoin/scripts moin_dump.py,1.2,1.3 Message-ID: Update of /cvsroot/moin/MoinMoin/scripts In directory usw-pr-cvs1:/tmp/cvs-serv12084/MoinMoin/scripts Modified Files: moin_dump.py Log Message: Passing request to formatters, short docs for macro interface Index: moin_dump.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/scripts/moin_dump.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** moin_dump.py 15 Jan 2002 18:31:47 -0000 1.2 --- moin_dump.py 17 Apr 2002 19:54:35 -0000 1.3 *************** *** 34,38 **** """ Print usage information. """ ! import os, sys sys.stderr.write(""" %(cmd)s v%(version)s, Copyright (c) 2002 by J?rgen Hermann --- 34,38 ---- """ Print usage information. """ ! import sys sys.stderr.write(""" %(cmd)s v%(version)s, Copyright (c) 2002 by J?rgen Hermann *************** *** 92,96 **** os.mkdir(outputdir) _util.log("Created output directory '%s'!" % outputdir) ! except OSError, e: _util.fatal("Cannot create output directory '%s'!" % outputdir) --- 92,96 ---- os.mkdir(outputdir) _util.log("Created output directory '%s'!" % outputdir) ! except OSError: _util.fatal("Cannot create output directory '%s'!" % outputdir) *************** *** 122,126 **** from MoinMoin import wikiutil, Page - from MoinMoin.formatter import text_html pages = list(wikiutil.getPageList(config.text_dir)) pages.sort() --- 122,125 ---- From jhermann at users.sourceforge.net Wed Apr 17 13:34:10 2002 From: jhermann at users.sourceforge.net (J?rgen Hermann) Date: Wed Apr 17 13:34:10 2002 Subject: [Moin-devel] CVS: MoinMoin Page.py,1.114,1.115 PageEditor.py,1.3,1.4 wikiaction.py,1.66,1.67 Message-ID: Update of /cvsroot/moin/MoinMoin In directory usw-pr-cvs1:/tmp/cvs-serv26622 Modified Files: Page.py PageEditor.py wikiaction.py Log Message: getPageLinks(request) Index: Page.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/Page.py,v retrieving revision 1.114 retrieving revision 1.115 diff -C2 -r1.114 -r1.115 *** Page.py 17 Apr 2002 19:54:35 -0000 1.114 --- Page.py 17 Apr 2002 20:33:33 -0000 1.115 *************** *** 415,419 **** ! def getPageLinks(self): """Get a list of the links on this page""" if not self.exists(): return [] --- 415,419 ---- ! def getPageLinks(self, request): """Get a list of the links on this page""" if not self.exists(): return [] Index: PageEditor.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/PageEditor.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** PageEditor.py 16 Apr 2002 21:12:03 -0000 1.3 --- PageEditor.py 17 Apr 2002 20:33:33 -0000 1.4 *************** *** 201,209 **** ! def deletePage(self): """Delete the page (but keep the backups)""" # First save a final backup copy of the current page # (recreating the page allows access to the backups again) ! self.save_text("deleted", '0') # Then really delete it --- 201,209 ---- ! def deletePage(self, request): """Delete the page (but keep the backups)""" # First save a final backup copy of the current page # (recreating the page allows access to the backups again) ! self.save_text(request, "deleted", '0') # Then really delete it *************** *** 221,230 **** ! def notifySubscribers(self, comment): """ Send email to all subscribers of this page. Return message, indicating success or errors. """ # extract categories of this page ! pageList = self.getPageLinks() CATEGORY_RE = re.compile("^Category") pageList = filter(CATEGORY_RE.match, pageList) --- 221,230 ---- ! def _notifySubscribers(self, request, comment): """ Send email to all subscribers of this page. Return message, indicating success or errors. """ # extract categories of this page ! pageList = self.getPageLinks(request) CATEGORY_RE = re.compile("^Category") pageList = filter(CATEGORY_RE.match, pageList) *************** *** 362,366 **** ! def save_text(self, newtext, datestamp, **kw): """ Save new text for a page. --- 362,366 ---- ! def save_text(self, request, newtext, datestamp, **kw): """ Save new text for a page. *************** *** 425,429 **** # send notification mails if config.mail_smarthost and kw.get('notify', 0): ! msg = msg + "

" + self.notifySubscribers(kw.get('comment', '')) return msg --- 425,429 ---- # send notification mails if config.mail_smarthost and kw.get('notify', 0): ! msg = msg + "

" + self._notifySubscribers(request, kw.get('comment', '')) return msg Index: wikiaction.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/wikiaction.py,v retrieving revision 1.66 retrieving revision 1.67 diff -C2 -r1.66 -r1.67 *** wikiaction.py 17 Apr 2002 19:54:35 -0000 1.66 --- wikiaction.py 17 Apr 2002 20:33:33 -0000 1.67 *************** *** 289,293 **** # show links ! links = page.getPageLinks() if links: print _('This page links to the following pages:
') --- 289,293 ---- # show links ! links = page.getPageLinks(request) if links: print _('This page links to the following pages:
') *************** *** 434,438 **** pg.send_page(request.form, msg=_('Edit was cancelled.')) else: ! savemsg = pg.save_text(savetext, datestamp, stripspaces=rstrip, notify=notify, comment=comment) pg.send_page(request.form, msg=savemsg) --- 434,438 ---- pg.send_page(request.form, msg=_('Edit was cancelled.')) else: ! savemsg = pg.save_text(request, savetext, datestamp, stripspaces=rstrip, notify=notify, comment=comment) pg.send_page(request.form, msg=savemsg) From jhermann at users.sourceforge.net Wed Apr 17 13:34:12 2002 From: jhermann at users.sourceforge.net (J?rgen Hermann) Date: Wed Apr 17 13:34:12 2002 Subject: [Moin-devel] CVS: MoinMoin/action DeletePage.py,1.11,1.12 LocalSiteMap.py,1.4,1.5 SpellCheck.py,1.21,1.22 links.py,1.3,1.4 Message-ID: Update of /cvsroot/moin/MoinMoin/action In directory usw-pr-cvs1:/tmp/cvs-serv26622/action Modified Files: DeletePage.py LocalSiteMap.py SpellCheck.py links.py Log Message: getPageLinks(request) Index: DeletePage.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/action/DeletePage.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -r1.11 -r1.12 *** DeletePage.py 16 Apr 2002 21:03:34 -0000 1.11 --- DeletePage.py 17 Apr 2002 20:33:33 -0000 1.12 *************** *** 48,52 **** # Delete the page ! page.deletePage() # Redirect to RecentChanges --- 48,52 ---- # Delete the page ! page.deletePage(request) # Redirect to RecentChanges Index: LocalSiteMap.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/action/LocalSiteMap.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** LocalSiteMap.py 16 Apr 2002 21:03:34 -0000 1.4 --- LocalSiteMap.py 17 Apr 2002 20:33:33 -0000 1.5 *************** *** 51,55 **** """ ! print LocalSiteMap(pagename).output() wikiutil.send_footer(pagename) --- 51,55 ---- """ ! print LocalSiteMap(pagename).output(request) wikiutil.send_footer(pagename) *************** *** 60,65 **** self.result = [] ! def output(self): ! tree = PageTreeBuilder().build_tree(self.name) #self.append("") tree.depth_first_visit(self) --- 60,65 ---- self.result = [] ! def output(self, request): ! tree = PageTreeBuilder(request).build_tree(self.name) #self.append("") tree.depth_first_visit(self) *************** *** 83,87 **** class PageTreeBuilder: ! def __init__(self): self.children = {} self.numnodes = 0 --- 83,88 ---- class PageTreeBuilder: ! def __init__(self, request): ! self.request = request self.children = {} self.numnodes = 0 *************** *** 104,108 **** # does not recurse kids = [] ! for child in Page(name).getPageLinks(): if self.is_ok(child): kids.append(child) --- 105,109 ---- # does not recurse kids = [] ! for child in Page(name).getPageLinks(self.request): if self.is_ok(child): kids.append(child) Index: SpellCheck.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/action/SpellCheck.py,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -r1.21 -r1.22 *** SpellCheck.py 16 Apr 2002 21:03:34 -0000 1.21 --- SpellCheck.py 17 Apr 2002 20:33:33 -0000 1.22 *************** *** 111,115 **** if words and words[-1] != '\n': words = words + '\n' ! lsw_page.save_text(words + '\n' + newwords, '0') --- 111,115 ---- if words and words[-1] != '\n': words = words + '\n' ! lsw_page.save_text(request, words + '\n' + newwords, '0') Index: links.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/action/links.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** links.py 16 Apr 2002 21:03:34 -0000 1.3 --- links.py 17 Apr 2002 20:33:33 -0000 1.4 *************** *** 39,43 **** else: _emit(name) ! for link in pages[name].getPageLinks(): if mimetype == "text/html": if pages.has_key(link): --- 39,43 ---- else: _emit(name) ! for link in pages[name].getPageLinks(request): if mimetype == "text/html": if pages.has_key(link): From jhermann at users.sourceforge.net Wed Apr 17 13:34:13 2002 From: jhermann at users.sourceforge.net (J?rgen Hermann) Date: Wed Apr 17 13:34:13 2002 Subject: [Moin-devel] CVS: MoinMoin/macro OrphanedPages.py,1.5,1.6 WantedPages.py,1.8,1.9 Message-ID: Update of /cvsroot/moin/MoinMoin/macro In directory usw-pr-cvs1:/tmp/cvs-serv26622/macro Modified Files: OrphanedPages.py WantedPages.py Log Message: getPageLinks(request) Index: OrphanedPages.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/macro/OrphanedPages.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** OrphanedPages.py 20 Mar 2002 23:57:07 -0000 1.5 --- OrphanedPages.py 17 Apr 2002 20:33:33 -0000 1.6 *************** *** 26,30 **** orphaned.update(pages) for page in pages.values(): ! links = page.getPageLinks() for link in links: if orphaned.has_key(link): --- 26,30 ---- orphaned.update(pages) for page in pages.values(): ! links = page.getPageLinks(macro.request) for link in links: if orphaned.has_key(link): Index: WantedPages.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/macro/WantedPages.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** WantedPages.py 27 Mar 2002 22:41:14 -0000 1.8 --- WantedPages.py 17 Apr 2002 20:33:33 -0000 1.9 *************** *** 27,31 **** pages = wikiutil.getPageDict(config.text_dir) for page in pages.values(): ! links = page.getPageLinks() for link in links: if not pages.has_key(link): --- 27,31 ---- pages = wikiutil.getPageDict(config.text_dir) for page in pages.values(): ! links = page.getPageLinks(macro.request) for link in links: if not pages.has_key(link): From noreply at sourceforge.net Wed Apr 17 13:52:05 2002 From: noreply at sourceforge.net (noreply at sourceforge.net) Date: Wed Apr 17 13:52:05 2002 Subject: [Moin-devel] [ moin-Bugs-545364 ] TypeError: not enough arguments Message-ID: Bugs item #545364, was opened at 2002-04-17 13:51 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=108482&aid=545364&group_id=8482 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: TypeError: not enough arguments Initial Comment: Full Error Message: TypeError: not enough arguments; expected 2, got 1 Page That Has this error message: http://twistedmatrix.com/users/jh.twistd/moin/moin.cgi/ MoinMoin_2fInstallDocs I checked out this page earlier today and it worked fine. I didn't make any modifications to the page. Thanks ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=108482&aid=545364&group_id=8482 From jhermann at users.sourceforge.net Wed Apr 17 14:05:39 2002 From: jhermann at users.sourceforge.net (J?rgen Hermann) Date: Wed Apr 17 14:05:39 2002 Subject: [Moin-devel] CVS: MoinMoin/action AttachFile.py,1.31,1.32 DeletePage.py,1.12,1.13 LikePages.py,1.11,1.12 SpellCheck.py,1.22,1.23 Message-ID: Update of /cvsroot/moin/MoinMoin/action In directory usw-pr-cvs1:/tmp/cvs-serv6126/action Modified Files: AttachFile.py DeletePage.py LikePages.py SpellCheck.py Log Message: Page no longer imports request from cgimain Index: AttachFile.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/action/AttachFile.py,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -r1.31 -r1.32 *** AttachFile.py 16 Apr 2002 21:03:34 -0000 1.31 --- AttachFile.py 17 Apr 2002 21:04:46 -0000 1.32 *************** *** 76,80 **** ! def info(pagename, form): """ Generate snippet with info on the attachment for page `pagename`. """ --- 76,80 ---- ! def info(pagename, request): """ Generate snippet with info on the attachment for page `pagename`. """ *************** *** 106,110 **** ! def _access_file(pagename, form): """ Check form parameter `target` and return a tuple of `(filename, filepath)` for an existing attachment. --- 106,110 ---- ! def _access_file(pagename, request): """ Check form parameter `target` and return a tuple of `(filename, filepath)` for an existing attachment. *************** *** 113,120 **** """ error = None ! if not form.getvalue('target', ''): error = _("Filename of attachment not specified!") else: ! filename = wikiutil.taintfilename(form['target'].value) fpath = os.path.join(getAttachDir(pagename), filename) --- 113,120 ---- """ error = None ! if not request.form.getvalue('target', ''): error = _("Filename of attachment not specified!") else: ! filename = wikiutil.taintfilename(request.form['target'].value) fpath = os.path.join(getAttachDir(pagename), filename) *************** *** 123,127 **** error = _("Attachment '%(filename)s' does not exist!") % locals() ! error_msg(pagename, form, error) return (None, None) --- 123,127 ---- error = _("Attachment '%(filename)s' does not exist!") % locals() ! error_msg(pagename, request, error) return (None, None) *************** *** 179,184 **** ! def error_msg(pagename, form, msg): ! Page(pagename).send_page(form, msg=msg) --- 179,184 ---- ! def error_msg(pagename, request, msg): ! Page(pagename).send_page(request, msg=msg) *************** *** 187,195 **** ############################################################################# ! def send_hotdraw(pagename, form): now = time.time() pubpath = config.url_prefix + "/applets/TWikiDrawPlugin" ! drawpath = getAttachUrl(pagename, form['drawing'].value + '.draw') ! gifpath = getAttachUrl(pagename, form['drawing'].value + '.gif') pagelink = wikiutil.quoteWikiname(pagename) + "?action=AttachFile&ts=%s" % now savelink = Page(pagename).url() --- 187,195 ---- ############################################################################# ! def send_hotdraw(pagename, request): now = time.time() pubpath = config.url_prefix + "/applets/TWikiDrawPlugin" ! drawpath = getAttachUrl(pagename, request.form['drawing'].value + '.draw') ! gifpath = getAttachUrl(pagename, request.form['drawing'].value + '.gif') pagelink = wikiutil.quoteWikiname(pagename) + "?action=AttachFile&ts=%s" % now savelink = Page(pagename).url() *************** *** 217,221 **** ! def send_uploadform(pagename, form): """ Send the HTML code for the list of already stored attachments and the file upload form. --- 217,221 ---- ! def send_uploadform(pagename, request): """ Send the HTML code for the list of already stored attachments and the file upload form. *************** *** 228,233 **** return ! if form.getvalue('drawing', None): ! send_hotdraw(pagename, form) return --- 228,233 ---- return ! if request.form.getvalue('drawing', None): ! send_hotdraw(pagename, request) return *************** *** 259,263 **** 'upload_label_mime': _('MIME Type (optional)'), 'upload_label_rename': _('Rename to (optional)'), ! 'rename': form.getvalue('rename', ''), 'upload_button': _(' Upload '), } --- 259,263 ---- 'upload_label_mime': _('MIME Type (optional)'), 'upload_label_rename': _('Rename to (optional)'), ! 'rename': request.form.getvalue('rename', ''), 'upload_button': _(' Upload '), } *************** *** 271,318 **** """ Main dispatcher for the 'AttachFile' action. """ - form = request.form - msg = None if action_name in config.excluded_actions: msg = _('File attachments are not allowed in this wiki!') ! elif form.has_key('filepath'): ! save_drawing(pagename, form) webapi.http_headers() print "OK" ! elif not form.has_key('do'): ! upload_form(pagename, form) ! elif form['do'].value == 'upload': if user.current.may.edit: ! do_upload(pagename, form) else: msg = _('You are not allowed to upload files.') ! elif form['do'].value == 'del': if user.current.may.delete: ! del_file(pagename, form) else: msg = _('You are not allowed to delete attachments.') ! elif form['do'].value == 'get': ! get_file(pagename, form) ! elif form['do'].value == 'view': ! view_file(pagename, form) else: ! msg = _('Unsupported upload action: %s') % (form['do'].value,) if msg: ! error_msg(pagename, form, msg) ! def upload_form(pagename, form, msg=''): webapi.http_headers() wikiutil.send_title(_('Attachments for "%(pagename)s"') % locals(), pagename=pagename, msg=msg) ! send_uploadform(pagename, form) wikiutil.send_footer(pagename, showpage=1) ! def do_upload(pagename, form): # check file & mimetype ! fileitem = form['file'] if not fileitem.file: ! error_msg(pagename, form, _("Filename of attachment not specified!")) return --- 271,316 ---- """ Main dispatcher for the 'AttachFile' action. """ msg = None if action_name in config.excluded_actions: msg = _('File attachments are not allowed in this wiki!') ! elif request.form.has_key('filepath'): ! save_drawing(pagename, request) webapi.http_headers() print "OK" ! elif not request.form.has_key('do'): ! upload_form(pagename, request) ! elif request.form['do'].value == 'upload': if user.current.may.edit: ! do_upload(pagename, request) else: msg = _('You are not allowed to upload files.') ! elif request.form['do'].value == 'del': if user.current.may.delete: ! del_file(pagename, request) else: msg = _('You are not allowed to delete attachments.') ! elif request.form['do'].value == 'get': ! get_file(pagename, request) ! elif request.form['do'].value == 'view': ! view_file(pagename, request) else: ! msg = _('Unsupported upload action: %s') % (request.form['do'].value,) if msg: ! error_msg(pagename, request, msg) ! def upload_form(pagename, request, msg=''): webapi.http_headers() wikiutil.send_title(_('Attachments for "%(pagename)s"') % locals(), pagename=pagename, msg=msg) ! send_uploadform(pagename, request) wikiutil.send_footer(pagename, showpage=1) ! def do_upload(pagename, request): # check file & mimetype ! fileitem = request.form['file'] if not fileitem.file: ! error_msg(pagename, request, _("Filename of attachment not specified!")) return *************** *** 326,331 **** filename = fileitem.filename rename = '' ! if form.has_key('rename'): ! rename = string.strip(form['rename'].value) target = filename --- 324,329 ---- filename = fileitem.filename rename = '' ! if request.form.has_key('rename'): ! rename = string.strip(request.form['rename'].value) target = filename *************** *** 342,347 **** if not type: ext = None ! if form.has_key('mime'): ! ext = mimetypes.guess_extension(form['mime'].value) if not ext: type, encoding = mimetypes.guess_type(filename) --- 340,345 ---- if not type: ext = None ! if request.form.has_key('mime'): ! ext = mimetypes.guess_extension(request.form['mime'].value) if not ext: type, encoding = mimetypes.guess_type(filename) *************** *** 371,380 **** # return attachment list ! upload_form(pagename, form, msg) ! def save_drawing(pagename, form): ! filename = form['filepath'].filename ! content = form['filepath'].value if htdocs_access: --- 369,378 ---- # return attachment list ! upload_form(pagename, request, msg) ! def save_drawing(pagename, request): ! filename = request.form['filepath'].filename ! content = request.form['filepath'].value if htdocs_access: *************** *** 413,418 **** ! def del_file(pagename, form): ! filename, fpath = _access_file(pagename, form) if not filename: return # error msg already sent in _access_file --- 411,416 ---- ! def del_file(pagename, request): ! filename, fpath = _access_file(pagename, request) if not filename: return # error msg already sent in _access_file *************** *** 421,431 **** _addLogEntry('ATTDEL', pagename, filename) ! upload_form(pagename, form, msg=_("Attachment '%(filename)s' deleted.") % locals()) ! def get_file(pagename, form): import shutil ! filename, fpath = _access_file(pagename, form) if not filename: return # error msg already sent in _access_file --- 419,429 ---- _addLogEntry('ATTDEL', pagename, filename) ! upload_form(pagename, request, msg=_("Attachment '%(filename)s' deleted.") % locals()) ! def get_file(pagename, request): import shutil ! filename, fpath = _access_file(pagename, request) if not filename: return # error msg already sent in _access_file *************** *** 448,453 **** ! def send_viewfile(pagename, form): ! filename, fpath = _access_file(pagename, form) if not filename: return --- 446,451 ---- ! def send_viewfile(pagename, request): ! filename, fpath = _access_file(pagename, request) if not filename: return *************** *** 472,477 **** ! def view_file(pagename, form): ! filename, fpath = _access_file(pagename, form) if not filename: return --- 470,475 ---- ! def view_file(pagename, request): ! filename, fpath = _access_file(pagename, request) if not filename: return *************** *** 482,487 **** # send body ! send_viewfile(pagename, form) ! send_uploadform(pagename, form) # send footer --- 480,485 ---- # send body ! send_viewfile(pagename, request) ! send_uploadform(pagename, request) # send footer Index: DeletePage.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/action/DeletePage.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -r1.12 -r1.13 *** DeletePage.py 17 Apr 2002 20:33:33 -0000 1.12 --- DeletePage.py 17 Apr 2002 21:04:46 -0000 1.13 *************** *** 19,24 **** def execute(pagename, request): - form = request.form - actname = string.split(__name__, '.')[-1] page = PageEditor(pagename) --- 19,22 ---- *************** *** 27,31 **** if actname in config.excluded_actions or not user.current.may.edit \ or not user.current.may.delete: ! return page.send_page(form, msg='%s' % _('You are not allowed to delete pages in this wiki!')) --- 25,29 ---- if actname in config.excluded_actions or not user.current.may.edit \ or not user.current.may.delete: ! return page.send_page(request, msg='%s' % _('You are not allowed to delete pages in this wiki!')) *************** *** 34,47 **** # check whether page exists at all if not page.exists(): ! return page.send_page(form, msg='%s' % _('This page is already deleted or was never created!')) # check whether the user clicked the delete button ! if form.has_key('button') and form.has_key('ticket'): # check whether this is a valid deletion request (make outside # attacks harder by requiring two full HTTP transactions) ! if not _checkTicket(form['ticket'].value): ! return page.send_page(form, msg='%s' % _('Please use the interactive user interface to delete pages!')) --- 32,45 ---- # check whether page exists at all if not page.exists(): ! return page.send_page(request, msg='%s' % _('This page is already deleted or was never created!')) # check whether the user clicked the delete button ! if request.form.has_key('button') and request.form.has_key('ticket'): # check whether this is a valid deletion request (make outside # attacks harder by requiring two full HTTP transactions) ! if not _checkTicket(request.form['ticket'].value): ! return page.send_page(request, msg='%s' % _('Please use the interactive user interface to delete pages!')) *************** *** 51,55 **** # Redirect to RecentChanges ! return wikiutil.getSysPage('RecentChanges').send_page(form, msg='%s' % (_('Page "%s" was sucessfully deleted!') % (pagename,))) --- 49,53 ---- # Redirect to RecentChanges ! return wikiutil.getSysPage('RecentChanges').send_page(request, msg='%s' % (_('Page "%s" was sucessfully deleted!') % (pagename,))) *************** *** 68,72 **** """ % locals() ! return page.send_page(form, msg=formhtml) --- 66,70 ---- """ % locals() ! return page.send_page(request, msg=formhtml) Index: LikePages.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/action/LikePages.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -r1.11 -r1.12 *** LikePages.py 16 Apr 2002 21:03:34 -0000 1.11 --- LikePages.py 17 Apr 2002 21:04:46 -0000 1.12 *************** *** 23,33 **** e_re=re.compile('([%s][%s]+)$' % (config.upperletters, config.lowerletters))): - form = request.form - # figure the start and end words s_match = s_re.match(pagename) e_match = e_re.search(pagename) if not (s_match and e_match): ! Page(pagename).send_page(form, msg=_('You cannot use LikePages on an extended pagename!')) return --- 23,31 ---- e_re=re.compile('([%s][%s]+)$' % (config.upperletters, config.lowerletters))): # figure the start and end words s_match = s_re.match(pagename) e_match = e_re.search(pagename) if not (s_match and e_match): ! Page(pagename).send_page(request, msg=_('You cannot use LikePages on an extended pagename!')) return *************** *** 58,62 **** # no matches :( if not matches: ! Page(pagename).send_page(form, msg='' + _('No pages match "%s"!') % (pagename,) + '') return --- 56,60 ---- # no matches :( if not matches: ! Page(pagename).send_page(request, msg='' + _('No pages match "%s"!') % (pagename,) + '') return *************** *** 64,68 **** # one match - display it if len(matches) == 1: ! Page(matches.keys()[0]).send_page(form, msg='' + _('Exactly one matching page for "%s" found!') % (pagename,) + '') return --- 62,66 ---- # one match - display it if len(matches) == 1: ! Page(matches.keys()[0]).send_page(request, msg='' + _('Exactly one matching page for "%s" found!') % (pagename,) + '') return Index: SpellCheck.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/action/SpellCheck.py,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -r1.22 -r1.23 *** SpellCheck.py 17 Apr 2002 20:33:33 -0000 1.22 --- SpellCheck.py 17 Apr 2002 21:04:46 -0000 1.23 *************** *** 207,212 **** if badwords: ! page.send_page(request.form, msg=msg, hilite_re=badwords_re) else: ! page.send_page(request.form, msg=msg) --- 207,212 ---- if badwords: ! page.send_page(request, msg=msg, hilite_re=badwords_re) else: ! page.send_page(request, msg=msg) From jhermann at users.sourceforge.net Wed Apr 17 14:05:41 2002 From: jhermann at users.sourceforge.net (J?rgen Hermann) Date: Wed Apr 17 14:05:41 2002 Subject: [Moin-devel] CVS: MoinMoin Page.py,1.115,1.116 PageEditor.py,1.4,1.5 cgimain.py,1.50,1.51 userform.py,1.14,1.15 wikiaction.py,1.67,1.68 wikiform.py,1.4,1.5 Message-ID: Update of /cvsroot/moin/MoinMoin In directory usw-pr-cvs1:/tmp/cvs-serv6126 Modified Files: Page.py PageEditor.py cgimain.py userform.py wikiaction.py wikiform.py Log Message: Page no longer imports request from cgimain Index: Page.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/Page.py,v retrieving revision 1.115 retrieving revision 1.116 diff -C2 -r1.115 -r1.116 *** Page.py 17 Apr 2002 20:33:33 -0000 1.115 --- Page.py 17 Apr 2002 21:04:45 -0000 1.116 *************** *** 11,15 **** import cStringIO, os, re, sys, string, urllib from MoinMoin import caching, config, eventlog, user, util, wikiutil, webapi - from MoinMoin.cgimain import request from MoinMoin.i18n import _ --- 11,14 ---- *************** *** 156,160 **** ! def send_page(self, form, msg=None, **keywords): """ Send the formatted page to stdout. --- 155,159 ---- ! def send_page(self, request, msg=None, **keywords): """ Send the formatted page to stdout. *************** *** 167,170 **** --- 166,170 ---- request.clock.start('send_page') import cgi + form = request.form # determine modes Index: PageEditor.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/PageEditor.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** PageEditor.py 17 Apr 2002 20:33:33 -0000 1.4 --- PageEditor.py 17 Apr 2002 21:04:45 -0000 1.5 *************** *** 49,53 **** # check edit permissions if not user.current.may.edit: ! self.send_page(form, msg=_("""You are not allowed to edit any pages.""")) return --- 49,53 ---- # check edit permissions if not user.current.may.edit: ! self.send_page(request, msg=_("""You are not allowed to edit any pages.""")) return *************** *** 180,184 **** ' style="background-image:url(%s/img/draft.png); background-color:#F4F4F4;">' '

' + _('Size') + '' + _('Editor') + '' + _('Comment') + '%s
') % (config.url_prefix,) ! self.send_page(form, content_only=1, hilite_re=badwords_re) print '
' --- 180,184 ---- ' style="background-image:url(%s/img/draft.png); background-color:#F4F4F4;">' '') % (config.url_prefix,) ! self.send_page(request, content_only=1, hilite_re=badwords_re) print '' Index: cgimain.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/cgimain.py,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -r1.50 -r1.51 *** cgimain.py 16 Apr 2002 21:03:33 -0000 1.50 --- cgimain.py 17 Apr 2002 21:04:45 -0000 1.51 *************** *** 20,23 **** --- 20,24 ---- global request request = Request(properties) + return request *************** *** 163,167 **** # looks like user wants to save a drawing from MoinMoin.action.AttachFile import execute ! execute(pagename, request.form) sys.exit(0) if action: --- 164,168 ---- # looks like user wants to save a drawing from MoinMoin.action.AttachFile import execute ! execute(pagename, request) sys.exit(0) if action: Index: userform.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/userform.py,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -r1.14 -r1.15 *** userform.py 15 Mar 2002 22:01:26 -0000 1.14 --- userform.py 17 Apr 2002 21:04:46 -0000 1.15 *************** *** 32,40 **** } ! def savedata(pagename, form): """ Handle POST request of the user preferences form Return error msg or None """ if form.has_key('logout'): # clear the cookie in the browser and locally --- 32,42 ---- } ! def savedata(pagename, request): """ Handle POST request of the user preferences form Return error msg or None """ + form = request.form + if form.has_key('logout'): # clear the cookie in the browser and locally Index: wikiaction.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/wikiaction.py,v retrieving revision 1.67 retrieving revision 1.68 diff -C2 -r1.67 -r1.68 *** wikiaction.py 17 Apr 2002 20:33:33 -0000 1.67 --- wikiaction.py 17 Apr 2002 21:04:46 -0000 1.68 *************** *** 144,148 **** needle_re = re.compile(needle, re.IGNORECASE) ! Page(pagename).send_page(request.form, hilite_re=needle_re) --- 144,148 ---- needle_re = re.compile(needle, re.IGNORECASE) ! Page(pagename).send_page(request, hilite_re=needle_re) *************** *** 174,178 **** oldversions = wikiutil.getBackupList(config.backup_dir, pagename) if not oldversions: ! Page(pagename).send_page(request.form, msg=_("No older revisions available!")) return --- 174,178 ---- oldversions = wikiutil.getBackupList(config.backup_dir, pagename) if not oldversions: ! Page(pagename).send_page(request, msg=_("No older revisions available!")) return *************** *** 202,206 **** 'count': edit_count, 'times': (_(' time'), _(' times'))[edit_count != 1]} ! Page(pagename).send_page(request.form, msg=msg) return --- 202,206 ---- 'count': edit_count, 'times': (_(' time'), _(' times'))[edit_count != 1]} ! Page(pagename).send_page(request, msg=msg) return *************** *** 364,372 **** def do_recall(pagename, request): ! Page(pagename, date=request.form['date'].value).send_page(request.form) def do_show(pagename, request): ! Page(pagename).send_page(request.form, count_hit=1) --- 364,372 ---- def do_recall(pagename, request): ! Page(pagename, date=request.form['date'].value).send_page(request) def do_show(pagename, request): ! Page(pagename).send_page(request, count_hit=1) *************** *** 388,392 **** page = Page(pagename) print '' % webapi.getQualifiedURL(page.url()) ! page.send_page(request.form, count_hit=0, content_only=1) sys.exit(0) --- 388,392 ---- page = Page(pagename) print '' % webapi.getQualifiedURL(page.url()) ! page.send_page(request, count_hit=0, content_only=1) sys.exit(0) *************** *** 432,440 **** pg.send_editor(request, preview=1, comment=comment) elif request.form.has_key('button_cancel'): ! pg.send_page(request.form, msg=_('Edit was cancelled.')) else: savemsg = pg.save_text(request, savetext, datestamp, stripspaces=rstrip, notify=notify, comment=comment) ! pg.send_page(request.form, msg=savemsg) --- 432,440 ---- pg.send_editor(request, preview=1, comment=comment) elif request.form.has_key('button_cancel'): ! pg.send_page(request, msg=_('Edit was cancelled.')) else: savemsg = pg.save_text(request, savetext, datestamp, stripspaces=rstrip, notify=notify, comment=comment) ! pg.send_page(request, msg=savemsg) *************** *** 484,494 **** ''') ! Page(pagename).send_page(request.form, msg=msg) def do_userform(pagename, request): from MoinMoin import userform ! savemsg=userform.savedata(pagename, request.form) ! Page(pagename).send_page(request.form, msg=savemsg) --- 484,494 ---- ''') ! Page(pagename).send_page(request, msg=msg) def do_userform(pagename, request): from MoinMoin import userform ! savemsg = userform.savedata(pagename, request) ! Page(pagename).send_page(request, msg=savemsg) *************** *** 503,507 **** user.current.setBookmark(tm) ! Page(pagename).send_page(request.form) --- 503,507 ---- user.current.setBookmark(tm) ! Page(pagename).send_page(request) *************** *** 547,551 **** webapi.http_headers(["Content-Type: " + 'text/plain']) ! Page(pagename, formatter = Formatter(request)).send_page(request.form) sys.exit(0) --- 547,551 ---- webapi.http_headers(["Content-Type: " + 'text/plain']) ! Page(pagename, formatter = Formatter(request)).send_page(request) sys.exit(0) Index: wikiform.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/wikiform.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** wikiform.py 13 Feb 2002 21:13:52 -0000 1.4 --- wikiform.py 17 Apr 2002 21:04:46 -0000 1.5 *************** *** 86,90 **** ! def do_formtest(pagename, form): """ Test a user defined form. """ --- 86,90 ---- ! def do_formtest(pagename, request): """ Test a user defined form. """ *************** *** 96,99 **** msg = msg + '\n' ! Page(pagename).send_page(form, msg=msg) --- 96,99 ---- msg = msg + '\n' ! Page(pagename).send_page(request, msg=msg) From jhermann at users.sourceforge.net Wed Apr 17 14:05:47 2002 From: jhermann at users.sourceforge.net (J?rgen Hermann) Date: Wed Apr 17 14:05:47 2002 Subject: [Moin-devel] CVS: MoinMoin/scripts moin_dump.py,1.3,1.4 Message-ID: Update of /cvsroot/moin/MoinMoin/scripts In directory usw-pr-cvs1:/tmp/cvs-serv6126/scripts Modified Files: moin_dump.py Log Message: Page no longer imports request from cgimain Index: moin_dump.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/scripts/moin_dump.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** moin_dump.py 17 Apr 2002 19:54:35 -0000 1.3 --- moin_dump.py 17 Apr 2002 21:04:46 -0000 1.4 *************** *** 116,123 **** # from MoinMoin import cgimain ! cgimain.createRequest() import cgi ! form = cgi.FieldStorage(environ = {'QUERY_STRING': 'action=print'}) from MoinMoin import wikiutil, Page --- 116,123 ---- # from MoinMoin import cgimain ! request = cgimain.createRequest() import cgi ! request.form = cgi.FieldStorage(environ = {'QUERY_STRING': 'action=print'}) from MoinMoin import wikiutil, Page *************** *** 142,146 **** sys.stdout = out try: ! page.send_page(form) except: errcnt += 1 --- 142,146 ---- sys.stdout = out try: ! page.send_page(request) except: errcnt += 1 From jhermann at users.sourceforge.net Wed Apr 17 14:05:53 2002 From: jhermann at users.sourceforge.net (J?rgen Hermann) Date: Wed Apr 17 14:05:53 2002 Subject: [Moin-devel] CVS: MoinMoin/macro Include.py,1.6,1.7 Message-ID: Update of /cvsroot/moin/MoinMoin/macro In directory usw-pr-cvs1:/tmp/cvs-serv6126/macro Modified Files: Include.py Log Message: Page no longer imports request from cgimain Index: Include.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/macro/Include.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** Include.py 13 Feb 2002 21:13:53 -0000 1.6 --- Include.py 17 Apr 2002 21:04:46 -0000 1.7 *************** *** 72,76 **** stdout = sys.stdout sys.stdout = cStringIO.StringIO() ! inc_page.send_page(macro.form, content_only=1) ret = ret + sys.stdout.getvalue() sys.stdout = stdout --- 72,76 ---- stdout = sys.stdout sys.stdout = cStringIO.StringIO() ! inc_page.send_page(macro.request, content_only=1) ret = ret + sys.stdout.getvalue() sys.stdout = stdout From jhermann at users.sourceforge.net Wed Apr 17 15:02:19 2002 From: jhermann at users.sourceforge.net (J?rgen Hermann) Date: Wed Apr 17 15:02:19 2002 Subject: [Moin-devel] CVS: MoinMoin/macro RecentChanges.py,1.55,1.56 Message-ID: Update of /cvsroot/moin/MoinMoin/macro In directory usw-pr-cvs1:/tmp/cvs-serv23792/macro Modified Files: RecentChanges.py Log Message: Removed remaining dependencies on cgimain.request Index: RecentChanges.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/macro/RecentChanges.py,v retrieving revision 1.55 retrieving revision 1.56 diff -C2 -r1.55 -r1.56 *** RecentChanges.py 27 Mar 2002 22:41:14 -0000 1.55 --- RecentChanges.py 17 Apr 2002 21:58:17 -0000 1.56 *************** *** 429,433 **** # send the generated XML document ! webapi.http_headers(["Content-Type: " + 'text/xml'] + webapi.nocache) sys.stdout.write(out.getvalue()) --- 429,433 ---- # send the generated XML document ! webapi.http_headers(request, ["Content-Type: " + 'text/xml'] + webapi.nocache) sys.stdout.write(out.getvalue()) From jhermann at users.sourceforge.net Wed Apr 17 15:02:20 2002 From: jhermann at users.sourceforge.net (J?rgen Hermann) Date: Wed Apr 17 15:02:20 2002 Subject: [Moin-devel] CVS: MoinMoin/webapi cgiMoin.py,1.12,1.13 cliMoin.py,1.1,1.2 twistedMoin.py,1.1,1.2 Message-ID: Update of /cvsroot/moin/MoinMoin/webapi In directory usw-pr-cvs1:/tmp/cvs-serv23792/webapi Modified Files: cgiMoin.py cliMoin.py twistedMoin.py Log Message: Removed remaining dependencies on cgimain.request Index: cgiMoin.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/webapi/cgiMoin.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -r1.12 -r1.13 *** cgiMoin.py 8 Apr 2002 18:47:41 -0000 1.12 --- cgiMoin.py 17 Apr 2002 21:58:17 -0000 1.13 *************** *** 76,87 **** ############################################################################# ! def setHttpHeader(header): ! from MoinMoin.cgimain import request request.user_headers.append(header) ! def http_headers(more_headers=[]): from MoinMoin import config - from MoinMoin.cgimain import request if request.sent_headers: --- 76,85 ---- ############################################################################# ! def setHttpHeader(request, header): request.user_headers.append(header) ! def http_headers(request, more_headers=[]): from MoinMoin import config if request.sent_headers: *************** *** 113,122 **** ! def http_redirect(url): """ Redirect to a fully qualified, or server-rooted URL """ if string.count(url, "://") == 0: url = getQualifiedURL(url) ! http_headers([ "Status: 302", "Location: " + url, --- 111,120 ---- ! def http_redirect(request, url): """ Redirect to a fully qualified, or server-rooted URL """ if string.count(url, "://") == 0: url = getQualifiedURL(url) ! http_headers(request, [ "Status: 302", "Location: " + url, Index: cliMoin.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/webapi/cliMoin.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** cliMoin.py 3 Jan 2002 12:51:21 -0000 1.1 --- cliMoin.py 17 Apr 2002 21:58:17 -0000 1.2 *************** *** 49,59 **** ############################################################################# ! def setHttpHeader(header): pass ! def http_headers(more_headers=[]): pass ! def http_redirect(url): """ Redirect to a fully qualified, or server-rooted URL """ raise Exception("Redirect not supported for command line tools!") --- 49,59 ---- ############################################################################# ! def setHttpHeader(request, header): pass ! def http_headers(request, more_headers=[]): pass ! def http_redirect(request, url): """ Redirect to a fully qualified, or server-rooted URL """ raise Exception("Redirect not supported for command line tools!") Index: twistedMoin.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/webapi/twistedMoin.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** twistedMoin.py 23 Oct 2001 22:04:49 -0000 1.1 --- twistedMoin.py 17 Apr 2002 21:58:17 -0000 1.2 *************** *** 28,31 **** --- 28,32 ---- def getScriptname(): """ Return the scriptname part of the URL ("/path/to/my.cgi"). """ + # !!! cgimain.request is not anymore! return "/" + string.join(cgimain.request.twistd.prepath, '/') *************** *** 33,36 **** --- 34,38 ---- def getPathinfo(): """ Return the remaining part of the URL. """ + # !!! cgimain.request is not anymore! pathinfo = cgimain.request.twistd.postpath if pathinfo: *************** *** 44,47 **** --- 46,50 ---- *uri* -- append this server-rooted uri (must start with a slash) """ + # !!! cgimain.request is not anymore! result = 'http://' + (cgimain.request.twistd.getHeader('host') or cgimain.request.twistd.getHost()) *************** *** 75,88 **** ############################################################################# ! def setHttpHeader(header): key, value = string.split(header, ':') value = string.lstrip(value) ! cgimain.request.twistd.setHeader("content-type", self.type) ! def http_headers(more_headers=[]): for header in more_headers: ! setHttpHeader(header) ! def http_redirect(url): """ Redirect to a fully qualified, or server-rooted URL """ if string.count(url, "://") == 0: --- 78,91 ---- ############################################################################# ! def setHttpHeader(request, header): key, value = string.split(header, ':') value = string.lstrip(value) ! request.twistd.setHeader("content-type", self.type) ! def http_headers(request, more_headers=[]): for header in more_headers: ! setHttpHeader(request, header) ! def http_redirect(request, url): """ Redirect to a fully qualified, or server-rooted URL """ if string.count(url, "://") == 0: *************** *** 92,96 **** url) ! http_headers(["Location: " + url]) --- 95,99 ---- url) ! http_headers(request, ["Location: " + url]) From jhermann at users.sourceforge.net Wed Apr 17 15:02:21 2002 From: jhermann at users.sourceforge.net (J?rgen Hermann) Date: Wed Apr 17 15:02:21 2002 Subject: [Moin-devel] CVS: MoinMoin/action AttachFile.py,1.32,1.33 LikePages.py,1.12,1.13 LocalSiteMap.py,1.5,1.6 links.py,1.4,1.5 titleindex.py,1.4,1.5 Message-ID: Update of /cvsroot/moin/MoinMoin/action In directory usw-pr-cvs1:/tmp/cvs-serv23792/action Modified Files: AttachFile.py LikePages.py LocalSiteMap.py links.py titleindex.py Log Message: Removed remaining dependencies on cgimain.request Index: AttachFile.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/action/AttachFile.py,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -r1.32 -r1.33 *** AttachFile.py 17 Apr 2002 21:04:46 -0000 1.32 --- AttachFile.py 17 Apr 2002 21:58:17 -0000 1.33 *************** *** 276,280 **** elif request.form.has_key('filepath'): save_drawing(pagename, request) ! webapi.http_headers() print "OK" elif not request.form.has_key('do'): --- 276,280 ---- elif request.form.has_key('filepath'): save_drawing(pagename, request) ! webapi.http_headers(request) print "OK" elif not request.form.has_key('do'): *************** *** 302,306 **** def upload_form(pagename, request, msg=''): ! webapi.http_headers() wikiutil.send_title(_('Attachments for "%(pagename)s"') % locals(), pagename=pagename, msg=msg) send_uploadform(pagename, request) --- 302,306 ---- def upload_form(pagename, request, msg=''): ! webapi.http_headers(request) wikiutil.send_title(_('Attachments for "%(pagename)s"') % locals(), pagename=pagename, msg=msg) send_uploadform(pagename, request) *************** *** 434,438 **** # send header ! webapi.http_headers([ "Content-Type: %s" % type, "Content-Length: %d" % os.path.getsize(fpath), --- 434,438 ---- # send header ! webapi.http_headers(request, [ "Content-Type: %s" % type, "Content-Length: %d" % os.path.getsize(fpath), *************** *** 475,479 **** # send header & title ! webapi.http_headers() wikiutil.send_title(_('attachment:%(filename)s of %(pagename)s') % locals(), pagename=pagename) --- 475,479 ---- # send header & title ! webapi.http_headers(request) wikiutil.send_title(_('attachment:%(filename)s of %(pagename)s') % locals(), pagename=pagename) Index: LikePages.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/action/LikePages.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -r1.12 -r1.13 *** LikePages.py 17 Apr 2002 21:04:46 -0000 1.12 --- LikePages.py 17 Apr 2002 21:58:17 -0000 1.13 *************** *** 67,71 **** # more than one match, list 'em ! webapi.http_headers() wikiutil.send_title(_('Multiple matches for "%s...%s"') % (start, end), pagename=pagename) --- 67,71 ---- # more than one match, list 'em ! webapi.http_headers(request) wikiutil.send_title(_('Multiple matches for "%s...%s"') % (start, end), pagename=pagename) Index: LocalSiteMap.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/action/LocalSiteMap.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** LocalSiteMap.py 17 Apr 2002 20:33:33 -0000 1.5 --- LocalSiteMap.py 17 Apr 2002 21:58:17 -0000 1.6 *************** *** 37,43 **** def execute(pagename, request): ! form = request.form ! ! webapi.http_headers() wikiutil.send_title(_('Local Site Map for "%s"') % (pagename), pagename=pagename) --- 37,41 ---- def execute(pagename, request): ! webapi.http_headers(request) wikiutil.send_title(_('Local Site Map for "%s"') % (pagename), pagename=pagename) Index: links.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/action/links.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** links.py 17 Apr 2002 20:33:33 -0000 1.4 --- links.py 17 Apr 2002 21:58:17 -0000 1.5 *************** *** 24,28 **** mimetype = "text/html" ! webapi.http_headers(["Content-Type: " + mimetype]) if mimetype == "text/html": --- 24,28 ---- mimetype = "text/html" ! webapi.http_headers(request, ["Content-Type: " + mimetype]) if mimetype == "text/html": Index: titleindex.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/action/titleindex.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** titleindex.py 16 Apr 2002 21:03:34 -0000 1.4 --- titleindex.py 17 Apr 2002 21:58:17 -0000 1.5 *************** *** 25,29 **** mimetype = "text/plain" ! webapi.http_headers(["Content-Type: " + mimetype]) print --- 25,29 ---- mimetype = "text/plain" ! webapi.http_headers(request, ["Content-Type: " + mimetype]) print From jhermann at users.sourceforge.net Wed Apr 17 15:02:21 2002 From: jhermann at users.sourceforge.net (J?rgen Hermann) Date: Wed Apr 17 15:02:21 2002 Subject: [Moin-devel] CVS: MoinMoin Page.py,1.116,1.117 PageEditor.py,1.5,1.6 cgimain.py,1.51,1.52 config.py,1.66,1.67 httpdmain.py,1.11,1.12 user.py,1.58,1.59 userform.py,1.15,1.16 wikiaction.py,1.68,1.69 wikimacro.py,1.38,1.39 Message-ID: Update of /cvsroot/moin/MoinMoin In directory usw-pr-cvs1:/tmp/cvs-serv23792 Modified Files: Page.py PageEditor.py cgimain.py config.py httpdmain.py user.py userform.py wikiaction.py wikimacro.py Log Message: Removed remaining dependencies on cgimain.request Index: Page.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/Page.py,v retrieving revision 1.116 retrieving revision 1.117 diff -C2 -r1.116 -r1.117 *** Page.py 17 Apr 2002 21:04:45 -0000 1.116 --- Page.py 17 Apr 2002 21:58:16 -0000 1.117 *************** *** 227,231 **** if form.has_key('action') or form.has_key('redirect') or content_only: continue ! webapi.http_redirect('%s/%s?action=show&redirect=%s' % ( webapi.getScriptname(), wikiutil.quoteWikiname(pi_redirect), --- 227,231 ---- if form.has_key('action') or form.has_key('redirect') or content_only: continue ! webapi.http_redirect(request, '%s/%s?action=show&redirect=%s' % ( webapi.getScriptname(), wikiutil.quoteWikiname(pi_redirect), *************** *** 277,281 **** if not content_only: # send the document leader ! webapi.http_headers() sys.stdout.write(doc_leader) --- 277,281 ---- if not content_only: # send the document leader ! webapi.http_headers(request) sys.stdout.write(doc_leader) *************** *** 430,434 **** try: try: ! Page(self.page_name).send_page({}, content_only=1) except: cache.update('') --- 430,434 ---- try: try: ! Page(self.page_name).send_page(request, content_only=1) except: cache.update('') Index: PageEditor.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/PageEditor.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** PageEditor.py 17 Apr 2002 21:04:45 -0000 1.5 --- PageEditor.py 17 Apr 2002 21:58:16 -0000 1.6 *************** *** 53,57 **** return ! webapi.http_headers(webapi.nocache) if self.prev_date: --- 53,57 ---- return ! webapi.http_headers(request, webapi.nocache) if self.prev_date: Index: cgimain.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/cgimain.py,v retrieving revision 1.51 retrieving revision 1.52 diff -C2 -r1.51 -r1.52 *** cgimain.py 17 Apr 2002 21:04:45 -0000 1.51 --- cgimain.py 17 Apr 2002 21:58:16 -0000 1.52 *************** *** 18,24 **** # set up request data from MoinMoin.request import Request ! global request ! request = Request(properties) ! return request --- 18,22 ---- # set up request data from MoinMoin.request import Request ! return Request(properties) *************** *** 106,110 **** opened_logs = 1 ! createRequest(properties) # Imports --- 104,108 ---- opened_logs = 1 ! request = createRequest(properties) # Imports *************** *** 132,136 **** pagename = wikiutil.unquoteWikiname(path_info[1:]) except: # catch and print any exception ! webapi.http_headers() cgi.print_exception() sys.exit(0) --- 130,134 ---- pagename = wikiutil.unquoteWikiname(path_info[1:]) except: # catch and print any exception ! webapi.http_headers(request) cgi.print_exception() sys.exit(0) *************** *** 140,144 **** pagetrail = user.current.getTrail() if pagetrail: ! webapi.http_redirect(Page(pagetrail[-1]).url()) sys.exit(0) --- 138,142 ---- pagetrail = user.current.getTrail() if pagetrail: ! webapi.http_redirect(request, Page(pagetrail[-1]).url()) sys.exit(0) *************** *** 171,175 **** handler(pagename or wikiutil.getSysPage(config.page_front_page).page_name, request) else: ! webapi.http_headers() print "

" + _("Unknown action") else: --- 169,173 ---- handler(pagename or wikiutil.getSysPage(config.page_front_page).page_name, request) else: ! webapi.http_headers(request) print "

" + _("Unknown action") else: *************** *** 183,187 **** if config.allow_extended_names: ! Page(query).send_page(request.form, count_hit=1) else: from MoinMoin.parser.wiki import Parser --- 181,185 ---- if config.allow_extended_names: ! Page(query).send_page(request, count_hit=1) else: from MoinMoin.parser.wiki import Parser *************** *** 190,196 **** if word_match: word = word_match.group(0) ! Page(word).send_page(request.form, count_hit=1) else: ! webapi.http_headers() print '

' + _("Can't work out query") + ' "

' + query + '
"' --- 188,194 ---- if word_match: word = word_match.group(0) ! Page(word).send_page(request, count_hit=1) else: ! webapi.http_headers(request) print '

' + _("Can't work out query") + ' "

' + query + '
"' *************** *** 215,219 **** except: # catch and print any exception ! webapi.http_headers() print print "" --- 213,217 ---- except: # catch and print any exception ! webapi.http_headers(request) print print "" *************** *** 235,237 **** --- 233,236 ---- sys.stdout.flush() + return request Index: config.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/config.py,v retrieving revision 1.66 retrieving revision 1.67 diff -C2 -r1.66 -r1.67 *** config.py 9 Apr 2002 21:25:31 -0000 1.66 --- config.py 17 Apr 2002 21:58:16 -0000 1.67 *************** *** 171,176 **** del os, _dirname, _varname - if default_config: - from MoinMoin import cgimain - cgimain.request = None - --- 171,172 ---- Index: httpdmain.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/httpdmain.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -r1.11 -r1.12 *** httpdmain.py 27 Mar 2002 22:41:14 -0000 1.11 --- httpdmain.py 17 Apr 2002 21:58:16 -0000 1.12 *************** *** 162,166 **** self.send_response(200) ! cgimain.run(properties={'standalone': 1}) sys.stdout.flush() --- 162,166 ---- self.send_response(200) ! request = cgimain.run(properties={'standalone': 1}) sys.stdout.flush() *************** *** 173,179 **** self.log_error("CGI script exit status %s", str(sts)) else: ! #cgimain.request.clock.stop('total') self.log_error("CGI script exited OK, taking %s secs" % ! cgimain.request.clock.value('total')) sys.stdout.flush() --- 173,179 ---- self.log_error("CGI script exit status %s", str(sts)) else: ! #request.clock.stop('total') self.log_error("CGI script exited OK, taking %s secs" % ! request.clock.value('total')) sys.stdout.flush() Index: user.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/user.py,v retrieving revision 1.58 retrieving revision 1.59 diff -C2 -r1.58 -r1.59 *** user.py 15 Mar 2002 22:01:26 -0000 1.58 --- user.py 17 Apr 2002 21:58:16 -0000 1.59 *************** *** 198,205 **** ! def sendCookie(self): """Send the Set-Cookie header for this user""" # prepare to send cookie ! webapi.setHttpHeader(self.getCookie()) # create a "fake" cookie variable so the rest of the --- 198,205 ---- ! def sendCookie(self, request): """Send the Set-Cookie header for this user""" # prepare to send cookie ! webapi.setHttpHeader(request, self.getCookie()) # create a "fake" cookie variable so the rest of the Index: userform.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/userform.py,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -r1.15 -r1.16 *** userform.py 17 Apr 2002 21:04:46 -0000 1.15 --- userform.py 17 Apr 2002 21:58:16 -0000 1.16 *************** *** 44,48 **** if cookie.has_key('MOIN_ID'): uid = cookie['MOIN_ID'].value ! webapi.setHttpHeader('Set-Cookie: MOIN_ID=%s; expires=Tuesday, 01-Jan-1999 12:00:00 GMT; Path=%s' % ( cookie['MOIN_ID'].value, webapi.getScriptname(),)) os.environ['HTTP_COOKIE'] = '' --- 44,48 ---- if cookie.has_key('MOIN_ID'): uid = cookie['MOIN_ID'].value ! webapi.setHttpHeader(request, 'Set-Cookie: MOIN_ID=%s; expires=Tuesday, 01-Jan-1999 12:00:00 GMT; Path=%s' % ( cookie['MOIN_ID'].value, webapi.getScriptname(),)) os.environ['HTTP_COOKIE'] = '' *************** *** 94,98 **** # send the cookie ! theuser.sendCookie() user.current = theuser else: --- 94,98 ---- # send the cookie ! theuser.sendCookie(request) user.current = theuser else: *************** *** 201,205 **** # save data and send cookie theuser.save() ! theuser.sendCookie() user.current = theuser --- 201,205 ---- # save data and send cookie theuser.save() ! theuser.sendCookie(request) user.current = theuser *************** *** 388,395 **** data.update(vars(user.current)) result = htmlform % data - - # from MoinMoin import cgimain - # result = result + "Saved:
" + cgimain.request.saved_cookie + "
" - # result = result + " Now:
" + os.environ.get('HTTP_COOKIE', 'NONE') + "
" return result --- 388,391 ---- Index: wikiaction.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/wikiaction.py,v retrieving revision 1.68 retrieving revision 1.69 diff -C2 -r1.68 -r1.69 *** wikiaction.py 17 Apr 2002 21:04:46 -0000 1.68 --- wikiaction.py 17 Apr 2002 21:58:16 -0000 1.69 *************** *** 36,40 **** # send http headers ! webapi.http_headers() # get parameters --- 36,40 ---- # send http headers ! webapi.http_headers(request) # get parameters *************** *** 83,87 **** start = time.clock() ! webapi.http_headers() if request.form.has_key(fieldname): --- 83,87 ---- start = time.clock() ! webapi.http_headers(request) if request.form.has_key(fieldname): *************** *** 153,157 **** def do_diff(pagename, request): """ Handle "action=diff", checking for a "date=backupdate" parameter """ ! webapi.http_headers() # try to get a specific date to compare to, or None for one-before-current --- 153,157 ---- def do_diff(pagename, request): """ Handle "action=diff", checking for a "date=backupdate" parameter """ ! webapi.http_headers(request) # try to get a specific date to compare to, or None for one-before-current *************** *** 275,279 **** page = Page(pagename) ! webapi.http_headers() wikiutil.send_title(_('Info for "%s"') % (pagename,), pagename=pagename) print '

' + _('General Information') + '

\n' --- 275,279 ---- page = Page(pagename) ! webapi.http_headers(request) wikiutil.send_title(_('Info for "%s"') % (pagename,), pagename=pagename) print '

' + _('General Information') + '

\n' *************** *** 385,389 **** def do_content(pagename, request): ! webapi.http_headers() page = Page(pagename) print '' % webapi.getQualifiedURL(page.url()) --- 385,389 ---- def do_content(pagename, request): ! webapi.http_headers(request) page = Page(pagename) print '' % webapi.getQualifiedURL(page.url()) *************** *** 517,521 **** def do_raw(pagename, request): ! webapi.http_headers(["Content-type: text/plain"]) try: --- 517,521 ---- def do_raw(pagename, request): ! webapi.http_headers(request, ["Content-type: text/plain"]) try: *************** *** 544,549 **** from formatter.text_plain import Formatter ! #webapi.http_headers(["Content-Type: " + mimetype]) ! webapi.http_headers(["Content-Type: " + 'text/plain']) Page(pagename, formatter = Formatter(request)).send_page(request) --- 544,549 ---- from formatter.text_plain import Formatter ! #webapi.http_headers(request, ["Content-Type: " + mimetype]) ! webapi.http_headers(request, ["Content-Type: " + 'text/plain']) Page(pagename, formatter = Formatter(request)).send_page(request) *************** *** 566,570 **** data = util.dumpFormData(request.form) ! webapi.http_headers() print "" print data --- 566,570 ---- data = util.dumpFormData(request.form) ! webapi.http_headers(request) print "" print data Index: wikimacro.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/wikimacro.py,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -r1.38 -r1.39 *** wikimacro.py 20 Mar 2002 23:57:07 -0000 1.38 --- wikimacro.py 17 Apr 2002 21:58:16 -0000 1.39 *************** *** 18,22 **** from MoinMoin import action, config, editlog, macro, user, util from MoinMoin import version, wikiutil, wikiaction ! from MoinMoin.Page import Page, request from MoinMoin.i18n import _ --- 18,22 ---- from MoinMoin import action, config, editlog, macro, user, util from MoinMoin import version, wikiutil, wikiaction ! from MoinMoin.Page import Page from MoinMoin.i18n import _ *************** *** 70,74 **** self.formatter = self.parser.formatter self.form = self.parser.form ! self.request = request def execute(self, macro_name, args): --- 70,74 ---- self.formatter = self.parser.formatter self.form = self.parser.form ! self.request = self.parser.request def execute(self, macro_name, args): From jhermann at users.sourceforge.net Wed Apr 17 15:02:21 2002 From: jhermann at users.sourceforge.net (J?rgen Hermann) Date: Wed Apr 17 15:02:21 2002 Subject: [Moin-devel] CVS: MoinMoin/stats hitcounts.py,1.5,1.6 pagesize.py,1.3,1.4 useragents.py,1.2,1.3 Message-ID: Update of /cvsroot/moin/MoinMoin/stats In directory usw-pr-cvs1:/tmp/cvs-serv23792/stats Modified Files: hitcounts.py pagesize.py useragents.py Log Message: Removed remaining dependencies on cgimain.request Index: hitcounts.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/stats/hitcounts.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** hitcounts.py 2 Feb 2002 12:18:48 -0000 1.5 --- hitcounts.py 17 Apr 2002 21:58:17 -0000 1.6 *************** *** 122,126 **** "Content-Length: %d" % len(image.getvalue()), ] ! webapi.http_headers(headers) # copy the image --- 122,126 ---- "Content-Length: %d" % len(image.getvalue()), ] ! webapi.http_headers(request, headers) # copy the image Index: pagesize.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/stats/pagesize.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** pagesize.py 2 Feb 2002 12:18:48 -0000 1.3 --- pagesize.py 17 Apr 2002 21:58:17 -0000 1.4 *************** *** 111,115 **** "Content-Length: %d" % len(image.getvalue()), ] ! webapi.http_headers(headers) # copy the image --- 111,115 ---- "Content-Length: %d" % len(image.getvalue()), ] ! webapi.http_headers(request, headers) # copy the image Index: useragents.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/stats/useragents.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** useragents.py 9 Feb 2002 00:55:29 -0000 1.2 --- useragents.py 17 Apr 2002 21:58:17 -0000 1.3 *************** *** 107,111 **** "Content-Length: %d" % len(image.getvalue()), ] ! webapi.http_headers(headers) # copy the image --- 107,111 ---- "Content-Length: %d" % len(image.getvalue()), ] ! webapi.http_headers(request, headers) # copy the image From jhermann at users.sourceforge.net Wed Apr 17 15:14:21 2002 From: jhermann at users.sourceforge.net (J?rgen Hermann) Date: Wed Apr 17 15:14:21 2002 Subject: [Moin-devel] CVS: MoinMoin wikiaction.py,1.69,1.70 Message-ID: Update of /cvsroot/moin/MoinMoin In directory usw-pr-cvs1:/tmp/cvs-serv29345 Modified Files: wikiaction.py Log Message: Bugfixes for stats Index: wikiaction.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/wikiaction.py,v retrieving revision 1.69 retrieving revision 1.70 diff -C2 -r1.69 -r1.70 *** wikiaction.py 17 Apr 2002 21:58:16 -0000 1.69 --- wikiaction.py 17 Apr 2002 22:13:28 -0000 1.70 *************** *** 559,563 **** chart_type = request.form['type'].value func = util.importName("MoinMoin.stats." + chart_type, "draw") ! apply(func, (pagename, request.form)) sys.exit(0) --- 559,563 ---- chart_type = request.form['type'].value func = util.importName("MoinMoin.stats." + chart_type, "draw") ! apply(func, (pagename, request)) sys.exit(0) From jhermann at users.sourceforge.net Wed Apr 17 15:14:21 2002 From: jhermann at users.sourceforge.net (J?rgen Hermann) Date: Wed Apr 17 15:14:21 2002 Subject: [Moin-devel] CVS: MoinMoin/stats hitcounts.py,1.6,1.7 pagesize.py,1.4,1.5 useragents.py,1.3,1.4 Message-ID: Update of /cvsroot/moin/MoinMoin/stats In directory usw-pr-cvs1:/tmp/cvs-serv29345/stats Modified Files: hitcounts.py pagesize.py useragents.py Log Message: Bugfixes for stats Index: hitcounts.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/stats/hitcounts.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** hitcounts.py 17 Apr 2002 21:58:17 -0000 1.6 --- hitcounts.py 17 Apr 2002 22:13:28 -0000 1.7 *************** *** 23,27 **** if _debug: ! return draw(pagename, {}) page = Page(pagename) --- 23,27 ---- if _debug: ! return draw(pagename, None) page = Page(pagename) *************** *** 38,42 **** ! def draw(pagename, form): import cgi, sys, shutil, cStringIO from MoinMoin import config, webapi, eventlog, user --- 38,42 ---- ! def draw(pagename, request): import cgi, sys, shutil, cStringIO from MoinMoin import config, webapi, eventlog, user *************** *** 45,50 **** # check params filterpage = None ! if form and form.has_key('page'): ! filterpage = form['page'].value # prepare data --- 45,50 ---- # check params filterpage = None ! if request and request.form and request.form.has_key('page'): ! filterpage = request.form['page'].value # prepare data Index: pagesize.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/stats/pagesize.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** pagesize.py 17 Apr 2002 21:58:17 -0000 1.4 --- pagesize.py 17 Apr 2002 22:13:28 -0000 1.5 *************** *** 23,27 **** if _debug: ! return draw(pagename, {}) page = Page(pagename) --- 23,27 ---- if _debug: ! return draw(pagename, None) page = Page(pagename) *************** *** 44,48 **** ! def draw(pagename, form): import bisect, cgi, sys, shutil, cStringIO from MoinMoin import config, webapi --- 44,48 ---- ! def draw(pagename, request): import bisect, cgi, sys, shutil, cStringIO from MoinMoin import config, webapi Index: useragents.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/stats/useragents.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** useragents.py 17 Apr 2002 21:58:17 -0000 1.3 --- useragents.py 17 Apr 2002 22:13:28 -0000 1.4 *************** *** 24,28 **** if _debug: ! return draw(pagename, {}) page = Page(pagename) --- 24,28 ---- if _debug: ! return draw(pagename, None) page = Page(pagename) *************** *** 38,42 **** ! def draw(pagename, form): import cgi, sys, shutil, cStringIO, operator from MoinMoin import config, webapi, eventlog --- 38,42 ---- ! def draw(pagename, request): import cgi, sys, shutil, cStringIO, operator from MoinMoin import config, webapi, eventlog From jhermann at users.sourceforge.net Wed Apr 17 15:20:10 2002 From: jhermann at users.sourceforge.net (J?rgen Hermann) Date: Wed Apr 17 15:20:10 2002 Subject: [Moin-devel] CVS: MoinMoin/macro Include.py,1.7,1.8 Message-ID: Update of /cvsroot/moin/MoinMoin/macro In directory usw-pr-cvs1:/tmp/cvs-serv31422/macro Modified Files: Include.py Log Message: [ 545364 ] TypeError: not enough arguments Index: Include.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/macro/Include.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** Include.py 17 Apr 2002 21:04:46 -0000 1.7 --- Include.py 17 Apr 2002 22:19:10 -0000 1.8 *************** *** 50,54 **** if this_page._macroInclude_pagelist.has_key(inc_name): ret = ret + '

Recursive include of "%s" forbidden

' % (inc_name,) ! inc_page = Page(inc_name, formatter=macro.formatter.__class__()) inc_page._macroInclude_pagelist = this_page._macroInclude_pagelist --- 50,54 ---- if this_page._macroInclude_pagelist.has_key(inc_name): ret = ret + '

Recursive include of "%s" forbidden

' % (inc_name,) ! inc_page = Page(inc_name, formatter=macro.formatter.__class__(macro.request)) inc_page._macroInclude_pagelist = this_page._macroInclude_pagelist From jhermann at users.sourceforge.net Thu Apr 18 11:38:03 2002 From: jhermann at users.sourceforge.net (J?rgen Hermann) Date: Thu Apr 18 11:38:03 2002 Subject: [Moin-devel] CVS: MoinMoin/parser python.py,1.10,1.11 Message-ID: Update of /cvsroot/moin/MoinMoin/parser In directory usw-pr-cvs1:/tmp/cvs-serv14485/parser Modified Files: python.py Log Message: py 1.5.2 Index: python.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/parser/python.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -r1.10 -r1.11 *** python.py 17 Apr 2002 19:24:58 -0000 1.10 --- python.py 18 Apr 2002 18:36:02 -0000 1.11 *************** *** 50,54 **** if self.lineinfo: for info in self.lineinfo.get(self.line, []): ! self.infocounter += 1 self.out.write('' '' % (self.infocounter, '#FF0000')) --- 50,54 ---- if self.lineinfo: for info in self.lineinfo.get(self.line, []): ! self.infocounter = self.infocounter + 1 self.out.write('' '' % (self.infocounter, '#FF0000')) *************** *** 73,77 **** self.out.write(parts[0]) for part in parts[1:]: ! self.line += 1 self.out.write('\n') self.line_no() --- 73,77 ---- self.out.write(parts[0]) for part in parts[1:]: ! self.line = self.line + 1 self.out.write('\n') self.line_no() From jhermann at users.sourceforge.net Thu Apr 18 11:38:05 2002 From: jhermann at users.sourceforge.net (J?rgen Hermann) Date: Thu Apr 18 11:38:05 2002 Subject: [Moin-devel] CVS: MoinMoin httpdmain.py,1.12,1.13 Message-ID: Update of /cvsroot/moin/MoinMoin In directory usw-pr-cvs1:/tmp/cvs-serv14485 Modified Files: httpdmain.py Log Message: py 1.5.2 Index: httpdmain.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/httpdmain.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -r1.12 -r1.13 *** httpdmain.py 17 Apr 2002 21:58:16 -0000 1.12 --- httpdmain.py 18 Apr 2002 18:36:01 -0000 1.13 *************** *** 212,216 **** i = 0 while not httpd._abort: ! i += 1 stdout.write("\|/-"[i%4] + "\r") time.sleep(1) --- 212,216 ---- i = 0 while not httpd._abort: ! i = i + 1 stdout.write("\|/-"[i%4] + "\r") time.sleep(1) From jhermann at users.sourceforge.net Thu Apr 18 11:38:06 2002 From: jhermann at users.sourceforge.net (J?rgen Hermann) Date: Thu Apr 18 11:38:06 2002 Subject: [Moin-devel] CVS: MoinMoin/scripts moin_dump.py,1.4,1.5 Message-ID: Update of /cvsroot/moin/MoinMoin/scripts In directory usw-pr-cvs1:/tmp/cvs-serv14485/scripts Modified Files: moin_dump.py Log Message: py 1.5.2 Index: moin_dump.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/scripts/moin_dump.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** moin_dump.py 17 Apr 2002 21:04:46 -0000 1.4 --- moin_dump.py 18 Apr 2002 18:36:02 -0000 1.5 *************** *** 144,148 **** page.send_page(request) except: ! errcnt += 1 print >>sys.stderr, "*** Caught exception while writing page!" print >>errlog, "~" * 78 --- 144,148 ---- page.send_page(request) except: ! errcnt = errcnt + 1 print >>sys.stderr, "*** Caught exception while writing page!" print >>errlog, "~" * 78 From jhermann at users.sourceforge.net Mon Apr 22 03:19:01 2002 From: jhermann at users.sourceforge.net (J?rgen Hermann) Date: Mon Apr 22 03:19:01 2002 Subject: [Moin-devel] CVS: MoinMoin/macro RecentChanges.py,1.56,1.57 Message-ID: Update of /cvsroot/moin/MoinMoin/macro In directory usw-pr-cvs1:/tmp/cvs-serv11322/MoinMoin/macro Modified Files: RecentChanges.py Log Message: Forcibly split pagenames if they get too long, so that they can wrap Index: RecentChanges.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/macro/RecentChanges.py,v retrieving revision 1.56 retrieving revision 1.57 diff -C2 -r1.56 -r1.57 *** RecentChanges.py 17 Apr 2002 21:58:17 -0000 1.56 --- RecentChanges.py 22 Apr 2002 10:18:19 -0000 1.57 *************** *** 14,19 **** from MoinMoin.i18n import _ ! _max_days = 14 ! ############################################################################# --- 14,19 ---- from MoinMoin.i18n import _ ! _MAX_DAYS = 14 ! _MAX_PAGENAME_LENGTH = 35 ############################################################################# *************** *** 78,82 **** if log.dayChanged(): ! if log.daycount > _max_days: break set_bm = '' --- 78,82 ---- if log.dayChanged(): ! if log.daycount > _MAX_DAYS: break set_bm = '' *************** *** 128,133 **** # print name of page, with a link to it buf.write('%s %s ' % ( ! html_link, page.link_to(),)) # print time of change --- 128,134 ---- # print name of page, with a link to it + force_split = len(page.page_name) > _MAX_PAGENAME_LENGTH buf.write('%s %s ' % ( ! html_link, page.link_to(text=page.split_title(force=force_split)),)) # print time of change *************** *** 296,300 **** Bag = new.classobj('Bag', (), {}) while log.getNextChange(): ! if log.dayChanged() and log.daycount > _max_days: break if log.action != 'SAVE': continue logdata.append(new.instance(Bag, { --- 297,301 ---- Bag = new.classobj('Bag', (), {}) while log.getNextChange(): ! if log.dayChanged() and log.daycount > _MAX_DAYS: break if log.action != 'SAVE': continue logdata.append(new.instance(Bag, { From jhermann at users.sourceforge.net Wed Apr 24 12:35:20 2002 From: jhermann at users.sourceforge.net (J?rgen Hermann) Date: Wed Apr 24 12:35:20 2002 Subject: [Moin-devel] CVS: MoinMoin httpdmain.py,1.13,1.14 wikiform.py,1.5,1.6 Message-ID: Update of /cvsroot/moin/MoinMoin In directory usw-pr-cvs1:/tmp/cvs-serv16408 Modified Files: httpdmain.py wikiform.py Log Message: Minor bugfixes Index: httpdmain.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/httpdmain.py,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -r1.13 -r1.14 *** httpdmain.py 18 Apr 2002 18:36:01 -0000 1.13 --- httpdmain.py 24 Apr 2002 19:22:12 -0000 1.14 *************** *** 184,187 **** --- 184,188 ---- def quit(signo, stackframe): """Signal handler for aborting signals.""" + global httpd print "Interrupted!" if httpd: httpd.die() Index: wikiform.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/wikiform.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** wikiform.py 17 Apr 2002 21:04:46 -0000 1.5 --- wikiform.py 24 Apr 2002 19:22:12 -0000 1.6 *************** *** 90,94 **** """ msg = _('Submitted form data:') + '
    \n' ! for key, val in _get_formvalues(form).items(): msg = msg + '
  • %s = %s
  • \n' % ( string.upper(key), repr(cgi.escape(val)) --- 90,94 ---- """ msg = _('Submitted form data:') + '
      \n' ! for key, val in _get_formvalues(request.form).items(): msg = msg + '
    • %s = %s
    • \n' % ( string.upper(key), repr(cgi.escape(val)) From jhermann at users.sourceforge.net Wed Apr 24 12:47:21 2002 From: jhermann at users.sourceforge.net (J?rgen Hermann) Date: Wed Apr 24 12:47:21 2002 Subject: [Moin-devel] CVS: MoinMoin/parser xslt.py,1.11,1.12 Message-ID: Update of /cvsroot/moin/MoinMoin/parser In directory usw-pr-cvs1:/tmp/cvs-serv21370/parser Modified Files: xslt.py Log Message: Moved wikiutil._footer_fragments to request instance Index: xslt.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/parser/xslt.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -r1.11 -r1.12 *** xslt.py 17 Apr 2002 19:24:58 -0000 1.11 --- xslt.py 24 Apr 2002 19:36:54 -0000 1.12 *************** *** 26,29 **** --- 26,30 ---- def __init__(self, raw, request, **kw): self.raw = raw + self.request = request def format(self, formatter, form): *************** *** 77,80 **** _("RefreshCache")) + _(' for this page (cached %(date)s)') % { 'date': user.current.getFormattedDateTime(cache.mtime()),} + '
      ' ! wikiutil.add2footer('RefreshCache', refresh) --- 78,81 ---- _("RefreshCache")) + _(' for this page (cached %(date)s)') % { 'date': user.current.getFormattedDateTime(cache.mtime()),} + '
      ' ! self.request.add2footer('RefreshCache', refresh) From jhermann at users.sourceforge.net Wed Apr 24 13:32:54 2002 From: jhermann at users.sourceforge.net (J?rgen Hermann) Date: Wed Apr 24 13:32:54 2002 Subject: [Moin-devel] CVS: MoinMoin/action AttachFile.py,1.33,1.34 LikePages.py,1.13,1.14 LocalSiteMap.py,1.6,1.7 links.py,1.5,1.6 Message-ID: Update of /cvsroot/moin/MoinMoin/action In directory usw-pr-cvs1:/tmp/cvs-serv21370/action Modified Files: AttachFile.py LikePages.py LocalSiteMap.py links.py Log Message: Moved wikiutil._footer_fragments to request instance Index: AttachFile.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/action/AttachFile.py,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -r1.33 -r1.34 *** AttachFile.py 17 Apr 2002 21:58:17 -0000 1.33 --- AttachFile.py 24 Apr 2002 19:36:54 -0000 1.34 *************** *** 305,309 **** wikiutil.send_title(_('Attachments for "%(pagename)s"') % locals(), pagename=pagename, msg=msg) send_uploadform(pagename, request) ! wikiutil.send_footer(pagename, showpage=1) --- 305,309 ---- wikiutil.send_title(_('Attachments for "%(pagename)s"') % locals(), pagename=pagename, msg=msg) send_uploadform(pagename, request) ! wikiutil.send_footer(request, pagename, showpage=1) *************** *** 484,487 **** # send footer ! wikiutil.send_footer(pagename) --- 484,487 ---- # send footer ! wikiutil.send_footer(request, pagename) Index: LikePages.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/action/LikePages.py,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -r1.13 -r1.14 *** LikePages.py 17 Apr 2002 21:58:17 -0000 1.13 --- LikePages.py 24 Apr 2002 19:36:54 -0000 1.14 *************** *** 78,82 **** showMatches(matches, keys, 2, "...%s" % (end,)) ! wikiutil.send_footer(pagename) --- 78,82 ---- showMatches(matches, keys, 2, "...%s" % (end,)) ! wikiutil.send_footer(request, pagename) Index: LocalSiteMap.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/action/LocalSiteMap.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** LocalSiteMap.py 17 Apr 2002 21:58:17 -0000 1.6 --- LocalSiteMap.py 24 Apr 2002 19:36:54 -0000 1.7 *************** *** 50,54 **** print LocalSiteMap(pagename).output(request) ! wikiutil.send_footer(pagename) --- 50,54 ---- print LocalSiteMap(pagename).output(request) ! wikiutil.send_footer(request, pagename) Index: links.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/action/links.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** links.py 17 Apr 2002 21:58:17 -0000 1.5 --- links.py 24 Apr 2002 19:36:54 -0000 1.6 *************** *** 51,55 **** if mimetype == "text/html": print '' ! wikiutil.send_footer(pagename, editable=0, showactions=0, form=form) else: sys.exit(0) --- 51,55 ---- if mimetype == "text/html": print '' ! wikiutil.send_footer(request, pagename, editable=0, showactions=0, form=form) else: sys.exit(0) From jhermann at users.sourceforge.net Wed Apr 24 13:33:04 2002 From: jhermann at users.sourceforge.net (J?rgen Hermann) Date: Wed Apr 24 13:33:04 2002 Subject: [Moin-devel] CVS: MoinMoin Page.py,1.117,1.118 request.py,1.5,1.6 wikiaction.py,1.70,1.71 wikiutil.py,1.94,1.95 Message-ID: Update of /cvsroot/moin/MoinMoin In directory usw-pr-cvs1:/tmp/cvs-serv21370 Modified Files: Page.py request.py wikiaction.py wikiutil.py Log Message: Moved wikiutil._footer_fragments to request instance Index: Page.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/Page.py,v retrieving revision 1.117 retrieving revision 1.118 diff -C2 -r1.117 -r1.118 *** Page.py 17 Apr 2002 21:58:16 -0000 1.117 --- Page.py 24 Apr 2002 19:36:53 -0000 1.118 *************** *** 391,395 **** # send the page footer if self.default_formatter and not print_mode: ! wikiutil.send_footer(self.page_name, self._last_modified(), print_mode=print_mode) --- 391,395 ---- # send the page footer if self.default_formatter and not print_mode: ! wikiutil.send_footer(request, self.page_name, self._last_modified(), print_mode=print_mode) Index: request.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/request.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** request.py 13 Feb 2002 21:13:52 -0000 1.5 --- request.py 24 Apr 2002 19:36:54 -0000 1.6 *************** *** 1,4 **** """ ! MoinMoin - HTTP Request Data Copyright (c) 2001, 2002 by J?rgen Hermann --- 1,4 ---- """ ! MoinMoin - Data associated with a single Request Copyright (c) 2001, 2002 by J?rgen Hermann *************** *** 58,61 **** --- 58,70 ---- self.lang = i18n.getLang() i18n.adaptCharset(self.lang) + + self._footer_fragments = {} + + + def add2footer(self, key, htmlcode): + """ Add a named HTML fragment to the footer, after the default links + """ + self._footer_fragments[key] = htmlcode + def getPragma(self, key, defval=None): Index: wikiaction.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/wikiaction.py,v retrieving revision 1.70 retrieving revision 1.71 diff -C2 -r1.70 -r1.71 *** wikiaction.py 17 Apr 2002 22:13:28 -0000 1.70 --- wikiaction.py 24 Apr 2002 19:36:54 -0000 1.71 *************** *** 77,81 **** print_search_stats(len(hits), pagecount, start) ! wikiutil.send_footer(pagename, editable=0, showactions=0, form=request.form) --- 77,81 ---- print_search_stats(len(hits), pagecount, start) ! wikiutil.send_footer(request, pagename, editable=0, showactions=0, form=request.form) *************** *** 106,110 **** print_search_stats(len(hits), len(all_pages), start) ! wikiutil.send_footer(pagename, editable=0, showactions=0, form=request.form) --- 106,110 ---- print_search_stats(len(hits), len(all_pages), start) ! wikiutil.send_footer(request, pagename, editable=0, showactions=0, form=request.form) *************** *** 266,270 **** print '' ! wikiutil.send_footer(pagename, showpage=1) --- 266,270 ---- print '' ! wikiutil.send_footer(request, pagename, showpage=1) *************** *** 360,364 **** print '\n' ! wikiutil.send_footer(pagename, showpage=1) --- 360,364 ---- print '\n' ! wikiutil.send_footer(request, pagename, showpage=1) Index: wikiutil.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/wikiutil.py,v retrieving revision 1.94 retrieving revision 1.95 diff -C2 -r1.94 -r1.95 *** wikiutil.py 27 Mar 2002 23:13:11 -0000 1.94 --- wikiutil.py 24 Apr 2002 19:36:54 -0000 1.95 *************** *** 614,626 **** ! _footer_fragments = {} ! ! def add2footer(key, htmlcode): ! """ Add a named HTML fragment to the footer, after the default links ! """ ! _footer_fragments[key] = htmlcode ! ! ! def send_footer(pagename, mod_string=None, **keywords): """ Print the page footer. --- 614,618 ---- ! def send_footer(request, pagename, mod_string=None, **keywords): """ Print the page footer. *************** *** 678,683 **** # output HTML code added by the page formatters ! if _footer_fragments: ! print string.join(_footer_fragments.values(), '') # list user actions that start with an uppercase letter --- 670,675 ---- # output HTML code added by the page formatters ! if request._footer_fragments: ! print string.join(request._footer_fragments.values(), '') # list user actions that start with an uppercase letter From jhermann at users.sourceforge.net Wed Apr 24 13:40:28 2002 From: jhermann at users.sourceforge.net (J?rgen Hermann) Date: Wed Apr 24 13:40:28 2002 Subject: [Moin-devel] CVS: MoinMoin/action AttachFile.py,1.34,1.35 DeletePage.py,1.13,1.14 Message-ID: Update of /cvsroot/moin/MoinMoin/action In directory usw-pr-cvs1:/tmp/cvs-serv32698/action Modified Files: AttachFile.py DeletePage.py Log Message: Replaced most refs to user.current by request.user Index: AttachFile.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/action/AttachFile.py,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -r1.34 -r1.35 *** AttachFile.py 24 Apr 2002 19:36:54 -0000 1.34 --- AttachFile.py 24 Apr 2002 20:11:21 -0000 1.35 *************** *** 127,131 **** ! def _get_filelist(pagename): # access directory attach_dir = getAttachDir(pagename) --- 127,131 ---- ! def _get_filelist(request, pagename): # access directory attach_dir = getAttachDir(pagename) *************** *** 158,162 **** del_link = '' ! if user.current.may.delete: del_link = '%(label_del)s | ' % locals() --- 158,162 ---- del_link = '' ! if request.user.may.delete: del_link = '%(label_del)s | ' % locals() *************** *** 222,228 **** """ print _("

      Attached Files

      ") ! print _get_filelist(pagename) ! if not user.current.may.edit: print '

      %s

      ' % _('You are not allowed to upload files.') return --- 222,228 ---- """ print _("

      Attached Files

      ") ! print _get_filelist(request, pagename) ! if not request.user.may.edit: print '

      %s

      ' % _('You are not allowed to upload files.') return *************** *** 281,290 **** upload_form(pagename, request) elif request.form['do'].value == 'upload': ! if user.current.may.edit: do_upload(pagename, request) else: msg = _('You are not allowed to upload files.') elif request.form['do'].value == 'del': ! if user.current.may.delete: del_file(pagename, request) else: --- 281,290 ---- upload_form(pagename, request) elif request.form['do'].value == 'upload': ! if request.user.may.edit: do_upload(pagename, request) else: msg = _('You are not allowed to upload files.') elif request.form['do'].value == 'del': ! if request.user.may.delete: del_file(pagename, request) else: Index: DeletePage.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/action/DeletePage.py,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -r1.13 -r1.14 *** DeletePage.py 17 Apr 2002 21:04:46 -0000 1.13 --- DeletePage.py 24 Apr 2002 20:11:21 -0000 1.14 *************** *** 23,28 **** # be extra paranoid in dangerous actions ! if actname in config.excluded_actions or not user.current.may.edit \ ! or not user.current.may.delete: return page.send_page(request, msg='%s' % --- 23,29 ---- # be extra paranoid in dangerous actions ! if actname in config.excluded_actions \ ! or not request.user.may.edit \ ! or not request.user.may.delete: return page.send_page(request, msg='%s' % From jhermann at users.sourceforge.net Wed Apr 24 13:40:34 2002 From: jhermann at users.sourceforge.net (J?rgen Hermann) Date: Wed Apr 24 13:40:34 2002 Subject: [Moin-devel] CVS: MoinMoin PageEditor.py,1.6,1.7 cgimain.py,1.52,1.53 request.py,1.6,1.7 userform.py,1.16,1.17 wikiaction.py,1.71,1.72 wikimacro.py,1.39,1.40 wikiutil.py,1.95,1.96 Message-ID: Update of /cvsroot/moin/MoinMoin In directory usw-pr-cvs1:/tmp/cvs-serv32698 Modified Files: PageEditor.py cgimain.py request.py userform.py wikiaction.py wikimacro.py wikiutil.py Log Message: Replaced most refs to user.current by request.user Index: PageEditor.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/PageEditor.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** PageEditor.py 17 Apr 2002 21:58:16 -0000 1.6 --- PageEditor.py 24 Apr 2002 20:11:21 -0000 1.7 *************** *** 48,52 **** # check edit permissions ! if not user.current.may.edit: self.send_page(request, msg=_("""You are not allowed to edit any pages.""")) --- 48,52 ---- # check edit permissions ! if not request.user.may.edit: self.send_page(request, msg=_("""You are not allowed to edit any pages.""")) *************** *** 91,100 **** except StandardError: text_rows = config.edit_rows ! if user.current.valid: text_rows = int(user.current.edit_rows) try: text_cols = int(form['cols'].value) except StandardError: text_cols = 80 ! if user.current.valid: text_cols = int(user.current.edit_cols) print '
      ' % ( --- 91,100 ---- except StandardError: text_rows = config.edit_rows ! if request.user.valid: text_rows = int(request.user.edit_rows) try: text_cols = int(form['cols'].value) except StandardError: text_cols = 80 ! if request.user.valid: text_cols = int(request.user.edit_cols) print '' % ( *************** *** 239,243 **** emails = [] for uid in userlist: ! if uid == user.current.id: continue # no self notification subscriber = user.User(uid) if not subscriber.email: continue # skip empty email address --- 239,243 ---- emails = [] for uid in userlist: ! if uid == request.user.id: continue # no self notification subscriber = user.User(uid) if not subscriber.email: continue # skip empty email address *************** *** 255,259 **** "The following page has been changed by %(editor)s:\n" "%(pagelink)s\n\n") % { ! 'editor': user.current.name or os.environ.get('REMOTE_ADDR', ""), 'pagelink': webapi.getQualifiedURL(self.url()), 'sitename': config.sitename or webapi.getBaseURL(), --- 255,259 ---- "The following page has been changed by %(editor)s:\n" "%(pagelink)s\n\n") % { ! 'editor': request.user.name or os.environ.get('REMOTE_ADDR', ""), 'pagelink': webapi.getQualifiedURL(self.url()), 'sitename': config.sitename or webapi.getBaseURL(), *************** *** 285,289 **** 'pagename': self.page_name, }, ! mailBody, mail_from=user.current.email) return msg --- 285,289 ---- 'pagename': self.page_name, }, ! mailBody, mail_from=request.user.email) return msg *************** *** 291,295 **** ! def _user_variable(self): """If user has a profile return the user name from the profile else return the remote address or "anonymous" --- 291,295 ---- ! def _user_variable(self, request): """If user has a profile return the user name from the profile else return the remote address or "anonymous" *************** *** 298,302 **** links to the wiki user homepage (if one exists). """ ! username = user.current.name if username and config.allow_extended_names and \ string.count(username, ' ') and Page(username).exists(): --- 298,302 ---- links to the wiki user homepage (if one exists). """ ! username = request.user.name if username and config.allow_extended_names and \ string.count(username, ' ') and Page(username).exists(): *************** *** 305,309 **** ! def _expand_variables(self, text): """Expand @VARIABLE@ in `text`and return the expanded text.""" #!!! TODO: Allow addition of variables via moin_config (and/or a text file) --- 305,309 ---- ! def _expand_variables(self, request, text): """Expand @VARIABLE@ in `text`and return the expanded text.""" #!!! TODO: Allow addition of variables via moin_config (and/or a text file) *************** *** 312,323 **** 'TIME': lambda t=now: "[[DateTime(%s)]]" % t, 'DATE': lambda t=now: "[[Date(%s)]]" % t, ! 'USERNAME': lambda s=self: s._user_variable(), ! 'USER': lambda s=self: "-- %s" % (s._user_variable(),), ! 'SIG': lambda s=self, t=now: "-- %s [[DateTime(%s)]]" ! % (s._user_variable(), t,), } ! if user.current.valid and user.current.name and user.current.email: ! system_vars['MAILTO'] = lambda u=user.current: \ "[mailto:%s %s]" % (u.email, u.name) #!!! TODO: Use a more stream-lined re.sub algorithm --- 312,323 ---- 'TIME': lambda t=now: "[[DateTime(%s)]]" % t, 'DATE': lambda t=now: "[[Date(%s)]]" % t, ! 'USERNAME': lambda s=self, r=request: s._user_variable(r), ! 'USER': lambda s=self, r=request: "-- %s" % (s._user_variable(r),), ! 'SIG': lambda s=self, r=request, t=now: "-- %s [[DateTime(%s)]]" ! % (s._user_variable(r), t,), } ! if request.user.valid and request.user.name and request.user.email: ! system_vars['MAILTO'] = lambda u=request.user: \ "[mailto:%s %s]" % (u.email, u.name) #!!! TODO: Use a more stream-lined re.sub algorithm *************** *** 371,375 **** """ msg = "" ! if not user.current.may.edit: msg = _("""You are not allowed to edit any pages.""") if not newtext: --- 371,375 ---- """ msg = "" ! if not request.user.may.edit: msg = _("""You are not allowed to edit any pages.""") if not newtext: *************** *** 409,413 **** if not (wikiutil.isTemplatePage(self.page_name) or wikiutil.isFormPage(self.page_name)): ! newtext = self._expand_variables(newtext) # write the page file --- 409,413 ---- if not (wikiutil.isTemplatePage(self.page_name) or wikiutil.isFormPage(self.page_name)): ! newtext = self._expand_variables(request, newtext) # write the page file Index: cgimain.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/cgimain.py,v retrieving revision 1.52 retrieving revision 1.53 diff -C2 -r1.52 -r1.53 *** cgimain.py 17 Apr 2002 21:58:16 -0000 1.52 --- cgimain.py 24 Apr 2002 20:11:21 -0000 1.53 *************** *** 113,116 **** --- 113,119 ---- request.clock.stop('imports') + # !!! if all refs to user.current are removed, create the user together with the request instance + request.user = user.current + # sys.stderr.write("----\n") # for key in os.environ.keys(): *************** *** 135,140 **** # possibly jump to page where user left off ! if not pagename and not action and user.current.remember_last_visit: ! pagetrail = user.current.getTrail() if pagetrail: webapi.http_redirect(request, Page(pagetrail[-1]).url()) --- 138,143 ---- # possibly jump to page where user left off ! if not pagename and not action and request.user.remember_last_visit: ! pagetrail = request.user.getTrail() if pagetrail: webapi.http_redirect(request, Page(pagetrail[-1]).url()) Index: request.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/request.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** request.py 24 Apr 2002 19:36:54 -0000 1.6 --- request.py 24 Apr 2002 20:11:21 -0000 1.7 *************** *** 44,47 **** --- 44,48 ---- from MoinMoin import i18n + self.user = None self.form = None self.pragma = {} Index: userform.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/userform.py,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -r1.16 -r1.17 *** userform.py 17 Apr 2002 21:58:16 -0000 1.16 --- userform.py 24 Apr 2002 20:11:21 -0000 1.17 *************** *** 47,51 **** cookie['MOIN_ID'].value, webapi.getScriptname(),)) os.environ['HTTP_COOKIE'] = '' ! user.current = user.User() return _("Cookie deleted!") --- 47,52 ---- cookie['MOIN_ID'].value, webapi.getScriptname(),)) os.environ['HTTP_COOKIE'] = '' ! request.user = user.User() ! user.current = request.user return _("Cookie deleted!") *************** *** 95,98 **** --- 96,100 ---- # send the cookie theuser.sendCookie(request) + request.user = theuser user.current = theuser else: *************** *** 202,205 **** --- 204,208 ---- theuser.save() theuser.sendCookie(request) + request.user = theuser user.current = theuser *************** *** 251,255 **** ! def getUserForm(form): # Note that this form is NOT designed for security, just to have a cookie # with name & email; do not base security measures on this! --- 254,260 ---- ! def getUserForm(request): ! form = request.form ! # Note that this form is NOT designed for security, just to have a cookie # with name & email; do not base security measures on this! *************** *** 310,322 **** for option, text in _date_formats.items(): dtfmt_select = dtfmt_select + '