MCPcopy
hub / github.com/myusuf3/delorean / stops

Function stops

delorean/interface.py:131–161  ·  view source on GitHub ↗

This will create a list of delorean objects the apply to setting possed in.

(freq, interval=1, count=None, wkst=None, bysetpos=None,
          bymonth=None, bymonthday=None, byyearday=None, byeaster=None,
          byweekno=None, byweekday=None, byhour=None, byminute=None,
          bysecond=None, timezone='UTC', start=None, stop=None)

Source from the content-addressed store, hash-verified

129
130
131def stops(freq, interval=1, count=None, wkst=None, bysetpos=None,
132 bymonth=None, bymonthday=None, byyearday=None, byeaster=None,
133 byweekno=None, byweekday=None, byhour=None, byminute=None,
134 bysecond=None, timezone='UTC', start=None, stop=None):
135 """
136 This will create a list of delorean objects the apply to
137 setting possed in.
138 """
139 # check to see if datetimees passed in are naive if so process them
140 # with given timezone.
141 if all([(start is None or is_datetime_naive(start)),
142 (stop is None or is_datetime_naive(stop))]):
143 pass
144 else:
145 raise DeloreanInvalidDatetime('Provide a naive datetime object')
146
147 # if no datetimes are passed in create a proper datetime object for
148 # start default because default in dateutil is datetime.now() :(
149 if start is None:
150 start = datetime_timezone(timezone)
151
152 for dt in rrule(freq, interval=interval, count=count, wkst=wkst, bysetpos=bysetpos,
153 bymonth=bymonth, bymonthday=bymonthday, byyearday=byyearday, byeaster=byeaster,
154 byweekno=byweekno, byweekday=byweekday, byhour=byhour, byminute=byminute,
155 bysecond=bysecond, until=stop, dtstart=start):
156 # make the delorean object
157 # yield it.
158 # doing this to make sure delorean receives a naive datetime.
159 dt = dt.replace(tzinfo=None)
160 d = Delorean(datetime=dt, timezone=timezone)
161 yield d
162
163
164def epoch(s):

Callers 4

range_dailyFunction · 0.85
range_hourlyFunction · 0.85
range_monthlyFunction · 0.85
range_yearlyFunction · 0.85

Calls 5

is_datetime_naiveFunction · 0.85
datetime_timezoneFunction · 0.85
DeloreanClass · 0.85
replaceMethod · 0.80

Tested by

no test coverage detected