Skip to content

Commit

Permalink
PEP8 + pyflakes
Browse files Browse the repository at this point in the history
  • Loading branch information
Ask Solem committed Oct 29, 2010
1 parent f0d00ab commit e6825ed
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 9 deletions.
1 change: 0 additions & 1 deletion celery/apps/beat.py
Expand Up @@ -5,7 +5,6 @@
from celery import __version__
from celery import beat
from celery import platforms
from celery.log import emergency_error
from celery.utils import get_full_cls_name, info, LOG_LEVELS
from celery.utils.info import humanize_seconds
from celery.utils import term
Expand Down
5 changes: 2 additions & 3 deletions celery/loaders/base.py
Expand Up @@ -77,11 +77,10 @@ def import_from_cwd(self, module, imp=None):
sys.path.remove(cwd)
except ValueError: # pragma: no cover
pass

def mail_admins(self, subject, body, fail_silently=False):
return mail_admins(subject, body, fail_silently=fail_silently)



@property
def conf(self):
"""Loader configuration."""
Expand Down
5 changes: 3 additions & 2 deletions celery/log.py
Expand Up @@ -37,14 +37,15 @@ def __init__(self, msg, use_color=True):
def formatException(self, ei):
r = logging.Formatter.formatException(self, ei)
if type(r) in [types.StringType]:
r = r.decode('utf-8', 'replace') # Convert to unicode
r = r.decode('utf-8', 'replace') # convert to unicode
return r

def format(self, record):
levelname = record.levelname

if self.use_color and levelname in COLORS:
record.msg = unicode(colored().names[COLORS[levelname]](record.msg))
record.msg = unicode(colored().names[COLORS[levelname]](
record.msg))

# Very ugly, but have to make sure processName is supported
# by foreign logger instances.
Expand Down
2 changes: 1 addition & 1 deletion celery/schedules.py
Expand Up @@ -251,7 +251,7 @@ def __reduce__(self):
def remaining_estimate(self, last_run_at):
"""Returns when the periodic task should run next as a timedelta."""
weekday = last_run_at.isoweekday()
if weekday == 7: # Sunday is day 0, not day 7.
if weekday == 7: # sunday is day 0, not day 7.
weekday = 0

execute_this_hour = (weekday in self.day_of_week and
Expand Down
1 change: 0 additions & 1 deletion celery/tests/test_routes.py
Expand Up @@ -94,7 +94,6 @@ def test_expands_queue_in_options(self):
route)
self.assertNotIn("queue", route)


@with_queues(foo=a_queue, bar=b_queue)
def test_lookup_paths_traversed(self):
R = routes.prepare(({"celery.xaza": {"queue": "bar"}},
Expand Down
3 changes: 2 additions & 1 deletion celery/worker/listener.py
Expand Up @@ -276,7 +276,8 @@ def on_task(self, task):
except OverflowError, exc:
self.logger.error(
"Couldn't convert eta %s to timestamp: %r. Task: %r" % (
task.eta, exc, task.info(safe=True)), exc_info=sys.exc_info())
task.eta, exc, task.info(safe=True)),
exc_info=sys.exc_info())
task.acknowledge()
else:
self.qos.increment()
Expand Down

0 comments on commit e6825ed

Please sign in to comment.