From jhermann at users.sourceforge.net Thu May 2 12:14:38 2002 From: jhermann at users.sourceforge.net (J?rgen Hermann) Date: Thu May 2 12:14:38 2002 Subject: [Moin-devel] CVS: MoinMoin/i18n de.py,1.77,1.78 Message-ID: Update of /cvsroot/moin/MoinMoin/i18n In directory usw-pr-cvs1:/tmp/cvs-serv29927/i18n Modified Files: de.py Log Message: Report an error code returned by "diff" Index: de.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/i18n/de.py,v retrieving revision 1.77 retrieving revision 1.78 diff -C2 -r1.77 -r1.78 *** de.py 26 Mar 2002 19:14:31 -0000 1.77 --- de.py 2 May 2002 19:13:07 -0000 1.78 *************** *** 634,637 **** --- 634,640 ---- 'Der Inhalt der letzten Sicherungskopie ist veraltet und wird von der Volltextsuche ignoriert!', + 'The external diff utility returned with error code %(rc)s!': + 'Das externe Hilfsprogramm "diff" lieferte den Fehlercode %(rc)s!', + 'The following %(badwords)d words could not be found in the dictionary of %(totalwords)d words%(localwords)s and are highlighted below:': 'Die nachfolgenden %(badwords)d Worte konnten nicht im W?rterbuch mit %(totalwords)d Worten%(localwords)s gefunden werden und sind im Text hervorgehoben:', From jhermann at users.sourceforge.net Thu May 2 12:14:39 2002 From: jhermann at users.sourceforge.net (J?rgen Hermann) Date: Thu May 2 12:14:39 2002 Subject: [Moin-devel] CVS: MoinMoin PageEditor.py,1.8,1.9 wikiaction.py,1.72,1.73 wikiutil.py,1.96,1.97 Message-ID: Update of /cvsroot/moin/MoinMoin In directory usw-pr-cvs1:/tmp/cvs-serv29927 Modified Files: PageEditor.py wikiaction.py wikiutil.py Log Message: Report an error code returned by "diff" Index: PageEditor.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/PageEditor.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** PageEditor.py 25 Apr 2002 19:32:30 -0000 1.8 --- PageEditor.py 2 May 2002 19:13:07 -0000 1.9 *************** *** 270,274 **** "No older revisions of the page stored, diff not available." else: ! page_file, backup_file, lines = wikiutil.pagediff(self.page_name, oldversions[0]) if lines and len(lines) > 2: mailBody = "%s%s\n%s" % ( --- 270,274 ---- "No older revisions of the page stored, diff not available." else: ! rc, page_file, backup_file, lines = wikiutil.pagediff(self.page_name, oldversions[0]) if lines and len(lines) > 2: mailBody = "%s%s\n%s" % ( *************** *** 276,279 **** --- 276,282 ---- else: mailBody = mailBody + "No differences found!\n" + if rc: + mailBody = mailBody + '\n\n' + \ + _('The external diff utility returned with error code %(rc)s!') % locals() msg = _('\n' Index: wikiaction.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/wikiaction.py,v retrieving revision 1.72 retrieving revision 1.73 diff -C2 -r1.72 -r1.73 *** wikiaction.py 24 Apr 2002 20:11:21 -0000 1.72 --- wikiaction.py 2 May 2002 19:13:07 -0000 1.73 *************** *** 193,197 **** oldpage = oldversions[0] ! page_file, backup_file, lines = wikiutil.pagediff(pagename, oldpage, ignorews=ignorews) # check for valid diff --- 193,197 ---- oldpage = oldversions[0] ! rc, page_file, backup_file, lines = wikiutil.pagediff(pagename, oldpage, ignorews=ignorews) # check for valid diff *************** *** 202,205 **** --- 202,207 ---- 'count': edit_count, 'times': (_(' time'), _(' times'))[edit_count != 1]} + if rc: + msg = msg + '

' + _('The external diff utility returned with error code %(rc)s!') % locals() Page(pagename).send_page(request, msg=msg) return Index: wikiutil.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/wikiutil.py,v retrieving revision 1.96 retrieving revision 1.97 diff -C2 -r1.96 -r1.97 *** wikiutil.py 24 Apr 2002 20:11:21 -0000 1.96 --- wikiutil.py 2 May 2002 19:13:07 -0000 1.97 *************** *** 454,458 **** ##print "rc =", rc, "
" ! return page_file, backup_file, lines --- 454,458 ---- ##print "rc =", rc, "
" ! return rc, page_file, backup_file, lines From jhermann at users.sourceforge.net Thu May 2 12:14:39 2002 From: jhermann at users.sourceforge.net (J?rgen Hermann) Date: Thu May 2 12:14:39 2002 Subject: [Moin-devel] CVS: MoinMoin/macro RecentChanges.py,1.58,1.59 Message-ID: Update of /cvsroot/moin/MoinMoin/macro In directory usw-pr-cvs1:/tmp/cvs-serv29927/macro Modified Files: RecentChanges.py Log Message: Report an error code returned by "diff" Index: RecentChanges.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/macro/RecentChanges.py,v retrieving revision 1.58 retrieving revision 1.59 diff -C2 -r1.58 -r1.59 *** RecentChanges.py 24 Apr 2002 20:11:21 -0000 1.58 --- RecentChanges.py 2 May 2002 19:13:07 -0000 1.59 *************** *** 394,398 **** if date <= item.ed_time: if idx+1 < len(oldversions): ! page_file, backup_file, lines = wikiutil.pagediff(item.pagename, oldversions[idx+1], ignorews=1) if len(lines) > 20: lines = lines[20:] + ['...\n'] desc_text = desc_text + '

\n' + string.join(lines, '') + '
' --- 394,398 ---- if date <= item.ed_time: if idx+1 < len(oldversions): ! rc, page_file, backup_file, lines = wikiutil.pagediff(item.pagename, oldversions[idx+1], ignorews=1) if len(lines) > 20: lines = lines[20:] + ['...\n'] desc_text = desc_text + '
\n' + string.join(lines, '') + '
' From nbastin at mac.com Sun May 5 12:47:06 2002 From: nbastin at mac.com (Nicholas Bastin) Date: Sun May 5 12:47:06 2002 Subject: [Moin-devel] Modification to wiki.py Message-ID: I've made modifications to parser/wiki.py to support arbitrary syntax highlighting (any string after "#!" causes the code to attempt an import of a module of the same name). For example, now if you added a c.py to MoinMoin/parser, entering the string #!c after {{{ would cause the c parser to be used. This allows developers to add new colorizers by just dropping in a new module, and not having to modify core wiki code. Anyhow, kind of wondering where to send the patch? I'm also working on a c syntax module. -- Nick Bastin From nbastin at mac.com Mon May 6 06:35:06 2002 From: nbastin at mac.com (Nicholas Bastin) Date: Mon May 6 06:35:06 2002 Subject: [Moin-devel] Modification to wiki.py In-Reply-To: <15574.17042.423976.68929@paci.nautilus> Message-ID: On Monday, May 6, 2002, at 04:45 AM, Lele Gaifax wrote: > NB> Anyhow, kind of wondering where to send the patch? I'm also > NB> working on a c syntax module. > > I guess that here is a good place, where surely JH will be able to > fish your code and install in the mainstream sources. > Ok. I'm attaching standard diff -c output here...if that isn't sufficient, let me know. I'm coming off the 0.11 source tree, an dI noticed yesterday that there was a 0.12 download, so hopefully I'm not too out of date. -- Nick -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: diff.txt URL: From nbastin at mac.com Mon May 6 06:43:04 2002 From: nbastin at mac.com (Nicholas Bastin) Date: Mon May 6 06:43:04 2002 Subject: [Moin-devel] Diff of wiki.py....again... Message-ID: <20951F48-60F7-11D6-8D61-0003938052F8@mac.com> Ok, I suppose it would help if I removed all of my debugging info first... Here's the new diff. -- Nick -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: diff.txt URL: From lele at seldati.it Mon May 6 06:46:04 2002 From: lele at seldati.it (Lele Gaifax) Date: Mon May 6 06:46:04 2002 Subject: [Moin-devel] Modification to wiki.py In-Reply-To: References: <15574.17042.423976.68929@paci.nautilus> Message-ID: <15574.35044.384401.149264@paci.nautilus> --- 777,799 ---- if endpos == -1: self.colorize_lines.append(line) continue + f = open('/tmp/foo', 'w+') + f.writelines(self.colorize_lines) This seems as some test code was left there. bye&thanx, 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 Mon May 6 12:30:05 2002 From: jh at web.de (Juergen Hermann) Date: Mon May 6 12:30:05 2002 Subject: [Moin-devel] Modification to wiki.py In-Reply-To: Message-ID: On Sun, 5 May 2002 15:46:29 -0400, Nicholas Bastin wrote: >I've made modifications to parser/wiki.py to support arbitrary syntax >highlighting (any string after "#!" causes the code to attempt an import >of a module of the same name). For example, now if you added a c.py to >MoinMoin/parser, entering the string #!c after {{{ would cause the c >parser to be used. This allows developers to add new colorizers by just >dropping in a new module, and not having to modify core wiki code. The use of exec makes the patch a security hole. Also, this is already possible via 0.12's "processor" semantics, i.e. you can already say "{{{#! Colorize C" (though the "C" is not recognized yet, but the means to plugin a colorizer is there). A C colorizer would be great, a general one, i.e. one that works on keyword tables or something, even better. If "enscript" were available for Windows, that would be a nice option. Ciao, J?rgen From nbastin at mac.com Mon May 6 22:20:04 2002 From: nbastin at mac.com (Nicholas Bastin) Date: Mon May 6 22:20:04 2002 Subject: [Moin-devel] Modification to wiki.py In-Reply-To: Message-ID: On Monday, May 6, 2002, at 03:29 PM, Juergen Hermann wrote: > On Sun, 5 May 2002 15:46:29 -0400, Nicholas Bastin wrote: > >> I've made modifications to parser/wiki.py to support arbitrary syntax >> highlighting (any string after "#!" causes the code to attempt an >> import >> of a module of the same name). For example, now if you added a c.py to >> MoinMoin/parser, entering the string #!c after {{{ would cause the c >> parser to be used. This allows developers to add new colorizers by >> just >> dropping in a new module, and not having to modify core wiki code. > > The use of exec makes the patch a security hole. Also, this is already > possible via 0.12's "processor" semantics, i.e. you can already > say "{{{#! > Colorize C" (though the "C" is not recognized yet, but the means to > plugin > a colorizer is there). > Ok, as I said, I don't have 0.12, so didn't see that. I tried to avoid the use of exec via the use of __import__ and getattr, but to no avail. __import__ works fine to replicate the generic 'import ... as ...' behaviour, but 'from' seems like it isn't emulated correctly, or at least I couldn't figure it out. > A C colorizer would be great, a general one, i.e. one that works on > keyword > tables or something, even better. If "enscript" were available for > Windows, > that would be a nice option. I use shlex to turn the keywords into tokens, and colorize based upon an array of token,color tuples, much like the current python colorizer. It's not an optimal solution, but it works. -- Nick From jh at web.de Tue May 7 09:50:04 2002 From: jh at web.de (Juergen Hermann) Date: Tue May 7 09:50:04 2002 Subject: [Moin-devel] Modification to wiki.py In-Reply-To: Message-ID: On Tue, 7 May 2002 01:19:24 -0400, Nicholas Bastin wrote: >I use shlex to turn the keywords into tokens, and colorize based upon an >array of token,color tuples, much like the current python colorizer. >It's not an optimal solution, but it works. If you agree, I'd like you to add two things: 1. We already talked about having different sets of such language profiles ==> make the current list of token/colors a dict of such list, with the dict key being the language ID. 2. Add a probe mode, so that when the language is NOT explicitely stated, we look at the provided source, and try to find the language definition that has the most "hits" on the defined tokens. If that was too short a description, I can elaborate. For testing, you could add HTML definitions, so we'd have hilighted HTML and C for a start. BTW, the best interface for such a colorizer module is taking a list of source lines, and emitting the resulting HTML to a provided stream. Ciao, J?rgen From jhermann at users.sourceforge.net Tue May 7 10:06:03 2002 From: jhermann at users.sourceforge.net (J?rgen Hermann) Date: Tue May 7 10:06:03 2002 Subject: [Moin-devel] CVS: MoinMoin PageEditor.py,1.9,1.10 Message-ID: Update of /cvsroot/moin/MoinMoin In directory usw-pr-cvs1:/tmp/cvs-serv32198/MoinMoin Modified Files: PageEditor.py Log Message: DeletePage offers a textentry field for an optional comment; Email notifications are sent in the user's language, if known from the preferences (adapted from a patch by Lel?) Index: PageEditor.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/PageEditor.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -r1.9 -r1.10 *** PageEditor.py 2 May 2002 19:13:07 -0000 1.9 --- PageEditor.py 7 May 2002 17:05:22 -0000 1.10 *************** *** 12,16 **** from MoinMoin import caching, config, user, util, wikiutil, webapi from MoinMoin.Page import Page ! from MoinMoin.i18n import _ --- 12,16 ---- from MoinMoin import caching, config, user, util, wikiutil, webapi from MoinMoin.Page import Page ! from MoinMoin.i18n import _, getText *************** *** 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 --- 201,209 ---- ! def deletePage(self, request, comment=None): """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', comment=comment or '') # Then really delete it *************** *** 221,224 **** --- 221,267 ---- + def _sendNotification(self, request, comment, emails, email_lang, oldversions): + """ Send notification email for a single language. + + Returns sendmail result. + """ + _ = lambda s, l=email_lang: getText(s, lang=l) + + mailBody = _("Dear Wiki user,\n\n" + 'You have subscribed to a wiki page or wiki category on "%(sitename)s" for change notification.\n\n' + "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(), + } + + if comment: + mailBody = mailBody + \ + _("The comment on the change is:\n%(comment)s\n\n") % locals() + + # append a diff + if not oldversions: + mailBody = mailBody + \ + _("No older revisions of the page stored, diff not available.") + else: + rc, page_file, backup_file, lines = wikiutil.pagediff(self.page_name, oldversions[0]) + if lines and len(lines) > 2: + mailBody = "%s%s\n%s" % ( + mailBody, ("-" * 78), string.join(lines[2:], '')) + else: + mailBody = mailBody + _("No differences found!\n") + if rc: + mailBody = mailBody + '\n\n' + \ + _('The external diff utility returned with error code %(rc)s!') % locals() + + return util.sendmail(emails, + _('[%(sitename)s] Update of "%(pagename)s"') % { + 'sitename': config.sitename or "Wiki", + 'pagename': self.page_name, + }, + mailBody, mail_from=request.user.email) + + def _notifySubscribers(self, request, comment): """ Send email to all subscribers of this page. *************** *** 237,241 **** # the user is not the current editor userlist = user.getUserList() ! emails = [] for uid in userlist: if uid == request.user.id: continue # no self notification --- 280,284 ---- # the user is not the current editor userlist = user.getUserList() ! emails = {} for uid in userlist: if uid == request.user.id: continue # no self notification *************** *** 243,293 **** if not subscriber.email: continue # skip empty email address ! if subscriber.isSubscribedTo(pageList): ! emails.append(subscriber.email) if emails: - # send email to all subscribers; note that text must be in - # English for all users, since currently we cannot (easily) - # send the text in the recipient's language. - # !!! TODO: make this possible - mailBody = ("Dear Wiki user,\n\n" - 'You have subscribed to a wiki page or wiki category on "%(sitename)s" for change notification.\n\n' - "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(), - } - - if comment: - mailBody = mailBody + \ - "The comment on the change is:\n%s\n\n" % comment - # get a list of old revisions, and append a diff oldversions = wikiutil.getBackupList(config.backup_dir, self.page_name) ! if not oldversions: ! mailBody = mailBody + \ ! "No older revisions of the page stored, diff not available." ! else: ! rc, page_file, backup_file, lines = wikiutil.pagediff(self.page_name, oldversions[0]) ! if lines and len(lines) > 2: ! mailBody = "%s%s\n%s" % ( ! mailBody, ("-" * 78), string.join(lines[2:], '')) ! else: ! mailBody = mailBody + "No differences found!\n" ! if rc: ! mailBody = mailBody + '\n\n' + \ ! _('The external diff utility returned with error code %(rc)s!') % locals() ! ! msg = _('\n' ! 'Sent a mail notification to these addresses: %s\n' ! '
Result was: ') % string.join(emails, ", ") ! msg = msg + util.sendmail(emails, ! '[%(sitename)s] Update of "%(pagename)s"' % { ! 'sitename': config.sitename or "Wiki", ! 'pagename': self.page_name, ! }, ! mailBody, mail_from=request.user.email) ! return msg return _('Nobody subscribed to this page, no mail sent.') --- 286,306 ---- if not subscriber.email: continue # skip empty email address ! if subscriber.isSubscribedTo(pageList): ! lang = subscriber.language or 'en' ! if not emails.has_key(lang): emails[lang] = [] ! emails[lang].append(subscriber.email) if emails: # get a list of old revisions, and append a diff oldversions = wikiutil.getBackupList(config.backup_dir, self.page_name) ! ! # send email to all subscribers ! results = [_('Status of sending notification mails:')] ! for lang in emails.keys(): ! status = self._sendNotification(request, comment, emails[lang], lang, oldversions) ! recipients = string.join(emails[lang], ", ") ! results.append(_('[%(lang)s] %(recipients)s: %(status)s') % locals()) ! ! return string.join(results, '
') return _('Nobody subscribed to this page, no mail sent.') From jhermann at users.sourceforge.net Tue May 7 10:06:04 2002 From: jhermann at users.sourceforge.net (J?rgen Hermann) Date: Tue May 7 10:06:04 2002 Subject: [Moin-devel] CVS: dist CHANGES,1.86,1.87 Message-ID: Update of /cvsroot/moin/dist In directory usw-pr-cvs1:/tmp/cvs-serv32198 Modified Files: CHANGES Log Message: DeletePage offers a textentry field for an optional comment; Email notifications are sent in the user's language, if known from the preferences (adapted from a patch by Lel?) Index: CHANGES =================================================================== RCS file: /cvsroot/moin/dist/CHANGES,v retrieving revision 1.86 retrieving revision 1.87 diff -C2 -r1.86 -r1.87 *** CHANGES 20 Mar 2002 23:57:06 -0000 1.86 --- CHANGES 7 May 2002 17:05:22 -0000 1.87 *************** *** 23,26 **** --- 23,29 ---- * New icons: "(OK)" and "(./)" (see HelpOnSmileys) * FullSearch now displays context information for search hits + * DeletePage offers a textentry field for an optional comment + * Email notifications are sent in the user's language, if known from + the preferences Bugfixes: From jhermann at users.sourceforge.net Tue May 7 10:06:04 2002 From: jhermann at users.sourceforge.net (J?rgen Hermann) Date: Tue May 7 10:06:04 2002 Subject: [Moin-devel] CVS: MoinMoin/action DeletePage.py,1.14,1.15 Message-ID: Update of /cvsroot/moin/MoinMoin/action In directory usw-pr-cvs1:/tmp/cvs-serv32198/MoinMoin/action Modified Files: DeletePage.py Log Message: DeletePage offers a textentry field for an optional comment; Email notifications are sent in the user's language, if known from the preferences (adapted from a patch by Lel?) Index: DeletePage.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/action/DeletePage.py,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -r1.14 -r1.15 *** DeletePage.py 24 Apr 2002 20:11:21 -0000 1.14 --- DeletePage.py 7 May 2002 17:05:22 -0000 1.15 *************** *** 47,51 **** # Delete the page ! page.deletePage(request) # Redirect to RecentChanges --- 47,51 ---- # Delete the page ! page.deletePage(request, request.form.getvalue('comment')) # Redirect to RecentChanges *************** *** 59,62 **** --- 59,63 ---- querytext = _('Really delete this page?') button = _(' Delete ') + comment_label = _("Optional reason for the deletion") formhtml = """
*************** *** 65,68 **** --- 66,72 ---- +

+ %(comment_label)s
+

""" % locals() From jhermann at users.sourceforge.net Tue May 7 10:06:04 2002 From: jhermann at users.sourceforge.net (J?rgen Hermann) Date: Tue May 7 10:06:04 2002 Subject: [Moin-devel] CVS: MoinMoin/i18n de.py,1.78,1.79 Message-ID: Update of /cvsroot/moin/MoinMoin/i18n In directory usw-pr-cvs1:/tmp/cvs-serv32198/MoinMoin/i18n Modified Files: de.py Log Message: DeletePage offers a textentry field for an optional comment; Email notifications are sent in the user's language, if known from the preferences (adapted from a patch by Lel?) Index: de.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/i18n/de.py,v retrieving revision 1.78 retrieving revision 1.79 diff -C2 -r1.78 -r1.79 *** de.py 2 May 2002 19:13:07 -0000 1.78 --- de.py 7 May 2002 17:05:22 -0000 1.79 *************** *** 16,26 **** ''', - ''' - Sent a mail notification to these addresses: %s -
Result was: ''': - ''' - Eine ?nderungsnachricht wurde an die folgenden Adressen versandt: %s -
Das Ergebnis war: ''', - ' (including %(localwords)d %(pagelink)s)': ' (inklusive %(localwords)d %(pagelink)s)', --- 16,19 ---- *************** *** 268,271 **** --- 261,267 ---- '[gehe zu %s]', + '': + '', + 'Action': 'Aktion', *************** *** 322,325 **** --- 318,324 ---- 'Kommentar', + "Connection to mailserver '%(server)s' failed: %(reason)s": + "Verbindung zum Emailserver '%(server)s' gest?rt: %(reason)s", + 'Create new drawing "%(filename)s"': 'Neue Zeichnung "%(filename)s" anlegen', *************** *** 334,337 **** --- 333,353 ---- 'Datumsformat', + '''Dear Wiki user, + + You have subscribed to a wiki page or wiki category on "%(sitename)s" for change notification. + + The following page has been changed by %(editor)s: + %(pagelink)s + + ''': + '''Sehr geehrter Wikibenutzer, + + Sie haben die ?nderungen einer Wikiseite oder Kategorie von "%(sitename)s" abonniert. + + Die folgende Seite wurde durch %(editor)s ver?ndert: + %(pagelink)s + + ''', + 'Default': 'Standardeinstellung', *************** *** 484,487 **** --- 500,511 ---- 'Es wurden keine Anh?nge f?r die Seite %(pagename)s gespeichert.', + '''No differences found! + ''': + '''Es wurden keine ?nderungen gefunden! + ''', + + 'No older revisions of the page stored, diff not available.': + 'Es sind keine ?lteren Versionen dieser Seite verf?gbar, deswegen konnte kein Vergleich durchgef?hrt werden.', + 'No orphaned pages in this wiki.': 'Es existieren keine verwaisten Seiten in diesem Wiki.', *************** *** 508,511 **** --- 532,538 ---- 'Optionaler Kommentar zu dieser ?nderung', + 'Optional reason for the deletion': + 'Optionale Begr?ndung f?r die L?schung', + 'Or try one of these actions: ': 'Oder benutze eine dieser Aktionen: ', *************** *** 622,625 **** --- 649,655 ---- 'Zur Vorschau springen', + 'Status of sending notification mails:': + 'Status des Versands der ?nderungsnachrichten:', + 'Submitted form data:': 'Gesendete Formulardaten:', *************** *** 634,637 **** --- 664,676 ---- 'Der Inhalt der letzten Sicherungskopie ist veraltet und wird von der Volltextsuche ignoriert!', + '''The comment on the change is: + %(comment)s + + ''': + '''Der Kommentar zur ?nderung ist: + %(comment)s + + ''', + 'The external diff utility returned with error code %(rc)s!': 'Das externe Hilfsprogramm "diff" lieferte den Fehlercode %(rc)s!', *************** *** 718,721 **** --- 757,766 ---- '[%(hours)dh %(mins)dm ago]': '[vor %(hours)02d:%(mins)02d]', + + '[%(lang)s] %(recipients)s: %(status)s': + '[%(lang)s] %(recipients)s: %(status)s', + + '[%(sitename)s] Update of "%(pagename)s"': + '[%(sitename)s] ?nderung von "%(pagename)s"', '[Content of new page loaded from %s]': From jhermann at users.sourceforge.net Wed May 8 18:55:02 2002 From: jhermann at users.sourceforge.net (J?rgen Hermann) Date: Wed May 8 18:55:02 2002 Subject: [Moin-devel] CVS: MoinMoin wikirpc.py,NONE,1.1 cgimain.py,1.53,1.54 Message-ID: Update of /cvsroot/moin/MoinMoin In directory usw-pr-cvs1:/tmp/cvs-serv1510/MoinMoin Modified Files: cgimain.py Added Files: wikirpc.py Log Message: XMLRPC skeleton added --- NEW FILE: wikirpc.py --- """ MoinMoin - XMLRPC Interface Copyright (c) 2002 by J?rgen Hermann All rights reserved, see COPYING for details. $Id: wikirpc.py,v 1.1 2002/05/09 01:54:40 jhermann Exp $ """ import sys from MoinMoin import webapi from MoinMoin.support import xmlrpclib def xmlrpc(request): # read request data = sys.stdin.read() #int(self.headers["content-length"])) if 0: webapi.http_headers(request, [ "Content-Type: text/plain", "Content-Length: %d" % len(data), ]) sys.stdout.write(data) return params, method = xmlrpclib.loads(data) # generate response try: response = (method, params) # wrap response in a singleton tuple response = (response,) except: # report exception back to server response = xmlrpclib.dumps( xmlrpclib.Fault(1, "%s:%s" % (sys.exc_type, sys.exc_value)) ) else: response = xmlrpclib.dumps(response, methodresponse=1) webapi.http_headers(request, [ "Content-Type: text/xml", "Content-Length: %d" % len(response), ]) sys.stdout.write(response) sys.stdout.flush() Index: cgimain.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/cgimain.py,v retrieving revision 1.53 retrieving revision 1.54 diff -C2 -r1.53 -r1.54 *** cgimain.py 24 Apr 2002 20:11:21 -0000 1.53 --- cgimain.py 9 May 2002 01:54:40 -0000 1.54 *************** *** 120,123 **** --- 120,128 ---- # sys.stderr.write(" %s = '%s'\n" % (key, os.environ[key])) + if os.environ.get('QUERY_STRING') == 'action=xmlrpc': + from MoinMoin.wikirpc import xmlrpc + xmlrpc(request) + return request + # parse request data try: From jhermann at users.sourceforge.net Wed May 8 18:55:02 2002 From: jhermann at users.sourceforge.net (J?rgen Hermann) Date: Wed May 8 18:55:02 2002 Subject: [Moin-devel] CVS: MoinMoin/processor .cvsignore,NONE,1.1 Message-ID: Update of /cvsroot/moin/MoinMoin/processor In directory usw-pr-cvs1:/tmp/cvs-serv1510/MoinMoin/processor Added Files: .cvsignore Log Message: XMLRPC skeleton added --- NEW FILE: .cvsignore --- *.pyc From jhermann at users.sourceforge.net Wed May 8 18:55:03 2002 From: jhermann at users.sourceforge.net (J?rgen Hermann) Date: Wed May 8 18:55:03 2002 Subject: [Moin-devel] CVS: MoinMoin/support xmlrpclib.py,NONE,1.1 __init__.py,1.5,1.6 Message-ID: Update of /cvsroot/moin/MoinMoin/support In directory usw-pr-cvs1:/tmp/cvs-serv1510/MoinMoin/support Modified Files: __init__.py Added Files: xmlrpclib.py Log Message: XMLRPC skeleton added --- NEW FILE: xmlrpclib.py --- # # XML-RPC CLIENT LIBRARY # $Id: xmlrpclib.py,v 1.1 2002/05/09 01:54:40 jhermann Exp $ # # an XML-RPC client interface for Python. # # the marshalling and response parser code can also be used to # implement XML-RPC servers. # # Notes: # this version is designed to work with Python 1.5.2 or newer. # unicode encoding support requires at least Python 1.6. # experimental HTTPS requires Python 2.0 built with SSL sockets. # expat parser support requires Python 2.0 with pyexpat support. # # History: # 1999-01-14 fl Created # 1999-01-15 fl Changed dateTime to use localtime # 1999-01-16 fl Added Binary/base64 element, default to RPC2 service [...977 lines suppressed...] # compatibility Server = ServerProxy # -------------------------------------------------------------------- # test code if __name__ == "__main__": # simple test program (from the XML-RPC specification) # server = ServerProxy("http://localhost:8000") # local server server = ServerProxy("http://betty.userland.com") print server try: print server.examples.getStateName(41) except Error, v: print "ERROR", v Index: __init__.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/support/__init__.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** __init__.py 17 Mar 2002 09:57:38 -0000 1.5 --- __init__.py 9 May 2002 01:54:40 -0000 1.6 *************** *** 18,22 **** difflib from the Python 2.1 distribution; see LICENSE.Python for ! licensing information applying to this module, $Id$ --- 18,26 ---- difflib from the Python 2.1 distribution; see LICENSE.Python for ! licensing information applying to this module ! ! xmlrpclib: ! from the Python 2.2 distribution; see LICENSE.Python for ! licensing information applying to this module $Id$ From jhermann at users.sourceforge.net Wed May 8 19:36:01 2002 From: jhermann at users.sourceforge.net (J?rgen Hermann) Date: Wed May 8 19:36:01 2002 Subject: [Moin-devel] CVS: MoinMoin wikirpc.py,1.1,1.2 Message-ID: Update of /cvsroot/moin/MoinMoin In directory usw-pr-cvs1:/tmp/cvs-serv10618/MoinMoin Modified Files: wikirpc.py Log Message: getAllPages() Index: wikirpc.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/wikirpc.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** wikirpc.py 9 May 2002 01:54:40 -0000 1.1 --- wikirpc.py 9 May 2002 02:35:14 -0000 1.2 *************** *** 5,19 **** All rights reserved, see COPYING for details. $Id$ """ ! import sys from MoinMoin import webapi from MoinMoin.support import xmlrpclib def xmlrpc(request): # read request ! data = sys.stdin.read() #int(self.headers["content-length"])) if 0: --- 5,32 ---- All rights reserved, see COPYING for details. + Needs Python 2.0 and up. + + See http://www.ecyrd.com/JSPWiki/Wiki.jsp?page=WikiRPCInterface + for specs on many of the functions here. + $Id$ """ ! import sys, urllib from MoinMoin import webapi from MoinMoin.support import xmlrpclib + + def do_getAllPages(): + from MoinMoin import config, webapi, wikiutil + + pagelist = wikiutil.getPageList(config.text_dir) + return [urllib.quote(unicode(pagename, config.charset).encode('UTF-8')) for pagename in pagelist] + + def xmlrpc(request): # read request ! data = sys.stdin.read() if 0: *************** *** 27,41 **** params, method = xmlrpclib.loads(data) # generate response try: ! response = (method, params) ! # wrap response in a singleton tuple ! response = (response,) except: # report exception back to server response = xmlrpclib.dumps( ! xmlrpclib.Fault(1, "%s:%s" % (sys.exc_type, sys.exc_value)) ! ) else: response = xmlrpclib.dumps(response, methodresponse=1) --- 40,63 ---- params, method = xmlrpclib.loads(data) + if 1: + sys.stderr.write('- XMLRPC ' + '-' * 70 + '\n') + sys.stderr.write('%s(%s)\n\n' % (method, repr(params))) + # generate response try: ! response = globals().get('do_' + method)(*params) except: # report exception back to server response = xmlrpclib.dumps( ! xmlrpclib.Fault(1, "%s:%s" % sys.exc_info()[:2])) else: + if 0: + sys.stderr.write('- XMLRPC ' + '-' * 70 + '\n') + sys.stderr.write(repr(response) + '\n\n') + + # wrap response in a singleton tuple + response = (response,) + + # serialize it response = xmlrpclib.dumps(response, methodresponse=1) *************** *** 45,48 **** ]) sys.stdout.write(response) ! sys.stdout.flush() --- 67,73 ---- ]) sys.stdout.write(response) ! ! if 1: ! sys.stderr.write('- XMLRPC ' + '-' * 70 + '\n') ! sys.stderr.write(response + '\n\n') From jhermann at users.sourceforge.net Wed May 8 20:04:02 2002 From: jhermann at users.sourceforge.net (J?rgen Hermann) Date: Wed May 8 20:04:02 2002 Subject: [Moin-devel] CVS: dist/tests - New directory Message-ID: Update of /cvsroot/moin/dist/tests In directory usw-pr-cvs1:/tmp/cvs-serv16820/tests Log Message: Directory /cvsroot/moin/dist/tests added to the repository From jhermann at users.sourceforge.net Wed May 8 20:06:01 2002 From: jhermann at users.sourceforge.net (J?rgen Hermann) Date: Wed May 8 20:06:01 2002 Subject: [Moin-devel] CVS: MoinMoin wikirpc.py,1.2,1.3 Message-ID: Update of /cvsroot/moin/MoinMoin In directory usw-pr-cvs1:/tmp/cvs-serv17194/MoinMoin Modified Files: wikirpc.py Log Message: XMLRPC: Version, and a test script Index: wikirpc.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/wikirpc.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** wikirpc.py 9 May 2002 02:35:14 -0000 1.2 --- wikirpc.py 9 May 2002 03:05:08 -0000 1.3 *************** *** 5,11 **** --- 5,13 ---- All rights reserved, see COPYING for details. + Parts of this code are based on Les Orchard's "xmlrpc.cgi". Needs Python 2.0 and up. See http://www.ecyrd.com/JSPWiki/Wiki.jsp?page=WikiRPCInterface + and http://www.decafbad.com/twiki/bin/view/Main/XmlRpcToWiki for specs on many of the functions here. *************** *** 13,27 **** """ ! import sys, urllib ! from MoinMoin import webapi from MoinMoin.support import xmlrpclib ! def do_getAllPages(): ! from MoinMoin import config, webapi, wikiutil pagelist = wikiutil.getPageList(config.text_dir) ! return [urllib.quote(unicode(pagename, config.charset).encode('UTF-8')) for pagename in pagelist] --- 15,66 ---- """ ! import sys, urllib ! from MoinMoin import config, webapi from MoinMoin.support import xmlrpclib ! ############################################################################# ! ### Helpers ! ############################################################################# ! ! def _instr(text): ! """ Convert inbound string from urlencoded UTF-8. ! """ ! ! def _outstr(text): ! """ Convert outbound string to urlencoded UTF-8. ! """ ! return urllib.quote(unicode(text, config.charset).encode('UTF-8')) ! ! def _dump_exc(): ! """ Convert an exception to a string ! """ ! import traceback ! ! return "%s: %s\n%s" % ( ! sys.exc_info()[0], ! sys.exc_info()[1], ! '\n'.join(traceback.format_tb(sys.exc_info()[2])), ! ) ! ! ! ############################################################################# ! ### Interface implementation ! ############################################################################# ! ! def xmlrpc_getRPCVersionSupported(): ! """ Returns 1 with this version of the Wiki API. ! """ ! return 1 ! ! def xmlrpc_getAllPages(): ! """ Returns a list of all pages. The result is an array of strings, ! again UTF-8 in URL encoding. ! """ ! from MoinMoin import wikiutil pagelist = wikiutil.getPageList(config.text_dir) ! return map(_outstr, pagelist) *************** *** 46,54 **** # generate response try: ! response = globals().get('do_' + method)(*params) except: # report exception back to server ! response = xmlrpclib.dumps( ! xmlrpclib.Fault(1, "%s:%s" % sys.exc_info()[:2])) else: if 0: --- 85,92 ---- # generate response try: ! response = globals().get('xmlrpc_' + method)(*params) except: # report exception back to server ! response = xmlrpclib.dumps(xmlrpclib.Fault(1, _dump_exc())) else: if 0: From jhermann at users.sourceforge.net Wed May 8 20:06:01 2002 From: jhermann at users.sourceforge.net (J?rgen Hermann) Date: Wed May 8 20:06:01 2002 Subject: [Moin-devel] CVS: dist/tests .cvsignore,NONE,1.1 rpctest.py,NONE,1.1 Message-ID: Update of /cvsroot/moin/dist/tests In directory usw-pr-cvs1:/tmp/cvs-serv17194/tests Added Files: .cvsignore rpctest.py Log Message: XMLRPC: Version, and a test script --- NEW FILE: .cvsignore --- *.pyc --- NEW FILE: rpctest.py --- import xmlrpclib if __name__ == "__main__": server = xmlrpclib.ServerProxy('http://127.0.0.1/cgi-bin/wiki.bat/?action=xmlrpc') print server try: print "Interface Version:", server.getRPCVersionSupported() print "Number of Pages:", len(server.getAllPages()) except xmlrpclib.Error, v: print "ERROR", v From jhermann at users.sourceforge.net Wed May 8 20:48:09 2002 From: jhermann at users.sourceforge.net (J?rgen Hermann) Date: Wed May 8 20:48:09 2002 Subject: [Moin-devel] CVS: MoinMoin wikirpc.py,1.3,1.4 Message-ID: Update of /cvsroot/moin/MoinMoin In directory usw-pr-cvs1:/tmp/cvs-serv26919/MoinMoin Modified Files: wikirpc.py Log Message: getPage(); _debug Index: wikirpc.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/wikirpc.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** wikirpc.py 9 May 2002 03:05:08 -0000 1.3 --- wikirpc.py 9 May 2002 03:47:51 -0000 1.4 *************** *** 20,23 **** --- 20,24 ---- from MoinMoin.support import xmlrpclib + _debug = 1 ############################################################################# *************** *** 28,39 **** """ Convert inbound string from urlencoded UTF-8. """ def _outstr(text): """ Convert outbound string to urlencoded UTF-8. """ ! return urllib.quote(unicode(text, config.charset).encode('UTF-8')) def _dump_exc(): ! """ Convert an exception to a string """ import traceback --- 29,54 ---- """ Convert inbound string from urlencoded UTF-8. """ + text = urllib.unquote(text) + if config.charset == 'UTF-8': + return text + else: + return unicode(text, 'UTF-8').encode(config.charset) def _outstr(text): """ Convert outbound string to urlencoded UTF-8. """ ! if config.charset != 'UTF-8': ! text = unicode(text, config.charset).encode('UTF-8') ! return urllib.quote(text) ! ! def _outlob(text): ! """ Convert outbound Large OBject to base64-encoded UTF-8. ! """ ! if config.charset != 'UTF-8': ! text = unicode(text, config.charset).encode('UTF-8') ! return xmlrpclib.Binary(text) def _dump_exc(): ! """ Convert an exception to a string. """ import traceback *************** *** 65,83 **** def xmlrpc(request): # read request data = sys.stdin.read() - if 0: - webapi.http_headers(request, [ - "Content-Type: text/plain", - "Content-Length: %d" % len(data), - ]) - sys.stdout.write(data) - return - params, method = xmlrpclib.loads(data) ! if 1: sys.stderr.write('- XMLRPC ' + '-' * 70 + '\n') sys.stderr.write('%s(%s)\n\n' % (method, repr(params))) --- 80,105 ---- + def xmlrpc_getPage(pagename): + """ Get the raw Wiki text of page, latest version. Page name must be + UTF-8, with URL encoding. Returned value is a binary object, + with UTF-8 encoded page data. + """ + from MoinMoin.Page import Page + + page = Page(_instr(pagename)) + return _outlob(page.get_raw_body()) + + + ############################################################################# + ### Dispatcher + ############################################################################# + def xmlrpc(request): # read request data = sys.stdin.read() params, method = xmlrpclib.loads(data) ! if _debug: sys.stderr.write('- XMLRPC ' + '-' * 70 + '\n') sys.stderr.write('%s(%s)\n\n' % (method, repr(params))) *************** *** 90,94 **** response = xmlrpclib.dumps(xmlrpclib.Fault(1, _dump_exc())) else: ! if 0: sys.stderr.write('- XMLRPC ' + '-' * 70 + '\n') sys.stderr.write(repr(response) + '\n\n') --- 112,116 ---- response = xmlrpclib.dumps(xmlrpclib.Fault(1, _dump_exc())) else: ! if 0 and _debug: sys.stderr.write('- XMLRPC ' + '-' * 70 + '\n') sys.stderr.write(repr(response) + '\n\n') *************** *** 106,110 **** sys.stdout.write(response) ! if 1: sys.stderr.write('- XMLRPC ' + '-' * 70 + '\n') sys.stderr.write(response + '\n\n') --- 128,132 ---- sys.stdout.write(response) ! if _debug: sys.stderr.write('- XMLRPC ' + '-' * 70 + '\n') sys.stderr.write(response + '\n\n') From jhermann at users.sourceforge.net Wed May 8 20:48:09 2002 From: jhermann at users.sourceforge.net (J?rgen Hermann) Date: Wed May 8 20:48:09 2002 Subject: [Moin-devel] CVS: dist/tests rpctest.py,1.1,1.2 Message-ID: Update of /cvsroot/moin/dist/tests In directory usw-pr-cvs1:/tmp/cvs-serv26919/tests Modified Files: rpctest.py Log Message: getPage(); _debug Index: rpctest.py =================================================================== RCS file: /cvsroot/moin/dist/tests/rpctest.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** rpctest.py 9 May 2002 03:05:09 -0000 1.1 --- rpctest.py 9 May 2002 03:47:52 -0000 1.2 *************** *** 7,10 **** --- 7,14 ---- try: + frontpage = server.getPage('FrontPage').data.decode('UTF-8') + print "Length of FrontPage:", len(frontpage) + print "Start of FrontPage:", repr(frontpage[:50]), "..." + print "End of FrontPage:", "...", repr(frontpage[-50:]) print "Interface Version:", server.getRPCVersionSupported() print "Number of Pages:", len(server.getAllPages()) From jhermann at users.sourceforge.net Thu May 9 03:33:02 2002 From: jhermann at users.sourceforge.net (J?rgen Hermann) Date: Thu May 9 03:33:02 2002 Subject: [Moin-devel] CVS: MoinMoin/parser rst.py,NONE,1.1 Message-ID: Update of /cvsroot/moin/MoinMoin/parser In directory usw-pr-cvs1:/tmp/cvs-serv1861 Added Files: rst.py Log Message: RST parser which (currently) converts to XML --- NEW FILE: rst.py --- """ MoinMoin - ReStructured Text Parser Copyright (c) 2002 by J?rgen Hermann All rights reserved, see COPYING for details. $Id: rst.py,v 1.1 2002/05/09 10:32:15 jhermann Exp $ """ import cgi, sys from docutils import core, utils from docutils.parsers import rst ############################################################################# ### ReStructured Text Parser ############################################################################# class Parser: """ Parse ReST via "docutils". """ def __init__(self, raw, request, **kw): self.raw = raw self.request = request def format(self, formatter, form): """ Send the text. """ #core.publish(source=self.raw, destination=sys.stdout, writer_name='html') parser = rst.Parser() document = utils.new_document() parser.parse(self.raw, document) if 1: dom = document.asdom() print '
'
            print cgi.escape(dom.toprettyxml(indent='  '))
            print '
' if 0: print '
'
            print cgi.escape(document.astext())
            print '
' From jhermann at users.sourceforge.net Thu May 9 04:28:02 2002 From: jhermann at users.sourceforge.net (J?rgen Hermann) Date: Thu May 9 04:28:02 2002 Subject: [Moin-devel] CVS: MoinMoin/parser rst.py,1.1,1.2 Message-ID: Update of /cvsroot/moin/MoinMoin/parser In directory usw-pr-cvs1:/tmp/cvs-serv13248 Modified Files: rst.py Log Message: Added most basic elements Index: rst.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/parser/rst.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** rst.py 9 May 2002 10:32:15 -0000 1.1 --- rst.py 9 May 2002 11:27:21 -0000 1.2 *************** *** 9,13 **** import cgi, sys ! from docutils import core, utils from docutils.parsers import rst --- 9,13 ---- import cgi, sys ! from docutils import core, nodes, utils from docutils.parsers import rst *************** *** 18,22 **** class Parser: ! """ Parse ReST via "docutils". """ --- 18,22 ---- class Parser: ! """ Parse RST via "docutils". """ *************** *** 35,38 **** --- 35,41 ---- if 1: + document.walkabout(MoinTranslator(self.request, formatter, document)) + + if 0: dom = document.asdom() print '
'
***************
*** 44,46 ****
--- 47,160 ----
              print cgi.escape(document.astext())
              print '
' + + + class MoinTranslator(nodes.NodeVisitor): + + def __init__(self, request, formatter, document): + nodes.NodeVisitor.__init__(self, document) + self.request = request + self.formatter = formatter + + def visit_Text(self, node): + print self.formatter.text(node.astext()) + + def depart_Text(self, node): + pass + + def visit_title(self, node): + print self.formatter.heading(1, node.astext()) + + + # + # Text markup + # + + def visit_emphasis(self, node): + print self.formatter.emphasis(1) + + def depart_emphasis(self, node): + print self.formatter.emphasis(0) + + def visit_strong(self, node): + print self.formatter.strong(1) + + def depart_strong(self, node): + print self.formatter.strong(0) + + def visit_literal(self, node): + print self.formatter.code(1) + + def depart_literal(self, node): + print self.formatter.code(0) + + + # + # Blocks + # + + def visit_paragraph(self, node): + #if self.topic_class != 'contents': + print self.formatter.paragraph(1) + + def depart_paragraph(self, node): + #if self.topic_class == 'contents': + # print self.formatter.linebreak() + #else: + print self.formatter.paragraph(0) + + def visit_literal_block(self, node): + print self.formatter.preformatted(1) + + def depart_literal_block(self, node): + print self.formatter.preformatted(0) + + + # + # Lists + # + + def visit_bullet_list(self, node): + print self.formatter.bullet_list(1) + + def depart_bullet_list(self, node): + print self.formatter.bullet_list(0) + + def visit_enumerated_list(self, node): + print self.formatter.number_list(1, start=node.get('start', None)) + + def depart_enumerated_list(self, node): + print self.formatter.number_list(0) + + def visit_list_item(self, node): + print self.formatter.listitem(1) + + def depart_list_item(self, node): + print self.formatter.listitem(0) + + def visit_definition_list(self, node): + print self.formatter.definition_list(1) + + def depart_definition_list(self, node): + print self.formatter.definition_list(0) + + + # + # Admonitions + # + + def visit_warning(self, node): + print self.formatter.highlight(1) + + def depart_warning(self, node): + print self.formatter.highlight(0) + + + # + # Misc + # + + def visit_system_message(self, node): + print self.formatter.highlight(1) + print '[%s]' % node.astext() + print self.formatter.highlight(0) From jhermann at users.sourceforge.net Thu May 9 04:34:02 2002 From: jhermann at users.sourceforge.net (J?rgen Hermann) Date: Thu May 9 04:34:02 2002 Subject: [Moin-devel] CVS: dist CHANGES,1.87,1.88 Message-ID: Update of /cvsroot/moin/dist In directory usw-pr-cvs1:/tmp/cvs-serv14190 Modified Files: CHANGES Log Message: "@PAGE@" Index: CHANGES =================================================================== RCS file: /cvsroot/moin/dist/CHANGES,v retrieving revision 1.87 retrieving revision 1.88 diff -C2 -r1.87 -r1.88 *** CHANGES 7 May 2002 17:05:22 -0000 1.87 --- CHANGES 9 May 2002 11:33:06 -0000 1.88 *************** *** 26,29 **** --- 26,32 ---- * Email notifications are sent in the user's language, if known from the preferences + * RST parser (you need to install docutils to use this) + * @PAGE@ is substituted by the name of the current page (useful + for template pages) Bugfixes: From jhermann at users.sourceforge.net Thu May 9 04:34:02 2002 From: jhermann at users.sourceforge.net (J?rgen Hermann) Date: Thu May 9 04:34:02 2002 Subject: [Moin-devel] CVS: MoinMoin PageEditor.py,1.10,1.11 Message-ID: Update of /cvsroot/moin/MoinMoin In directory usw-pr-cvs1:/tmp/cvs-serv14190/MoinMoin Modified Files: PageEditor.py Log Message: "@PAGE@" Index: PageEditor.py =================================================================== RCS file: /cvsroot/moin/MoinMoin/PageEditor.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -r1.10 -r1.11 *** PageEditor.py 7 May 2002 17:05:22 -0000 1.10 --- PageEditor.py 9 May 2002 11:33:07 -0000 1.11 *************** *** 326,329 **** --- 326,330 ---- now = time.strftime("%Y-%m-%dT%H:%M:%S", time.localtime(time.time())) system_vars = { + 'PAGE': lambda s=self: s.page_name, 'TIME': lambda t=now: "[[DateTime(%s)]]" % t, 'DATE': lambda t=now: "[[Date(%s)]]" % t, From jhermann at users.sourceforge.net Thu May 9 10:55:01 2002 From: jhermann at users.sourceforge.net (J?rgen Hermann) Date: Thu May 9 10:55:01 2002 Subject: [Moin-devel] CVS: MoinMoin/widget - New directory Message-ID: Update of /cvsroot/moin/MoinMoin/widget In directory usw-pr-cvs1:/tmp/cvs-serv4668/widget Log Message: Directory /cvsroot/moin/MoinMoin/widget added to the repository From jhermann at users.sourceforge.net Thu May 9 10:55:02 2002 From: jhermann at users.sourceforge.net (J?rgen Hermann) Date: Thu May 9 10:55:02 2002 Subject: [Moin-devel] CVS: MoinMoin/util - New directory Message-ID: Update of /cvsroot/moin/MoinMoin/util In directory usw-pr-cvs1:/tmp/cvs-serv4723/util Log Message: Directory /cvsroot/moin/MoinMoin/util added to the repository From jh at web.de Thu May 9 11:09:02 2002 From: jh at web.de (Juergen Hermann) Date: Thu May 9 11:09:02 2002 Subject: [Moin-devel] Dropping 1.5.2 support Message-ID: Hi! I just this minute decided I'm tired of dancing the avoid-any-2.0- construct dance, i.e. I will make a 1.0 release right now, which will be the last 1.5.2 compatible one. If severe bugs occur, 1.0 will be branched and fixed. Lesser bugs will be accumulated and fixed in a maintenance release. To avoid any confusion, the "stats" subpackage and much of the XML code is already 2.0-only, i.e. 1.5.2 problems there are not considered a bug that'll be fixed. Ciao, J?rgen From jhermann at users.sourceforge.net Thu May 9 11:18:05 2002 From: jhermann at users.sourceforge.net (J?rgen Hermann) Date: Thu May 9 11:18:05 2002 Subject: [Moin-devel] CVS: MoinMoin util.py,1.38,NONE Message-ID: Update of /cvsroot/moin/MoinMoin In directory usw-pr-cvs1:/tmp/cvs-serv10460 Removed Files: util.py Log Message: New submodules; preparing 1.0 --- util.py DELETED --- From jhermann at users.sourceforge.net Thu May 9 11:18:05 2002 From: jhermann at users.sourceforge.net (J?rgen Hermann) Date: Thu May 9 11:18:05 2002 Subject: [Moin-devel] CVS: MoinMoin/util .cvsignore,NONE,1.1 __init__.py,NONE,1.1 dataset.py,NONE,1.1 Message-ID: Update of /cvsroot/moin/MoinMoin/util In directory usw-pr-cvs1:/tmp/cvs-serv10460/util Added Files: .cvsignore __init__.py dataset.py Log Message: New submodules; preparing 1.0 --- NEW FILE: .cvsignore --- *.pyc --- NEW FILE: __init__.py --- """ MoinMoin - Utility Functions Copyright (c) 2000, 2001, 2002 by J?rgen Hermann All rights reserved, see COPYING for details. General helper functions that are not directly wiki related. $Id: __init__.py,v 1.1 2002/05/09 18:17:48 jhermann Exp $ """ # Imports import os, re, string, time from MoinMoin.i18n import _ ############################################################################# ### XML helper functions ############################################################################# g_xmlIllegalCharPattern = re.compile('[\x01-\x08\x0B-\x0D\x0E-\x1F\x80-\xFF]') g_undoUtf8Pattern = re.compile('\xC2([^\xC2])') g_cdataCharPattern = re.compile('[&<\'\"]') g_textCharPattern = re.compile('[&<]') g_charToEntity = { '&': '&', '<': '<', "'": ''', '"': '"' } def TranslateCDATA(text): """ Convert a string to a CDATA-encoded one Copyright (c) 1999-2000 FourThought, http://4suite.com/4DOM """ new_string, num_subst = re.subn(g_undoUtf8Pattern, lambda m: m.group(1), text) new_string, num_subst = re.subn(g_cdataCharPattern, lambda m, d=g_charToEntity: d[m.group()], new_string) new_string, num_subst = re.subn(g_xmlIllegalCharPattern, lambda m: '&#x%02X;'%ord(m.group()), new_string) return new_string def TranslateText(text): """ Convert a string to a PCDATA-encoded one (do minimal encoding) Copyright (c) 1999-2000 FourThought, http://4suite.com/4DOM """ new_string, num_subst = re.subn(g_undoUtf8Pattern, lambda m: m.group(1), text) new_string, num_subst = re.subn(g_textCharPattern, lambda m, d=g_charToEntity: d[m.group()], new_string) new_string, num_subst = re.subn(g_xmlIllegalCharPattern, lambda m: '&#x%02X;'%ord(m.group()), new_string) return new_string ############################################################################# ### Mail ############################################################################# def sendmail(to, subject, text, **kw): """ Send a mail to the address(es) in 'to', with the given subject and mail body 'text'. Return a success or error message. Set a different "From" address with "mail_from=". """ import smtplib, socket from MoinMoin import config try: server = smtplib.SMTP(config.mail_smarthost) try: #server.set_debuglevel(1) header = "From: %s\r\nTo: %s\r\nSubject: %s\r\n\r\n" %( config.mail_from, string.join(to, ', '), subject) server.sendmail( kw.get('mail_from', config.mail_from) or config.mail_from, to, header + text) finally: server.quit() except smtplib.SMTPException, e: return str(e) except (os.error, socket.error), e: return _("Connection to mailserver '%(server)s' failed: %(reason)s") % { 'server': config.mail_smarthost, 'reason': str(e) } return _("Mail sent OK") ############################################################################# ### Misc ############################################################################# # popen (use win32 version if available) popen = os.popen if os.name == "nt": try: import win32pipe popen = win32pipe.popen except ImportError: pass def rangelist(numbers): """ Convert a list of integers to a range string in the form '1,2-5,7'. """ numbers = numbers[:] numbers.sort() numbers.append(999999) pattern = ',' for i in range(len(numbers)-1): if pattern[-1] == ',': pattern = pattern + str(numbers[i]) if numbers[i]+1 == numbers[i+1]: pattern = pattern + '-' else: pattern = pattern + ',' elif numbers[i]+1 != numbers[i+1]: pattern = pattern + str(numbers[i]) + ',' if pattern[-1] in ',-': return pattern[1:-1] return pattern[1:] def W3CDate(tm=None): """ Return time string according to http://www.w3.org/TR/NOTE-datetime """ if not tm: tm = time.time() return time.strftime("%Y-%m-%dT%H:%M:%S", tm) + "%s%02d:%02d" % ( "+-"[time.timezone < 0], abs(time.timezone) / 3600, abs(time.timezone) / 60 % 60 ) def getPackageModules(packagefile): pyre = re.compile(r"^([^_].*)\.py$") pyfiles = filter(None, map(pyre.match, os.listdir(os.path.dirname(packagefile)))) modules = map(lambda x: x.group(1), pyfiles) modules.sort() return modules def importName(modulename, name): """ Import a named object from a module in the context of this function, which means you should use fully qualified module paths. Return None on failure. """ try: module = __import__(modulename, globals(), locals(), [name]) except ImportError: return None return vars(module).get(name, None) def importPlugin(path, package, modulename, name): """ Import a named object from a module in the context of this function, located in the given path. Return None on failure. """ import imp try: file = None try: file, filename, description = imp.find_module(modulename, [path]) assert file is not None module = imp.load_module(package + "." + modulename, file, filename, description) finally: if file: file.close() except ImportError: return None return vars(module).get(name, None) def isImportable(module): """ Check whether a certain module is available. """ try: __import__(module) return 1 except ImportError: return 0 def dumpFormData(form): """ Dump the form data for debugging purposes """ import cgi result = '
Form entries
' for k in form.keys(): v = form.getvalue(k, "") if type(v) is type([]): # Multiple username fields specified v = string.join(v, "|") result = result + '
%s=%s
' % (k, cgi.escape(v)) return result def parseQueryString(qstr): """ Parse a querystring "key=value&..." into a dict. """ import urllib values = {} pairs = string.split(qstr, '&') for pair in pairs: key, val = string.split(pair, '=') values[urllib.unquote(key)] = urllib.unquote(val) return values --- NEW FILE: dataset.py --- """ MoinMoin - Datasets Copyright (c) 2002 by J?rgen Hermann All rights reserved, see COPYING for details. Datasets are used by the DataBrowserWidget, and with the statistics code. $Id: dataset.py,v 1.1 2002/05/09 18:17:48 jhermann Exp $ """ class Dataset: pass class TupleDataset: pass class DictDataset: pass class DbDataset: pass From jhermann at users.sourceforge.net Thu May 9 11:18:05 2002 From: jhermann at users.sourceforge.net (J?rgen Hermann) Date: Thu May 9 11:18:05 2002 Subject: [Moin-devel] CVS: MoinMoin/widget .cvsignore,NONE,1.1 __init__.py,NONE,1.1 base.py,NONE,1.1 browser.py,NONE,1.1 Message-ID: Update of /cvsroot/moin/MoinMoin/widget In directory usw-pr-cvs1:/tmp/cvs-serv10460/widget Added Files: .cvsignore __init__.py base.py browser.py Log Message: New submodules; preparing 1.0 --- NEW FILE: .cvsignore --- *.pyc --- NEW FILE: __init__.py --- """ MoinMoin - Interface Widgets Copyright (c) 2002 by J?rgen Hermann All rights reserved, see COPYING for details. $Id: __init__.py,v 1.1 2002/05/09 18:17:48 jhermann Exp $ """ --- NEW FILE: base.py --- """ MoinMoin - Widget base class Copyright (c) 2002 by J?rgen Hermann All rights reserved, see COPYING for details. $Id: base.py,v 1.1 2002/05/09 18:17:48 jhermann Exp $ """ class Widget: def __init__(self, request, **kw): pass def render(self): pass --- NEW FILE: browser.py --- """ MoinMoin - DataBrowserWidget Copyright (c) 2002 by J?rgen Hermann All rights reserved, see COPYING for details. $Id: browser.py,v 1.1 2002/05/09 18:17:48 jhermann Exp $ """ from MoinMoin.widget import base class DataBrowserWidget(base.Widget): def __init__(self, request, **kw): base.Widget.__init__(self, request, **kw) From jhermann at users.sourceforge.net Thu May 9 11:54:02 2002 From: jhermann at users.sourceforge.net (J?rgen Hermann) Date: Thu May 9 11:54:02 2002 Subject: [Moin-devel] CVS: dist CHANGES,1.88,1.89 INSTALL.html,1.4,1.5 setup.py,1.18,1.19 Message-ID: Update of /cvsroot/moin/dist In directory usw-pr-cvs1:/tmp/cvs-serv20159 Modified Files: CHANGES INSTALL.html setup.py Log Message: Final 1.0 touches Index: CHANGES =================================================================== RCS file: /cvsroot/moin/dist/CHANGES,v retrieving revision 1.88 retrieving revision 1.89 diff -C2 -r1.88 -r1.89 *** CHANGES 9 May 2002 11:33:06 -0000 1.88 --- CHANGES 9 May 2002 18:53:45 -0000 1.89 *************** *** 11,15 **** ----------------------------------------------------------------------------- ! Version 0.12 (2002-04-xx, Revision 1.xxx) New features: --- 11,18 ---- ----------------------------------------------------------------------------- ! Version 1.0 (2002-05-09, Revision 1.158) ! ! THIS IS THE LAST RELEASE WITH PYTHON 1.5.2 SUPPORT! If severe bugs ! should occur, a maintenance release will fix them. New features: *************** *** 21,36 **** displays" and are called by a bangpath in the first line of data * Processors: Colorize, CSV (see HelpOnProcessors) ! * New icons: "(OK)" and "(./)" (see HelpOnSmileys) * FullSearch now displays context information for search hits * DeletePage offers a textentry field for an optional comment * Email notifications are sent in the user's language, if known from the preferences - * RST parser (you need to install docutils to use this) * @PAGE@ is substituted by the name of the current page (useful for template pages) Bugfixes: * Syntax warning with Python 2.2 fixed * Macro-generated pagelinks are no longer added to the list of links ----------------------------------------------------------------------------- --- 24,46 ---- displays" and are called by a bangpath in the first line of data * Processors: Colorize, CSV (see HelpOnProcessors) ! * New icons: "{OK}", "(./)", "{X}", "{i}", "{1}", "{2}" and "{}" ! (see HelpOnSmileys) * FullSearch now displays context information for search hits * DeletePage offers a textentry field for an optional comment * Email notifications are sent in the user's language, if known from the preferences * @PAGE@ is substituted by the name of the current page (useful for template pages) + Unfinished features: + * user defined forms + * XML export of all data in the wiki + * RST parser (you need to install docutils to use this) + * XMLRPC interface + Bugfixes: * Syntax warning with Python 2.2 fixed * Macro-generated pagelinks are no longer added to the list of links + + error codes returned by "diff" are reported ----------------------------------------------------------------------------- Index: INSTALL.html =================================================================== RCS file: /cvsroot/moin/dist/INSTALL.html,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** INSTALL.html 11 Mar 2002 22:42:18 -0000 1.4 --- INSTALL.html 9 May 2002 18:53:45 -0000 1.5 *************** *** 19,30 ****

How to install your own MoinMoin Wiki

! This page describes the installation procedure applying to [MoinMoin]MoinMoin version 0.11 and up. In the next section, there is a list of real-world Installation Scenarios that help you to understand how to apply the instructions in different environments.

Basic Installation explains the "setup.py" step of the installation in more detail. This applies equally to all scenarios, and you should read it before trying a live installation. !

After a successful installation, you might want to read more about configuration and other options that you, as the wiki administrator, can set up. [MoinMoin]HelpOnAdministration contains links to pages that cover these topics. ! Especially, the [MoinMoin]HelpOnConfiguration and [MoinMoin]HelpOnUpdating pages provide additional information regarding wiki setup and maintenance. [MoinMoin]MoinMoinWinCvs and [MoinMoin]MoinMoinUnixCvs describe how to run your wiki using the current development version from the [MoinMoin]SourceForge CVS repository.

Sample Installation Scenarios

!

The following links lead you to concrete examples of installation sessions, showing the commands used and explaining what they do. It is highly recommended that you first read the general information on installing (especially the next section of this page) before choosing an installation scenario that best fits your intended use of [MoinMoin]MoinMoin.

UNIX:

--- 19,31 ----

How to install your own MoinMoin Wiki

! This page describes the installation procedure applying to [MoinMoin]MoinMoin version 0.11 and up. In the next section, there is a list of real-world Installation Scenarios that help you to understand how to apply the instructions in different environments.

Basic Installation explains the "setup.py" step of the installation in more detail. This applies equally to all scenarios, and you should read it before trying a live installation. !

Trouble-shooting helps with fixing any general problems you might encounter, which apply to any installation platform. !

After a successful installation, you might want to read more about configuration and other options that you, as the wiki administrator, can set up. [MoinMoin]HelpOnAdministration contains links to pages that cover these topics. ! Especially, the [MoinMoin]HelpOnConfiguration and [MoinMoin]HelpOnUpdating pages provide additional information regarding wiki setup and maintenance. [MoinMoin]MoinMoinWinCvs and [MoinMoin]MoinMoinUnixCvs describe how to run your wiki using the current development version from the [MoinMoin]SourceForge CVS repository.

Sample Installation Scenarios

!

The following links lead you to concrete examples of installation sessions, showing the commands used and explaining what they do. It is highly recommended that you first read the general information on installing (especially the next section of this page) before choosing an installation scenario that best fits your intended use of [MoinMoin]MoinMoin.

UNIX:

*************** *** 40,44 **** distutils mechanism. We'll explain the usual steps you need to take to do this. For more details on the distutils installation ! process, consult the [WWW]Installing Python Modules document of your Python manual.

     /!\ NOTE: You will need the Python Development package installed on UNIX systems for distutils to work correctly.

--- 41,45 ---- distutils mechanism. We'll explain the usual steps you need to take to do this. For more details on the distutils installation ! process, consult the [WWW]Installing Python Modules document of your Python manual.

     /!\ NOTE: You will need the Python Development package installed on UNIX systems for distutils to work correctly.

*************** *** 129,132 **** --- 130,146 ----


+ +


+ +

Trouble-shooting

+ +

Built-in test

+ +

There's a built-in diagnostic mode that's useful when doing an install; just append "?test" to the URL of your wiki:

+ lynx --dump http://`hostname`/mywiki?test 
+ 
+

If you see an import error here, but "python -c "import MoinMoin"" works, it's likely a result of missing file permissions or a wrong PYTHONPATH setting within the web server environment. +


+


*************** *** 135,139 ****

Index !

  1. Installation when you are root or the webmaster
    1. Installing MoinMoin
    2. Creating a wiki instance
    3. Troubleshooting
  2. Installation into your home directory
    1. Making sure /~username URLs work
    2. Getting the distribution archive and doing the basic installation
    3. Setting up a wiki instance
    4. Setting up public_html and testing the installation

Installation when you are root or the webmaster

--- 149,153 ----

Index !

  1. Installation when you are root or the webmaster
    1. Installing MoinMoin
    2. Creating a wiki instance
    3. Troubleshooting
      1. Dueling Pythons
      2. Distutils does not work
      3. Missing file permissions
  2. Installation into your home directory
    1. Making sure /~username URLs work
    2. Getting the distribution archive and doing the basic installation
    3. Setting up a wiki instance
    4. Setting up public_html and testing the installation

Installation when you are root or the webmaster

*************** *** 190,202 ****

Troubleshooting

!

The first thing to do when your wiki does not work as expected is to issue the command "tail /var/log/httpd/error_log" to display the most recent errors. Usually, you will get a hint on what went wrong, like missing file system permissions.

The most common problem you might encounter is when you have Python 1.5.2 installed into "/usr", and a newer Python distribution into "/usr/local"; this is typical for GNU/Linux distributions that still come bundled with version 1.5.2 of Python.

In that case, if you enter "python" on your prompt, you will usually get the more recent Python interpreter, because "/usr/local/bin" is in your PATH. The situation is different in your webserver environment, and thus you might have to change the bang path of "moin.cgi", like this:

! #! /usr/local/bin/python 
!  
! """ 
!     MoinMoin - CGI Driver Script 
! ... 
  

Installation into your home directory

--- 204,233 ----

Troubleshooting

!

The first thing to do when your wiki does not work as expected is to issue the command "tail /var/log/httpd/error_log" to display the most recent errors. Usually, you will get a hint on what went wrong, like missing file system permissions. Also, always consult the HelpOnInstalling/TroubleShooting page for further hints on your problem. !

Dueling Pythons

!

The most common problem you might encounter is when you have Python 1.5.2 installed into "/usr", and a newer Python distribution into "/usr/local"; this is typical for GNU/Linux distributions that still come bundled with version 1.5.2 of Python.

In that case, if you enter "python" on your prompt, you will usually get the more recent Python interpreter, because "/usr/local/bin" is in your PATH. The situation is different in your webserver environment, and thus you might have to change the bang path of "moin.cgi", like this:

! 
    1 #! /usr/local/bin/python
!     2 
!     3 """
!     4     MoinMoin - CGI Driver Script
!     5 ...
!     6 """
!

Distutils does not work

! !

If you have problems with the distutils install step, note that you need to have the Python development package installed on some Unix distributions. On Mandrake, you need to "rpm -i python-devel-2.1.1-3mdk.i586.rpm". !

Missing file permissions

! !

If you are root, the installed files may be readable only by root, but they must also be readable by the web server before the wiki will work. This includes both the Python modules and the site itself. For the data directory, the web server also needs write access. To fix this, first find out where the Python module directory is; look in install.log, or run the command: !

! python -c "import sys; print '%s/lib/python%s/site-packages' % ( sys.prefix, sys.version[:3] )" 
! 
!

For the example below, we'll assume that the Python module directory is /usr/local/lib/python2.1/site-packages. ! Make the files world-readable using the following commands:

! cd /usr/local 
! chmod -R a+rX lib/python2.1/site-packages/MoinMoin share/moin 
  
+

/!\ Note that by making everything under /usr/local/share/moin world-readable, local users can read the files containing your wiki. You don't really need to do that, since the mywiki directory is owned by the webserver. If you don't want that, you do a "chmod -R o-rwx share/moin/mywiki" after the above commands.

Installation into your home directory

*************** *** 315,322 ****

Installing Apache

!

You currently need an external webserver to run MoinMoin, the recommended option is to use Apache if you haven't installed one on your machine already. To install Apache, consult the [WWW]Using Apache With Microsoft Windows document. Make sure that your webserver runs without problems before you start to install MoinMoin; problems with your webserver installation are not in the scope of this document.

Installing Python

!

Download [WWW]Python 2.1.2 and install it. Python installation is done via a standard Windows installer program, which you should be familiar with.

Installing MoinMoin

--- 346,353 ----

Installing Apache

!

You currently need an external webserver to run MoinMoin, the recommended option is to use Apache if you haven't installed one on your machine already. To install Apache, consult the [WWW]Using Apache With Microsoft Windows document. Make sure that your webserver runs without problems before you start to install MoinMoin; problems with your webserver installation are not in the scope of this document.

Installing Python

!

Download [WWW]Python 2.1.2 and install it. Python installation is done via a standard Windows installer program, which you should be familiar with.

Installing MoinMoin

*************** *** 379,383 ****

Requirements

!

Before you install [MoinMoin]MoinMoin, make sure you have the necessary infra-structure in place, namely the Internet Information Services webserver (any version should be OK), and a Python installation (version 2.0 or higher is recommended, don't run 1.5.2 without a compelling reason).

In the following description, we assume that you have installed or will install things to these locations: