[pypy-svn] r30006 - in pypy/dist/pypy/module/rctime: . test

rhymes at codespeak.net rhymes at codespeak.net
Thu Jul 13 12:12:21 CEST 2006


Author: rhymes
Date: Thu Jul 13 12:12:17 2006
New Revision: 30006

Modified:
   pypy/dist/pypy/module/rctime/__init__.py
   pypy/dist/pypy/module/rctime/app_time.py
   pypy/dist/pypy/module/rctime/test/test_rctime.py
Log:
time module doc


Modified: pypy/dist/pypy/module/rctime/__init__.py
==============================================================================
--- pypy/dist/pypy/module/rctime/__init__.py	(original)
+++ pypy/dist/pypy/module/rctime/__init__.py	Thu Jul 13 12:12:17 2006
@@ -43,5 +43,6 @@
     appleveldefs = {
         'sleep': 'app_time.sleep',
         '_check_float': 'app_time._check_float',
-        'struct_time': 'app_time.struct_time'   
+        'struct_time': 'app_time.struct_time',
+        '__doc__': 'app_time.__doc__'
     }

Modified: pypy/dist/pypy/module/rctime/app_time.py
==============================================================================
--- pypy/dist/pypy/module/rctime/app_time.py	(original)
+++ pypy/dist/pypy/module/rctime/app_time.py	Thu Jul 13 12:12:17 2006
@@ -70,3 +70,47 @@
     _check_float(secs)
     _float_sleep(secs)
 
+__doc__ = """This module provides various functions to manipulate time values.
+
+There are two standard representations of time.  One is the number
+of seconds since the Epoch, in UTC (a.k.a. GMT).  It may be an integer
+or a floating point number (to represent fractions of seconds).
+The Epoch is system-defined; on Unix, it is generally January 1st, 1970.
+The actual value can be retrieved by calling gmtime(0).
+
+The other representation is a tuple of 9 integers giving local time.
+The tuple items are:
+  year (four digits, e.g. 1998)
+  month (1-12)
+  day (1-31)
+  hours (0-23)
+  minutes (0-59)
+  seconds (0-59)
+  weekday (0-6, Monday is 0)
+  Julian day (day in the year, 1-366)
+  DST (Daylight Savings Time) flag (-1, 0 or 1)
+If the DST flag is 0, the time is given in the regular time zone;
+if it is 1, the time is given in the DST time zone;
+if it is -1, mktime() should guess based on the date and time.
+
+Variables:
+
+timezone -- difference in seconds between UTC and local standard time
+altzone -- difference in  seconds between UTC and local DST time
+daylight -- whether local time should reflect DST
+tzname -- tuple of (standard time zone name, DST time zone name)
+
+Functions:
+
+time() -- return current time in seconds since the Epoch as a float
+clock() -- return CPU time since process start as a float
+sleep() -- delay for a number of seconds given as a float
+gmtime() -- convert seconds since Epoch to UTC tuple
+localtime() -- convert seconds since Epoch to local time tuple
+asctime() -- convert time tuple to string
+ctime() -- convert time in seconds to string
+mktime() -- convert local time tuple to seconds since Epoch
+strftime() -- convert time tuple to string according to format specification
+strptime() -- parse string to time tuple according to format specification
+tzset() -- change the local timezone"""
+

Modified: pypy/dist/pypy/module/rctime/test/test_rctime.py
==============================================================================
--- pypy/dist/pypy/module/rctime/test/test_rctime.py	(original)
+++ pypy/dist/pypy/module/rctime/test/test_rctime.py	Thu Jul 13 12:12:17 2006
@@ -13,6 +13,7 @@
         assert isinstance(rctime.daylight, int)
         assert isinstance(rctime.timezone, int)
         assert isinstance(rctime.tzname, list)
+        assert isinstance(rctime.__doc__, str)
     
     def test_sleep(self):
         import rctime



More information about the Pypy-commit mailing list