Ver Fonte

PEP8ify + pyflakes

Ask Solem há 14 anos atrás
pai
commit
a87a7a3bc3

+ 0 - 2
celery/__init__.py

@@ -10,7 +10,6 @@ __contact__ = "ask@celeryproject.org"
 __homepage__ = "http://celeryproject.org"
 __docformat__ = "restructuredtext"
 
-
 if sys.version_info < (2, 5):
     import warnings
     warnings.warn(DeprecationWarning("""
@@ -22,7 +21,6 @@ will be supported starting from Celery version 2.3.
 """))
 
 
-
 def Celery(*args, **kwargs):
     from celery.app import App
     return App(*args, **kwargs)

+ 1 - 2
celery/app/base.py

@@ -11,11 +11,10 @@ Application Base Class.
 import platform as _platform
 
 from copy import deepcopy
-from datetime import timedelta
 
 from celery.app.defaults import DEFAULTS
 from celery.datastructures import ConfigurationView
-from celery.utils import cached_property, instantiate, lpmerge, maybe_promise
+from celery.utils import cached_property, instantiate, lpmerge
 from celery.utils.functional import wraps
 
 

+ 1 - 0
celery/apps/worker.py

@@ -36,6 +36,7 @@ EXTRA_INFO_FMT = """
 %(tasks)s
 """
 
+
 class Worker(object):
     WorkController = WorkController
 

+ 0 - 1
celery/beat.py

@@ -158,7 +158,6 @@ class Scheduler(UserDict):
                      "options": {"expires": 12 * 3600}})
         return schedule
 
-
     def maybe_due(self, entry, publisher=None):
         is_due, next_time_to_run = entry.is_due()
 

+ 1 - 0
celery/bin/celeryctl.py

@@ -169,6 +169,7 @@ class purge(Command):
                 queues, pluralize(queues, "queue")))
 purge = command(purge)
 
+
 class result(Command):
     args = "<task_id>"
     option_list = Command.option_list + (

+ 1 - 4
celery/bin/celeryev.py

@@ -3,14 +3,13 @@ import sys
 from celery import platforms
 from celery.bin.base import Command, Option, daemon_options
 from celery.platforms import create_daemon_context
-from celery.utils.functional import partial
 
 
 class EvCommand(Command):
 
     def run(self, dump=False, camera=None, frequency=1.0, maxrate=None,
             loglevel="INFO", logfile=None, prog_name="celeryev",
-            pidfile=None, uid=None, gid=None, umask=None, 
+            pidfile=None, uid=None, gid=None, umask=None,
             working_directory=None, detach=False, **kwargs):
         self.prog_name = prog_name
 
@@ -56,8 +55,6 @@ class EvCommand(Command):
         finally:
             on_stop()
 
-
-
     def set_process_status(self, prog, info=""):
         prog = "%s:%s" % (self.prog_name, prog)
         info = "%s %s" % (info, platforms.strargv(sys.argv))

+ 0 - 1
celery/log.py

@@ -15,7 +15,6 @@ from celery.utils.patch import ensure_process_aware_logger
 from celery.utils.term import colored
 
 
-
 class ColorFormatter(logging.Formatter):
     #: Loglevel -> Color mapping.
     COLORS = colored().names

+ 0 - 2
celery/task/base.py

@@ -1,7 +1,6 @@
 # -*- coding: utf-8 -*-"
 import sys
 import threading
-import warnings
 
 from celery import current_app
 from celery.datastructures import ExceptionInfo
@@ -12,7 +11,6 @@ from celery.result import EagerResult
 from celery.schedules import maybe_schedule
 from celery.utils import deprecated, mattrgetter, gen_unique_id, \
                          fun_takes_kwargs
-from celery.utils.functional import wraps
 from celery.utils import timeutils
 
 from celery.task import sets

+ 0 - 1
celery/task/http.py

@@ -3,7 +3,6 @@ from urllib import urlencode
 from urlparse import urlparse
 
 from anyjson import deserialize
-from kombu.utils import kwdict
 
 from celery import __version__ as celery_version
 from celery.task.base import Task as BaseTask

+ 0 - 2
celery/task/schedules.py

@@ -3,5 +3,3 @@ from celery.schedules import schedule, crontab_parser, crontab
 
 warnings.warn(DeprecationWarning(
     "celery.task.schedules is deprecated and renamed to celery.schedules"))
-
-

+ 0 - 2
celery/tests/test_app.py

@@ -1,7 +1,5 @@
 import os
 
-from datetime import timedelta
-
 from celery import Celery
 from celery.app import defaults
 from celery.app.base import BaseApp

+ 1 - 0
celery/tests/test_decorators.py

@@ -15,6 +15,7 @@ class test_decorators(unittest.TestCase):
 
     def setUp(self):
         warnings.resetwarnings()
+
         def with_catch_warnings(log):
             from celery import decorators
             return decorators

+ 0 - 1
celery/tests/test_utils_info.py

@@ -1,7 +1,6 @@
 from celery.tests.utils import unittest
 
 from celery import Celery
-from celery.app import app_or_default
 from celery.utils import textindent
 from celery.utils.timeutils import humanize_seconds
 

+ 5 - 0
contrib/release/flakesignore.txt

@@ -47,4 +47,9 @@ celery/utils/compat.py:(.+?): redefinition of unused 'StringIO' from line 15
 celery/utils/compat.py:(.+?): redefinition of unused 'StringIO' from line 18
 celery/utils/compat.py:(.+?): 'StringIO' imported but unused
 celery/utils/compat.py:(.+?): redefinition of unused 'OrderedDict' from line 268
+celery/task/schedules.py:2: 'schedule' imported but unused
+celery/task/schedules.py:2: 'crontab_parser' imported but unused
+celery/task/schedules.py:2: 'crontab' imported but unused
+celery/tests/__init__.py:17: undefined name 'WindowsError'
+