Skip to content

Commit

Permalink
Cosmetics
Browse files Browse the repository at this point in the history
  • Loading branch information
ask committed Oct 31, 2016
1 parent 0919237 commit 9ce1b1b
Show file tree
Hide file tree
Showing 183 changed files with 72 additions and 525 deletions.
2 changes: 0 additions & 2 deletions celery/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@
# :license: BSD (3 Clause), see LICENSE for more details.

from __future__ import absolute_import, print_function, unicode_literals

import os
import re
import sys

from collections import namedtuple

SERIES = '0today8'
Expand Down
2 changes: 0 additions & 2 deletions celery/__main__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
"""Entry-point for the :program:`celery` umbrella command."""
from __future__ import absolute_import, print_function, unicode_literals

import sys

from . import maybe_patch_concurrency

__all__ = ['main']
Expand Down
2 changes: 0 additions & 2 deletions celery/_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@
This module shouldn't be used directly.
"""
from __future__ import absolute_import, print_function, unicode_literals

import os
import sys
import threading
import weakref

from celery.local import Proxy
from celery.utils.threads import LocalStack

Expand Down
3 changes: 0 additions & 3 deletions celery/app/__init__.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
# -*- coding: utf-8 -*-
"""Celery Application."""
from __future__ import absolute_import, print_function, unicode_literals

import os

from celery.local import Proxy
from celery import _state
from celery._state import (
get_current_app as current_app,
get_current_task as current_task,
connect_on_app_finalize, set_default_app, _get_active_apps, _task_stack,
)

from .base import Celery, AppPickler

__all__ = [
Expand Down
1 change: 0 additions & 1 deletion celery/app/annotations.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
:setting:`task_annotations` setting.
"""
from __future__ import absolute_import, unicode_literals

from celery.five import string_t
from celery.utils.functional import firstmethod, mlazy
from celery.utils.imports import instantiate
Expand Down
2 changes: 0 additions & 2 deletions celery/app/backends.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
# -*- coding: utf-8 -*-
"""Backend selection."""
from __future__ import absolute_import, unicode_literals

import sys
import types

from celery.exceptions import ImproperlyConfigured
from celery._state import current_app
from celery.five import reraise
Expand Down
2 changes: 0 additions & 2 deletions celery/app/builtins.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@
The built-in tasks are always available in all app instances.
"""
from __future__ import absolute_import, unicode_literals

from celery._state import connect_on_app_finalize
from celery.utils.log import get_logger

__all__ = []

logger = get_logger(__name__)


Expand Down
4 changes: 0 additions & 4 deletions celery/app/control.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,11 @@
Server implementation is in :mod:`celery.worker.control`.
"""
from __future__ import absolute_import, unicode_literals

import warnings

from billiard.common import TERM_SIGNAME

from kombu.pidbox import Mailbox
from kombu.utils.functional import lazy
from kombu.utils.objects import cached_property

from celery.exceptions import DuplicateNodenameWarning
from celery.utils.text import pluralize

Expand Down
3 changes: 0 additions & 3 deletions celery/app/defaults.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
# -*- coding: utf-8 -*-
"""Configuration introspection and defaults."""
from __future__ import absolute_import, unicode_literals

import sys

from collections import deque, namedtuple
from datetime import timedelta

from celery.five import items, keys, python_2_unicode_compatible
from celery.utils.functional import memoize
from celery.utils.serialization import strtobool
Expand Down
3 changes: 0 additions & 3 deletions celery/app/registry.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
# -*- coding: utf-8 -*-
"""Registry of available tasks."""
from __future__ import absolute_import, unicode_literals

import inspect

from importlib import import_module

from celery._state import get_current_app
from celery.exceptions import NotRegistered
from celery.five import items
Expand Down
4 changes: 0 additions & 4 deletions celery/app/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,10 @@
Contains utilities for working with task routers, (:setting:`task_routes`).
"""
from __future__ import absolute_import, unicode_literals

import re
import string

from collections import Mapping, OrderedDict

from kombu import Queue

from celery.exceptions import QueueNotFound
from celery.five import items, string_t
from celery.utils.collections import lpmerge
Expand Down
3 changes: 0 additions & 3 deletions celery/apps/beat.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,10 @@
and so on.
"""
from __future__ import absolute_import, print_function, unicode_literals

import numbers
import socket
import sys

from datetime import datetime

from celery import VERSION_BANNER, platforms, beat
from celery.five import text_t
from celery.utils.imports import qualname
Expand Down
1 change: 0 additions & 1 deletion celery/backends/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Result Backends."""
from __future__ import absolute_import, unicode_literals

from celery.app import backends as _backends
from celery.utils import deprecated

Expand Down
4 changes: 0 additions & 4 deletions celery/backends/cache.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
# -*- coding: utf-8 -*-
"""Memcached and in-memory cache result backend."""
from __future__ import absolute_import, unicode_literals

import sys

from kombu.utils.encoding import bytes_to_str, ensure_bytes
from kombu.utils.objects import cached_property

from celery.exceptions import ImproperlyConfigured
from celery.utils.functional import LRUCache

from .base import KeyValueStoreBackend

__all__ = ['CacheBackend']
Expand Down
9 changes: 4 additions & 5 deletions celery/backends/cassandra.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
# -* coding: utf-8 -*-
"""Apache Cassandra result store backend using the DataStax driver."""
from __future__ import absolute_import, unicode_literals

import sys
from celery import states
from celery.exceptions import ImproperlyConfigured
from celery.utils.log import get_logger
from .base import BaseBackend
try: # pragma: no cover
import cassandra
import cassandra.auth
import cassandra.cluster
except ImportError: # pragma: no cover
cassandra = None # noqa

from celery import states
from celery.exceptions import ImproperlyConfigured
from celery.utils.log import get_logger
from .base import BaseBackend

__all__ = ['CassandraBackend']

Expand Down
3 changes: 0 additions & 3 deletions celery/backends/consul.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,10 @@
in the key-value store of Consul.
"""
from __future__ import absolute_import, unicode_literals

from kombu.utils.url import parse_url

from celery.exceptions import ImproperlyConfigured
from celery.backends.base import KeyValueStoreBackend, PY3
from celery.utils.log import get_logger

try:
import consul
except ImportError:
Expand Down
13 changes: 4 additions & 9 deletions celery/backends/couchbase.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,18 @@
# -*- coding: utf-8 -*-
"""Couchbase result store backend."""
from __future__ import absolute_import, unicode_literals

import logging

from kombu.utils.encoding import str_t
from kombu.utils.url import _parse_url
from celery.exceptions import ImproperlyConfigured
from .base import KeyValueStoreBackend
try:
from couchbase import Couchbase
from couchbase.connection import Connection
from couchbase.exceptions import NotFoundError
except ImportError:
Couchbase = Connection = NotFoundError = None # noqa

from kombu.utils.encoding import str_t
from kombu.utils.url import _parse_url

from celery.exceptions import ImproperlyConfigured

from .base import KeyValueStoreBackend

__all__ = ['CouchbaseBackend']


Expand Down
4 changes: 0 additions & 4 deletions celery/backends/couchdb.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
# -*- coding: utf-8 -*-
"""CouchDB result store backend."""
from __future__ import absolute_import, unicode_literals

from kombu.utils.url import _parse_url

from celery.exceptions import ImproperlyConfigured

from .base import KeyValueStoreBackend

try:
import pycouchdb
except ImportError:
Expand Down
6 changes: 1 addition & 5 deletions celery/backends/database/models.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
# -*- coding: utf-8 -*-
"""Database models used by the SQLAlchemy result store backend."""
from __future__ import absolute_import, unicode_literals

from datetime import datetime

import sqlalchemy as sa
from datetime import datetime
from sqlalchemy.types import PickleType

from celery import states
from celery.five import python_2_unicode_compatible

from .session import ResultModelBase

__all__ = ['Task', 'TaskSet']
Expand Down
2 changes: 0 additions & 2 deletions celery/backends/database/session.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
# -*- coding: utf-8 -*-
"""SQLAlchemy session."""
from __future__ import absolute_import, unicode_literals

from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker
from sqlalchemy.pool import NullPool

from kombu.utils.compat import register_after_fork

ResultModelBase = declarative_base()
Expand Down
5 changes: 0 additions & 5 deletions celery/backends/elasticsearch.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
# -* coding: utf-8 -*-
"""Elasticsearch result store backend."""
from __future__ import absolute_import, unicode_literals

from datetime import datetime

from kombu.utils.url import _parse_url

from celery.exceptions import ImproperlyConfigured

from .base import KeyValueStoreBackend

try:
import elasticsearch
except ImportError:
Expand Down
10 changes: 4 additions & 6 deletions celery/backends/filesystem.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
# -*- coding: utf-8 -*-
"""File-system result store backend."""
from __future__ import absolute_import, unicode_literals

import os
import locale
from kombu.utils.encoding import ensure_bytes

from celery import uuid
from celery.exceptions import ImproperlyConfigured
from celery.backends.base import KeyValueStoreBackend

import os
import locale
default_encoding = locale.getpreferredencoding(False)

# Python 2 does not have FileNotFoundError and IsADirectoryError
try:
FileNotFoundError
except NameError:
FileNotFoundError = IOError
IsADirectoryError = IOError

default_encoding = locale.getpreferredencoding(False)

E_PATH_INVALID = """\
The configured path for the file-system backend does not
work correctly, please make sure that it exists and has
Expand Down
4 changes: 0 additions & 4 deletions celery/backends/mongodb.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
# -*- coding: utf-8 -*-
"""MongoDB result store backend."""
from __future__ import absolute_import, unicode_literals

from datetime import datetime, timedelta

from kombu.utils.objects import cached_property
from kombu.utils.url import maybe_sanitize_url
from kombu.exceptions import EncodeError

from celery import states
from celery.exceptions import ImproperlyConfigured
from celery.five import string_t, items

from .base import BaseBackend

try:
Expand Down
11 changes: 3 additions & 8 deletions celery/backends/riak.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,17 @@
# -*- coding: utf-8 -*-
"""Riak result store backend."""
from __future__ import absolute_import, unicode_literals

import sys

from kombu.utils.url import _parse_url
from celery.exceptions import ImproperlyConfigured
from .base import KeyValueStoreBackend
try:
import riak
from riak import RiakClient
from riak.resolver import last_written_resolver
except ImportError: # pragma: no cover
riak = RiakClient = last_written_resolver = None # noqa

from kombu.utils.url import _parse_url

from celery.exceptions import ImproperlyConfigured

from .base import KeyValueStoreBackend

__all__ = ['RiakBackend']

E_BUCKET_NAME = """\
Expand Down
1 change: 0 additions & 1 deletion celery/bin/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from __future__ import absolute_import, unicode_literals

from .base import Option

__all__ = ['Option']
3 changes: 0 additions & 3 deletions celery/bin/beat.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,8 @@
Executable to use for the detached process.
"""
from __future__ import absolute_import, unicode_literals

from functools import partial

from celery.platforms import detached, maybe_drop_privileges

from celery.bin.base import Command, daemon_options

__all__ = ['beat']
Expand Down
Loading

0 comments on commit 9ce1b1b

Please sign in to comment.