This repository has been archived by the owner on Jan 28, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #403 from Clariteia/0.0.18
0.0.18
- Loading branch information
Showing
31 changed files
with
851 additions
and
118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
from abc import ( | ||
ABC, | ||
) | ||
from typing import ( | ||
Final, | ||
Iterable, | ||
Union, | ||
) | ||
|
||
from crontab import ( | ||
CronTab, | ||
) | ||
|
||
from .abc import ( | ||
EnrouteDecorator, | ||
) | ||
from .kinds import ( | ||
EnrouteDecoratorKind, | ||
) | ||
|
||
|
||
class PeriodicEnrouteDecorator(EnrouteDecorator, ABC): | ||
"""Periodic Enroute class""" | ||
|
||
def __init__(self, crontab: Union[str, CronTab]): | ||
if isinstance(crontab, str): | ||
crontab = CronTab(crontab) | ||
self.crontab = crontab | ||
|
||
def __iter__(self) -> Iterable: | ||
yield from (self.crontab,) | ||
|
||
def __hash__(self): | ||
return hash(tuple((s if not isinstance(s, CronTab) else s.matchers) for s in self)) | ||
|
||
|
||
class PeriodicEventEnrouteDecorator(PeriodicEnrouteDecorator): | ||
"""Periodic Command Enroute class""" | ||
|
||
KIND: Final[EnrouteDecoratorKind] = EnrouteDecoratorKind.Event |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.