changeset 885:51eae6ce2be7

merge with main.
author Felix Wiemann <Felix.Wiemann@gmx.net>
date Thu, 06 Jul 2006 19:36:50 +0200
parents c3694976f155 (current diff) a170df39355f (diff)
children f719f5c0bd4e de485daead4a 8166d766c440
files MoinMoin/parser/text_rst.py
diffstat 4 files changed, 36 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/PageEditor.py	Sun Jul 02 16:51:32 2006 +0200
+++ b/MoinMoin/PageEditor.py	Thu Jul 06 19:36:50 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	Sun Jul 02 16:51:32 2006 +0200
+++ b/MoinMoin/macro/NewPage.py	Thu Jul 06 19:36:50 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	Sun Jul 02 16:51:32 2006 +0200
+++ b/MoinMoin/parser/text_rst.py	Thu Jul 06 19:36:50 2006 +0200
@@ -381,7 +381,7 @@
                     node['classes'].append(prefix)
             else:
                 # Default case - make a link to a wiki page.
-                page = MoinMoin.Page.Page(self.request, refuri)
+                page = Page(self.request, refuri)
                 node['refuri'] = page.url(self.request)
                 if not page.exists():
                     node['classes'].append('nonexistent')
--- a/docs/CHANGES	Sun Jul 02 16:51:32 2006 +0200
+++ b/docs/CHANGES	Thu Jul 06 19:36:50 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