changeset 890:de485daead4a

merge main
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Thu, 06 Jul 2006 19:52:47 +0200
parents ad62767ffd0c (current diff) 51eae6ce2be7 (diff)
children ba1b39629510
files
diffstat 4 files changed, 44 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/PageEditor.py	Thu Jul 06 17:16:26 2006 +0200
+++ b/MoinMoin/PageEditor.py	Thu Jul 06 19:52:47 2006 +0200
@@ -629,6 +629,34 @@
         # No mail sent, no message.
         return ''
 
+    def _get_local_timestamp(self):
+        """
+        Returns the string that can be used by the TIME substitution.
+
+        @return: str with a timestamp in it
+        """
+
+        now = time.time()
+        # default: UTC
+        zone = "Z"
+        user = self.request.user
+
+        # setup the timezone
+        if user.valid and user.tz_offset:
+            tz = user.tz_offset
+            # round to minutes
+            tz -= tz % 60
+            minutes = tz / 60
+            hours = minutes / 60
+            minutes -= hours * 60
+
+            # construct the offset
+            zone = "%+0.2d%02d" % (hours, minutes)
+            # correct the time by the offset we've found
+            now += tz
+
+        return time.strftime("%Y-%m-%dT%H:%M:%S", timefuncs.tmtuple(now)) + zone
+
     def _expand_variables(self, text):
         """
         Expand @VARIABLE@ in `text`and return the expanded text.
@@ -639,7 +667,7 @@
         """
         # TODO: Allow addition of variables via wikiconfig or a global
         # wiki dict.
-        now = time.strftime("%Y-%m-%dT%H:%M:%SZ", timefuncs.tmtuple())
+        now = self._get_local_timestamp()
         user = self.request.user
         signature = user.signature()
         variables = {
--- a/MoinMoin/macro/NewPage.py	Thu Jul 06 17:16:26 2006 +0200
+++ b/MoinMoin/macro/NewPage.py	Thu Jul 06 19:52:47 2006 +0200
@@ -9,6 +9,7 @@
     @copyright: 2004 Vito Miliano (vito_moinnewpagewithtemplate@perilith.com)
     @copyright: 2004 by Nir Soffer <nirs@freeshell.org>
     @copyright: 2004 Alexander Schremmer <alex AT alexanderweb DOT de>
+    @copyright: 2006 MoinMoin:ReimarBauer
     @license: GNU GPL, see COPYING for details.
 """
 
@@ -75,6 +76,9 @@
         label = self.args.get('buttonLabel')
         nametemplate = self.args.get('nameTemplate') or u'%s'
         
+        if parent == '@ME' and self.request.user.valid:
+            parent = self.request.user.name
+        
         requires_input = nametemplate.find('%s') != -1
         
         if label:
--- a/MoinMoin/parser/text_rst.py	Thu Jul 06 17:16:26 2006 +0200
+++ b/MoinMoin/parser/text_rst.py	Thu Jul 06 19:52:47 2006 +0200
@@ -28,8 +28,8 @@
 
 # --- make docutils safe by overriding all module-scoped names related to IO ---
 
-# TODO: Add an error message to dummyOpen so that the user knows what they did
-# requested an unsupported feature of docutils in MoinMoin.
+# TODO: Add an error message to dummyOpen so that the user knows that
+# they requested an unsupported feature of Docutils in MoinMoin.
 def dummyOpen(x, y=None, z=None): return
 
 class dummyIO(StringIO.StringIO):
@@ -70,7 +70,7 @@
             _ = self.request.getText
             from MoinMoin.parser.text import Parser as TextParser
             self.request.write(formatter.sysmsg(1) +
-                               formatter.rawHTML(_('Rendering of reStructured text is not possible, ''please'' install docutils.')) +
+                               formatter.rawHTML(_('Rendering of reStructured text is not possible, please install Docutils.')) +
                                formatter.sysmsg(0))
             TextParser(self.raw, self.request).format(formatter)
     
@@ -165,7 +165,7 @@
                                  self)
         self.document.walkabout(visitor)
         self.visitor = visitor
-        # Docutils 0.5.0 and later require the writer to have the visitor 
+        # Docutils 0.5 and later require the writer to have the visitor 
         # attributes.
         if (hasattr(html4css1.Writer, 'visitor_attributes')):
             for attr in html4css1.Writer.visitor_attributes:
@@ -200,10 +200,12 @@
 
         html = []
         if parts['title']:
+            # Document title.
             html.append(formatter.rawHTML('<h1>%s</h1>' % parts['title']))
-        # If there is only one subtitle then it is held in parts['subtitle'].
-        # However, if there is more than one subtitle then this is empty and
-        # fragment contains all of the subtitles.
+        # If there is only one subtitle it is propagated by Docutils
+        # to a document subtitle and is held in parts['subtitle'].
+        # However, if there is more than one subtitle then this is
+        # empty and fragment contains all of the subtitles.
         if parts['subtitle']:
             html.append(formatter.rawHTML('<h2>%s</h2>' % parts['subtitle']))
         if parts['docinfo']:
--- a/docs/CHANGES	Thu Jul 06 17:16:26 2006 +0200
+++ b/docs/CHANGES	Thu Jul 06 19:52:47 2006 +0200
@@ -156,6 +156,8 @@
       engines don't fetch the targets (if they do, they will just get 403 and
       cause unnecessary traffic).
     * Included EmbedObject macro for embedding shockwave flash, mp3, visio, ...
+    * @SIG@ etc. generate local time stamps now, no difference visible on page
+      view.
 
   Bugfixes:
     * on action "info" page, "revert" link will not be displayed for empty page