| Commit message (Collapse) | Author | Age | Files | Lines |
| | |
|
| |
|
|
|
| |
This is in relation to #157. With this change, croniter
accepts and correctly handles "* * 10-L * *"
|
| |\ |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Example: 0-10/ * * * *
Removed search_re, as it is identical to step_search_re.
Tightened step_search_re: the "/{step}" component
is optional, but if it *is* present, {step} must consist
of one or more digits.
|
| | | |
|
| |/ |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
fixes #151
|
| | |
|
| | |
|
| |\ |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
- Updated the use of CroniterBadDateError to *only* apply during date finding
operations (next/prev), and all parsing errors can now be caught using
CroniterBadCronError. Specifically, this means that:
+ expand() only raise CroniterBadCronError
+ _calc() only raises CroniterBadDateError (as before)
+ _alphaconv() only raises CroniterNotAlphaError (as before)
+ The CroniterNotAlphaError exception is now a child of CroniterBadCronError,
thus allowing all parsing error to be caught with a single parent class.
- Added one-line definitions to all the CroniterError exception classes for
future readers of the code.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
- Updated the all_next() and all_prev() generator interfaces to avoid
CroniterBadDateError exceptions when the 'max_years_between_matches' parameter
is provided. The rational of this change is as follows: If the caller has
explicitly provided the maximum time frame between consecutive matching
dates, then if no additional matching date occurs within the specified number
of years provided, then the caller would prefer to simply stop iteration,
rather than deal with an additional exception type. In other words, if the
contract between the croniter library and caller have explicitly agreed to a
max range (year gap), then there's no need for an exception because croniter
has explicitly done what was asked. However, in the case where a default
range (1y) is used, then the library should notify the caller of the inability
of finding the next time. This keeps existing behavior backwards compatible
while still offering an improved experience for users of the library.
NOTE: Both get_next() and get_prev() remain unchanged, because there a Python
iterable interface isn't expected.
- Add unit tests for the above changes.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
- Add a new 'max_years_between_match' argument to croniter() constructor that
enables support for iterating over time ranges with very large gaps between
matches. This is helpful for matching quarterly events, where a pattern
doesn't match every year. The default for this parameter is 1 year to align
with the previous behavior.
- Updated the croniter_range() function to automatically set the new argument
based on the duration represented by the provided 'start' and 'end' values.
This ensure that callers of croniter_range() never have to worry with
CronBadDateError exceptions.
|
| | | |
|
| |/
|
|
| |
This fixes #142.
|
| |\
| |
| | |
Feat croniter_range(start, stop, cron)
|
| | | |
|
| | |
| |
| |
| |
| | |
- Added another unit DST unit test. Core croniter handles this correctly,
likely an issue elsewhere in my code. Adding this for reference.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
- Removed the timezone check for the croniter_range() check, it seemed like a
good idea, but became more trouble that it's worth. The behavior is well
defined. The timezone from 'start' is used and the one from 'stop' is
only used for terminating the generator, it's up to the user to select
timezones combinations that make sense.
- Replaced unitest. New unit test ensures that croniter_range() works across
DST boundaries.
|
| | |
| |
| |
| |
| |
| |
| | |
- Switched to use `issubclass()` for datetime check instead of issubclass, as
supporting custom classes derived from datetime isn't really supported
anywhere else so the previous code was awkward and unnecessary.
- Tentatively mark first release as 0.3.34.
|
| | |
| |
| |
| |
| |
| | |
- Revamp some internal implementation details of the croniter_range() function.
- Ran flake8 for some cleanup & confirmed with tox
- Fixed coverage of croniter_range(): 100%
|
| | |
| |
| |
| |
| |
| |
| | |
- Allow the ret_type to differ from the provided start/stop type. This is
closer to the behavior of the croniter() class. The one difference is that
if you don't specify 'ret_type' it will autodetect the input type and return
the same type, which is nice, since that's likely the typical use case.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
- Created new helper function `croniter_range()` that allows forward or reverse
time range iteration based on a given cron expression. Initial implementation
handles `ret_type` in a way that's a bit different than the croniter class.
- Added several test cases to a new test class to keep croniter and
croniter_range cases cleanly separated.
- Updated README to include example use of croniter_range().
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
- Optimized for duplicate entries in a cron expression. For example if min
contains '1,5-8,8,5' this can be reduced from [1,5,5,6,7,8,8]
to simply [1,5,6,7,8].
- Replaced full ranges with a wildcard. So if mins contain '0-59', this can be
swapped with "*". Detecting a "full" entry is possible because of existing
bounds checking, min value substitution, duplicate removal (new), and max
value identification (LEN_MEANS_ALL). So a poorly written hour expression
like '1-20,0,15-23' can also be reduced to simply "*".
|
| |/
|
|
|
|
|
|
| |
Add new unittest cases with real-world examples of poorly written cron
expressions created by end-users (who aren't cron experts). Specific
optimizations opportunities include:
- Range reduction: Minutes of 0-59 can be replaced with "*".
- Removal of duplicate values: Hours of 4,1-4,5,4 can be simplified to 1-5
|
| |\
| |
| | |
Add dateutil unittests & docs
|
| | |
| |
| |
| |
| |
| | |
- Add a dateutil.tz unittest to ensure that tz implementation gets tested.
- Updated README to note an example with the python_dateutil module.
- Updated the pytz DST example too, giving users a full example to borrow from.
|
| |\ \
| | |
| | | |
Minor DST unittest tweak
|
| | |/
| |
| |
| | |
Fixed assertion against wrong variable (typo)
|
| |/ |
|
| |
|
|
| |
This fixes #127
|
| | |
|
| | |
|
| |
|
|
| |
This fixes #127
|
| |
|
|
| |
Implement and fixes #54.
|
| |
|
|
| |
This fixes taichino/croniter#122
|
| |
|
|
| |
previous
|
| | |
|
| |
|
|
| |
This fixes #119.
|
| |
|
|
| |
This fixes #114
|
| | |
|
| | |
|
| |
|
|
| |
If the code is triggered from 5-asterisk based cron `get_prev` based on `datetime.now()` is expected to return current cron iteration and not previous execution.
|
| | |
|
| | |
|
| | |
|