Revision: 6502
Author:   russblau
Date:     2009-03-09 14:32:40 +0000 (Mon, 09 Mar 2009)

Log Message:
-----------
clean up and clarify some docstrings.

Modified Paths:
--------------
    branches/rewrite/pywikibot/__init__.py
    branches/rewrite/pywikibot/site.py

Modified: branches/rewrite/pywikibot/__init__.py
===================================================================
--- branches/rewrite/pywikibot/__init__.py      2009-03-08 14:23:17 UTC (rev 
6501)
+++ branches/rewrite/pywikibot/__init__.py      2009-03-09 14:32:40 UTC (rev 
6502)
@@ -34,7 +34,8 @@
     Use Timestamp.fromISOformat() and Timestamp.fromtimestampformat() to
     create Timestamp objects from Mediawiki string formats.
 
-    Use Timestamp.utcnow() [not .now()] for the current time.
+    Use Site.getcurrenttime() for the current time; this is more reliable
+    than using Timestamp.utcnow().
 
     """
     mediawikiTSFormat = "%Y%m%d%H%M%S"

Modified: branches/rewrite/pywikibot/site.py
===================================================================
--- branches/rewrite/pywikibot/site.py  2009-03-08 14:23:17 UTC (rev 6501)
+++ branches/rewrite/pywikibot/site.py  2009-03-09 14:32:40 UTC (rev 6502)
@@ -778,9 +778,9 @@
             return False
 
     def getcurrenttimestamp(self):
-        """Return (Mediawiki) timestamp, {{CURRENTTIMESTAMP}}, the server time.
+        """Return server time, {{CURRENTTIMESTAMP}}, as a string.
 
-        Format is yyyymmddhhmmss
+        Format is 'yyyymmddhhmmss'
 
         """
         r = api.Request(site=self,
@@ -790,7 +790,7 @@
         return re.search('\d+', result['parse']['text']['*']).group()
 
     def getcurrenttime(self):
-        """Returns a Timestamp object representing server time"""
+        """Return a Timestamp object representing the current server time."""
         ts = self.getcurrenttimestamp()
         return pywikibot.Timestamp.fromtimestampformat(ts)
 



_______________________________________________
Pywikipedia-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l

Reply via email to