From sanori at sanori.net Wed Sep 4 05:08:02 2002 From: sanori at sanori.net (Joo-won Jung) Date: Wed Sep 4 05:08:02 2002 Subject: [Moin-devel] Simple patch for attach file over SSL Message-ID: <20020904120726.GA2476@ns.sanori.net> Hello, Since Apache with mod_ssl does not give SSL_* environment variable to CGI, MoinMoin.webapi.isSSL() gives wrong result. That causes that TWikiDraw pictures does not appear if MoinMoin is over SSL/TLS (https). So, I added HTTPS variable check routine, and it works. Index: webapi/cgiMoin.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/webapi/cgiMoin.py,v retrieving revision 1.16 diff -c -r1.16 cgiMoin.py *** webapi/cgiMoin.py 17 Jul 2002 22:11:10 -0000 1.16 --- webapi/cgiMoin.py 4 Sep 2002 11:47:12 -0000 *************** *** 21,26 **** --- 21,27 ---- def isSSL(): """ Return true if we are on a SSL (https) connection. """ return os.environ.get('SSL_PROTOCOL', '') != '' or \ + os.environ.get('HTTPS', '') != '' or \ os.environ.get('SSL_PROTOCOL_VERSION', '') != '' Hope this helps -Sanori From jh at web.de Wed Sep 4 10:45:03 2002 From: jh at web.de (Juergen Hermann) Date: Wed Sep 4 10:45:03 2002 Subject: [Moin-devel] Simple patch for attach file over SSL In-Reply-To: <20020904120726.GA2476@ns.sanori.net> Message-ID: On Wed, 4 Sep 2002 21:07:26 +0900, Joo-won Jung wrote: >+ os.environ.get('HTTPS', '') != '' or \ I think "HTTPS" can hold the values "on" and "off", can you check (e.g. using the "?test" url) that it is "on" when SSL is active so we can provide a tighter condition. Ciao, J?rgen From sanori at sanori.net Wed Sep 4 11:26:06 2002 From: sanori at sanori.net (Joo-won Jung) Date: Wed Sep 4 11:26:06 2002 Subject: [Moin-devel] Simple patch for attach file over SSL In-Reply-To: References: <20020904120726.GA2476@ns.sanori.net> Message-ID: <20020904182453.GA3557@ns.sanori.net> On Wed, Sep 04, 2002 at 07:45:18PM +0200, Juergen Hermann wrote: > On Wed, 4 Sep 2002 21:07:26 +0900, Joo-won Jung wrote: > > >+ os.environ.get('HTTPS', '') != '' or \ > > I think "HTTPS" can hold the values "on" and "off", can you check (e.g. > using the "?test" url) that it is "on" when SSL is active so we can > provide a tighter condition. Yes, you are right. 'HTTPS=on' is given when it is connected over SSL. (But HTTPS variable is not provided to CGI when normal HTTP connection. So, I ignored it.) Therefore, + os.environ.get('HTTPS', '') == 'on' or \ may check tighter condition. I changed the code as above, tested MoinMoin over both HTTPS and HTTP and found that it works correctly on TWikiDraw pictures. Hope this helps. -Sanori From tbird20d at yahoo.com Fri Sep 6 12:44:04 2002 From: tbird20d at yahoo.com (Tim Bird) Date: Fri Sep 6 12:44:04 2002 Subject: [Moin-devel] OrphanedPages.py with count argument Message-ID: <20020906194311.25144.qmail@web20802.mail.yahoo.com> Please find attached a patch which adds support to the OrphanedPages macro for a 'count' argument. This allows you to use the macro like this: [[OrphanedPages(count)]] To just get the count of orphaned pages, rather than the list. I am making mods like this to a few of the page-listing macros, in order to build a suite of macros usable for a "general wiki health" page. The use of english in my output is probably not good. If you want to just cut the returned string down to a number, that's fine with me. Regards, __________________________________________________ Do You Yahoo!? Yahoo! Finance - Get real-time stock quotes http://finance.yahoo.com -------------- next part -------------- A non-text attachment was scrubbed... Name: OrphanedPages.py.patch Type: application/x-patch Size: 1569 bytes Desc: OrphanedPages.py.patch URL: From tbird20d at yahoo.com Fri Sep 6 12:48:02 2002 From: tbird20d at yahoo.com (Tim Bird) Date: Fri Sep 6 12:48:02 2002 Subject: [Moin-devel] more OrphanedPages changes Message-ID: <20020906194708.26627.qmail@web20802.mail.yahoo.com> Oops. I forgot to mention on that last patch, I also remove Template pages from the orphan list. In general a template page will not have any other pages pointing to it, but it's not really an orphan in the regular sense, since it is dynamically referenced by the createpage page. This just unclutters up the list a bit and makes it more accurate with regards to pages that an administrator might be concerned about. Regards, Tim Bird __________________________________________________ Do You Yahoo!? Yahoo! Finance - Get real-time stock quotes http://finance.yahoo.com From pacu at sympatico.ca Tue Sep 10 19:39:02 2002 From: pacu at sympatico.ca (Zutroi Zatatakowski) Date: Tue Sep 10 19:39:02 2002 Subject: [Moin-devel] French Translation - Traduction Message-ID: <20020911023846.UNDL4068.tomts12-srv.bellnexxia.net@there> Hi, Just installed MoinMoin on my Linux Mandrake 8.2 box and it's running well. As soon as I get a second computer to act as a server, I'll put my wiki on the net. It will be focusing on Cinema in general and I'm gonna do it in French. So, right now I'm working & testing locally and translating all the stuff I can find. If I get to finish that translation work, it would be cool if I could make a bundle of all the French files in order to save time for the next one who wants to use MoinMoin in French. I might do it, if I don't start working on another project meanwhile (thanks, shortspan attention.) It's far from complete, and it's far from perfect (grammatically speaking) but let's hope I can do something good! ---- Pour les Francophones Je suis en train de monter un wiki MoinMoin sur le Cinema et je suis en plein travail de traduction de tout ce que je peux trouver. Je ne repeterai pas tout ce que j'ai deja dis, puisque vous devez pouvoir lire l'Anglais si vous etes ici. Pour resumer, quand j'aurai termine, eventuellement, je vais faire une version disponible ou tous les fichiers de depart seront en Francais. Later, a plus -- Manuel F. Lanctot Sometimes you're the bug and sometimes you're the windshield. From festifn at rupert.informatik.uni-stuttgart.de Thu Sep 12 11:29:05 2002 From: festifn at rupert.informatik.uni-stuttgart.de (Florian Festi) Date: Thu Sep 12 11:29:05 2002 Subject: [Moin-devel] page_name in parser Message-ID: Hi! I am trying to write a LinuxDoc SGML -> HTML parser which uses sgml2html. This is intended for puting howto sources into a wiki. To get the links to the subpages correct I would need to know the page_name within the parser, but I haven't found who to get it without changing the core code. Any ideas? thanks Florian Festi From wkpark at chem.skku.ac.kr Thu Sep 12 21:23:23 2002 From: wkpark at chem.skku.ac.kr (Won Kyu Park) Date: Thu Sep 12 21:23:23 2002 Subject: [Moin-devel] page_name in parser In-Reply-To: References: Message-ID: <20020913015923.GA5764@chem.skku.ac.kr> On Thu, Sep 12, 2002 at 08:28:47PM +0200, Florian Festi wrote: > Hi! > > I am trying to write a LinuxDoc SGML -> HTML parser which uses sgml2html. > This is intended for puting howto sources into a wiki. > To get the links to the subpages correct I would need to know the > page_name within the parser, but I haven't found who to get it > without changing the core code. Any ideas? > did you mean as formatter.page.page_name ? I have also a quick hacked but functional parser to use man2html It maybe useful to you. Regards, Won kyu Park -------------- next part -------------- """ MoinMoin - MAN Parser Copyright (c) 2002 by Won-kyu Park All rights reserved, see COPYING for details. """ import sys,cStringIO,os from MoinMoin import wikiutil from MoinMoin import caching from MoinMoin.i18n import _ class Parser: """ Send MAN page as HTML and caching it """ def __init__(self, raw, request, **kw): self.man = raw self.request = request def format(self, formatter): """ Send the "parsed" text. """ import popen2,string,re arena = "man" key = wikiutil.quoteFilename(formatter.page.page_name) cache = caching.CacheEntry(arena, key) if not cache.needsUpdate(formatter.page._text_filename()): html= cache.content() # html=re.sub(r'Content-type: text/html','',html) print re.sub(r'||||||.*','',html) self._add_refresh(formatter, cache, arena, key) return # cmd = '/usr/bin/man2html' cmd = 'nroff -man |../bin/man2html -topm 4 -botm 6' try: fromchild, tochild = popen2.popen4(cmd) tochild.write(self.man) tochild.flush() tochild.close() fromchild.flush() html = fromchild.read() finally: fromchild.close() html=re.sub(r'Content-type: text/html','',html) print re.sub(r'||||||.*','',html) # print re.sub(r'||||||.*','',html) cache.update(html) self._add_refresh(formatter, cache, arena, key) def _add_refresh(self, formatter, cache, arena, key): refresh = wikiutil.link_tag( wikiutil.quoteWikiname(formatter.page.page_name) + "?action=refresh&arena=%s&key=%s" % (arena, key), _("RefreshCache")) + _(' for this page (cached %(date)s)') % { 'date': formatter.request.user.getFormattedDateTime(cache.mtime()),} + '
' self.request.add2footer('RefreshCache', refresh) From wkpark at chem.skku.ac.kr Sun Sep 15 09:02:02 2002 From: wkpark at chem.skku.ac.kr (Won Kyu Park) Date: Sun Sep 15 09:02:02 2002 Subject: [Moin-devel] WikiName Message-ID: <20020915162452.GA21649@chem.skku.ac.kr> WikiPedia does not use the *automagical* link stuff the link syntax procedure of the WikiPedia: 1. First letter of target is automatically capitalized 2. Spaces are converted into underscores. It use linkage syntax as [[new page]] [[particle in a box]] and that links to 'New_page' 'Particle_in_a_box' I propose a new extended syntax as following procedure: 1. use with single bracket contains [A-Za-z0-9] and single space re_syntax: '\[(/?[A-Za-z0-9] ?)+\]' ex) [new page] [I love you] [a small box] 2. render as is, link to *capitalized wikiname* wiki link renderd link to [new page] new page NewPage [particle in a box] particle in a box ParticleInAaBox (See Wiki:DoubleCharacterLinkPattern) this is a test page for it http://chem.skku.ac.kr/~kle/moin/NewExtendedName this new syntax mechanism also very useful for CJK users (It is so troublesome for me to typeset as ["foobar foobar bra bra"]) any comments are welcome Regards, Won-kyu Park From pacu at sympatico.ca Sun Sep 15 18:04:02 2002 From: pacu at sympatico.ca (Zutroi Zatatakowski) Date: Sun Sep 15 18:04:02 2002 Subject: [Moin-devel] WikiName In-Reply-To: <20020915162452.GA21649@chem.skku.ac.kr> References: <20020915162452.GA21649@chem.skku.ac.kr> Message-ID: <20020916010331.PUFL21425.tomts26-srv.bellnexxia.net@there> On Sunday 15 September 2002 12:24 pm, you wrote: > WikiPedia does not use the *automagical* link stuff > I propose a new extended syntax as following procedure: > > 1. use with single bracket contains [A-Za-z0-9] and single space > re_syntax: '\[(/?[A-Za-z0-9] ?)+\]' > ex) [new page] [I love you] [a small box] > 2. render as is, link to *capitalized wikiname* > > wiki link renderd link to > [new page] new page NewPage > [particle in a box] particle in a box ParticleInAaBox (See > any comments are welcome > > Regards, > > Won-kyu Park I must say I like this syntax since it reminds me of Everything2. E2 has some similarities with a wiki: any registered user can create a new page, or add content to an already-existing page, though he can only edit the text he wrote himself, nothing else. The syntax there for internal links is the bracket, i.e. [Douglas Adams] will bring up the Douglas Adams page (called node), which contains many writeups by different users. But, wait 'till I finish putting on my asbestos jacket, E2 is 100% Perl. Anyway, I find that system efficient and simple enough. It's easier to link a single word, or including spaces, etc. I'll sure look forward to it. Links: Everything2 - http://everything2.com The Everything Engine (for developpers): http://www.everydevel.com -- Manuel F. Lanctot From sanori at sanori.net Tue Sep 17 06:45:04 2002 From: sanori at sanori.net (Joo-won Jung) Date: Tue Sep 17 06:45:04 2002 Subject: [Moin-devel] Fix(?) for httpdmain.py to work Message-ID: <20020917134437.GA19169@ns.sanori.net> Hello, The attached patch is the simple fix that httpdmain.py of current CVS gives pages to browser. This patch may help the MoinMoin working on mod_python with CGI mode and PyApache. (In fact, some more fixes are needed for MoinMoin to work on mod_python. It is explained on http://www.sanori.net/wiki/moin.py/MoinMoinOnModPython though it has some old information.) The reason that httpdmain.py gives pages to (real) stdout, not to browser, is that webapi.(cgiMoin.)http_headers() enforces sys.stdout to be sys.__stdout__. It does not matter when the MoinMoin runs as real CGI. But it does matter when MoinMoin run with httpdmain.py, on mod_python and on PyApache since they redirect sys.stdout to socket stream by 'sys.stdout = self.wfile'. I don't know why the author, Ju"gen Hermann, added StdoutGuard and I have no confidence that my patch reflect the author's idea. But it works correctly as far as I tested. I tested httpdmain.py on Windows XP and tested it on mod_python CGI mode on Linux. I did not tested it on PyApache. Hope this helps, -Sanori -------------- next part -------------- ? httpd.patch Index: cgimain.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/cgimain.py,v retrieving revision 1.60 diff -c -r1.60 cgimain.py *** cgimain.py 2 Aug 2002 16:45:49 -0000 1.60 --- cgimain.py 17 Sep 2002 12:26:21 -0000 *************** *** 67,73 **** # install stdout guard if available if hasattr(webapi, 'StdoutGuard'): ! sys.stdout = webapi.StdoutGuard(request) # sys.stderr.write("----\n") # for key in os.environ.keys(): --- 67,73 ---- # install stdout guard if available if hasattr(webapi, 'StdoutGuard'): ! sys.stdout = webapi.StdoutGuard(request, sys.stdout) # sys.stderr.write("----\n") # for key in os.environ.keys(): Index: webapi/cgiMoin.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/webapi/cgiMoin.py,v retrieving revision 1.17 diff -c -r1.17 cgiMoin.py *** webapi/cgiMoin.py 4 Sep 2002 18:33:56 -0000 1.17 --- webapi/cgiMoin.py 17 Sep 2002 12:26:22 -0000 *************** *** 87,101 **** sys.stdout. """ ! def __init__(self, request): self.request = request def __getattr__(self, attr): # send headers, then raise an exception to create a stack trace ! sys.stdout = sys.__stdout__ ! http_headers(self.request) ! raise RuntimeError("Premature access to sys.stdout.%s" % attr) ! def setHttpHeader(request, header): request.user_headers.append(header) --- 87,102 ---- sys.stdout. """ ! def __init__(self, request, stdout): self.request = request + self.saved_stdout = stdout def __getattr__(self, attr): # send headers, then raise an exception to create a stack trace ! if attr != 'saved_stdout': ! sys.stdout = sys.__stdout__ ! http_headers(self.request) ! raise RuntimeError("Premature access to sys.stdout.%s" % attr) def setHttpHeader(request, header): request.user_headers.append(header) *************** *** 111,117 **** have_ct = 0 # deactivate guard ! sys.stdout = sys.__stdout__ # send http headers for header in more_headers: --- 112,119 ---- have_ct = 0 # deactivate guard ! if hasattr(sys.stdout, 'saved_stdout'): ! sys.stdout = sys.stdout.saved_stdout # send http headers for header in more_headers: