diff options
author | Alex Grönholm <alex.gronholm@nextday.fi> | 2022-07-30 22:34:16 +0300 |
---|---|---|
committer | Alex Grönholm <alex.gronholm@nextday.fi> | 2022-07-30 23:52:08 +0300 |
commit | b1b45ba4e987b4efa91e4b7d0d744f50dccf5637 (patch) | |
tree | 11bc2995515e9d247dcdc28720a2a9315382057f /src/apscheduler | |
parent | 0bc26e22b458ec0f013c467ef6206130257d03be (diff) | |
download | apscheduler-b1b45ba4e987b4efa91e4b7d0d744f50dccf5637.tar.gz |
Made the apscheduler.context module private and re-exported its code
Diffstat (limited to 'src/apscheduler')
-rw-r--r-- | src/apscheduler/__init__.py | 4 | ||||
-rw-r--r-- | src/apscheduler/_context.py (renamed from src/apscheduler/context.py) | 0 | ||||
-rw-r--r-- | src/apscheduler/schedulers/async_.py | 2 | ||||
-rw-r--r-- | src/apscheduler/schedulers/sync.py | 2 | ||||
-rw-r--r-- | src/apscheduler/workers/async_.py | 2 | ||||
-rw-r--r-- | src/apscheduler/workers/sync.py | 2 |
6 files changed, 8 insertions, 4 deletions
diff --git a/src/apscheduler/__init__.py b/src/apscheduler/__init__.py index 630ca51..3149248 100644 --- a/src/apscheduler/__init__.py +++ b/src/apscheduler/__init__.py @@ -21,10 +21,14 @@ __all__ = [ "SerializationError", "Task", "TaskLookupError", + "current_scheduler", + "current_worker", + "job_info", ] from typing import Any +from ._context import current_scheduler, current_worker, job_info from ._enums import CoalescePolicy, ConflictPolicy, JobOutcome, RunState from ._exceptions import ( ConflictingIdError, diff --git a/src/apscheduler/context.py b/src/apscheduler/_context.py index 42ccf87..42ccf87 100644 --- a/src/apscheduler/context.py +++ b/src/apscheduler/_context.py diff --git a/src/apscheduler/schedulers/async_.py b/src/apscheduler/schedulers/async_.py index cbe8887..2cde777 100644 --- a/src/apscheduler/schedulers/async_.py +++ b/src/apscheduler/schedulers/async_.py @@ -14,6 +14,7 @@ import attrs from anyio import TASK_STATUS_IGNORED, create_task_group, move_on_after from anyio.abc import TaskGroup, TaskStatus +from .._context import current_scheduler from .._converters import as_async_datastore, as_async_eventbroker from .._enums import CoalescePolicy, ConflictPolicy, JobOutcome, RunState from .._exceptions import ( @@ -24,7 +25,6 @@ from .._exceptions import ( ) from .._structures import Job, JobResult, Schedule, Task from ..abc import AsyncDataStore, AsyncEventBroker, Subscription, Trigger -from ..context import current_scheduler from ..datastores.memory import MemoryDataStore from ..eventbrokers.async_local import LocalAsyncEventBroker from ..events import ( diff --git a/src/apscheduler/schedulers/sync.py b/src/apscheduler/schedulers/sync.py index 162e6b9..2380cca 100644 --- a/src/apscheduler/schedulers/sync.py +++ b/src/apscheduler/schedulers/sync.py @@ -15,6 +15,7 @@ from uuid import UUID, uuid4 import attrs +from .._context import current_scheduler from .._enums import CoalescePolicy, ConflictPolicy, JobOutcome, RunState from .._exceptions import ( JobCancelled, @@ -24,7 +25,6 @@ from .._exceptions import ( ) from .._structures import Job, JobResult, Schedule, Task from ..abc import DataStore, EventBroker, Trigger -from ..context import current_scheduler from ..datastores.memory import MemoryDataStore from ..eventbrokers.local import LocalEventBroker from ..events import ( diff --git a/src/apscheduler/workers/async_.py b/src/apscheduler/workers/async_.py index ffd6e4d..f15465f 100644 --- a/src/apscheduler/workers/async_.py +++ b/src/apscheduler/workers/async_.py @@ -20,12 +20,12 @@ from anyio import ( ) from anyio.abc import CancelScope, TaskGroup +from .._context import current_worker, job_info from .._converters import as_async_datastore, as_async_eventbroker from .._enums import JobOutcome, RunState from .._structures import Job, JobInfo, JobResult from .._validators import positive_integer from ..abc import AsyncDataStore, AsyncEventBroker -from ..context import current_worker, job_info from ..eventbrokers.async_local import LocalAsyncEventBroker from ..events import JobAdded, WorkerStarted, WorkerStopped diff --git a/src/apscheduler/workers/sync.py b/src/apscheduler/workers/sync.py index 61f23ad..2dbeaf9 100644 --- a/src/apscheduler/workers/sync.py +++ b/src/apscheduler/workers/sync.py @@ -15,11 +15,11 @@ from uuid import UUID import attrs +from .._context import current_worker, job_info from .._enums import JobOutcome, RunState from .._structures import Job, JobInfo, JobResult from .._validators import positive_integer from ..abc import DataStore, EventBroker -from ..context import current_worker, job_info from ..eventbrokers.local import LocalEventBroker from ..events import JobAdded, WorkerStarted, WorkerStopped |