Browse Source

flakes (flake8 3.0b2)

Ask Solem 8 years ago
parent
commit
e9f1861b90
3 changed files with 13 additions and 9 deletions
  1. 1 1
      Makefile
  2. 11 7
      celery/apps/beat.py
  3. 1 1
      tox.ini

+ 1 - 1
Makefile

@@ -67,7 +67,7 @@ configcheck:
 
 flakecheck:
 	# the only way to enable all-1 errors is to ignore one of them.
-	$(FLAKE8) --ignore=W503 "$(PROJ)"
+	$(FLAKE8) --ignore=X999 "$(PROJ)"
 
 flakediag:
 	-$(MAKE) flakecheck

+ 11 - 7
celery/apps/beat.py

@@ -90,7 +90,6 @@ class Beat(object):
                            colorize=colorize)
 
     def start_scheduler(self):
-        c = self.colored
         if self.pidfile:
             platforms.create_pidlock(self.pidfile)
         beat = self.Service(app=self.app,
@@ -98,12 +97,8 @@ class Beat(object):
                             scheduler_cls=self.scheduler_cls,
                             schedule_filename=self.schedule)
 
-        print(text_t(   # noqa (pyflakes chokes on print)
-            c.blue('__    ', c.magenta('-'),
-            c.blue('    ... __   '), c.magenta('-'),
-            c.blue('        _\n'),
-            c.reset(self.startup_info(beat))),
-        ))
+        print(self.banner())
+
         self.setup_logging()
         if self.socket_timeout:
             logger.debug('Setting default socket timeout to %r',
@@ -118,6 +113,15 @@ class Beat(object):
                             exc_info=True)
             raise
 
+    def banner(self):
+        c = self.colored
+        return text_t(  # flake8: noqa
+            c.blue('__    ', c.magenta('-'),
+            c.blue('    ... __   '), c.magenta('-'),
+            c.blue('        _\n'),
+            c.reset(self.startup_info(beat))),
+        )
+
     def init_loader(self):
         # Run the worker init handler.
         # (Usually imports task modules and such.)

+ 1 - 1
tox.ini

@@ -42,7 +42,7 @@ commands =
 
 [testenv:flake8]
 commands =
-    flake8 --exclude=W503 {toxinidir}/celery
+    flake8 --exclude=X999 {toxinidir}/celery
 
 [testenv:flakeplus]
 commands =