moved to lgc.date as well
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Fri, 05 Feb 2010 14:45:39 +0100
changeset 4478 442fd69ff13b
parent 4477 c094101ba85d
child 4479 f25e61a93c42
moved to lgc.date as well
utils.py
--- a/utils.py	Fri Feb 05 12:33:54 2010 +0100
+++ b/utils.py	Fri Feb 05 14:45:39 2010 +0100
@@ -18,37 +18,9 @@
 from random import randint, seed
 import decimal
 
-from logilab.common.date import strptime, todate, next_month
-
 # initialize random seed from current time
 seed()
 
-# XXX should replace lgc.date.date_range implementation
-def date_range(begin, end, incday=None, incmonth=None):
-    """yields each date between begin and end
-    :param begin: the start date
-    :param end: the end date
-    :param incr: the step to use to iterate over dates. Default is
-                 one day.
-    :param include: None (means no exclusion) or a function taking a
-                    date as parameter, and returning True if the date
-                    should be included.
-    """
-    assert not (incday and incmonth)
-    begin = todate(begin)
-    end = todate(end)
-    if incmonth:
-        while begin < end:
-            begin = next_month(begin, incmonth)
-            yield begin
-    else:
-        if not incday:
-            incr = ONEDAY
-        else:
-            incr = datetime.timedelta(incday)
-        while begin <= end:
-           yield begin
-           begin += incr
 
 
 if sys.version_info[:2] < (2, 5):