Skip to content

Commit

Permalink
Merge pull request Tivix#28 from valeriansaliou/master
Browse files Browse the repository at this point in the history
Python 3 full compatibility
  • Loading branch information
Sumit Chachra committed Dec 11, 2013
2 parents 9927889 + a9e308c commit ef80810
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
5 changes: 5 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,11 @@ This opensource app is brought to you by Tivix, Inc. ( http://tivix.com/ )
Changelog
=========

0.3.3
------

- Python 3 compatibility.

0.3.2
------

Expand Down
4 changes: 2 additions & 2 deletions django_cron/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def run(self, cron_job, force=False, silent=False):
apply the logic of the schedule and call do() on the CronJobBase class
"""
if not isinstance(cron_job, CronJobBase):
raise Exception, 'The cron_job to be run should be a subclass of %s' % CronJobBase.__class__
raise Exception('The cron_job to be run should be a subclass of %s' % CronJobBase.__class__)
if CronJobManager.__should_run_now(cron_job, force):
logging.debug("Running cron: %s" % cron_job)
cron_log = CronJobLog(code=cron_job.code, start_time=timezone.now())
Expand All @@ -98,7 +98,7 @@ def run(self, cron_job, force=False, silent=False):
except Exception:
error = traceback.format_exc()
if not silent:
print error
print(error)
cron_log.is_success = False
cron_log.message = error[-1000:]
cron_log.ran_at_time = self.user_time if self.user_time else None
Expand Down
6 changes: 3 additions & 3 deletions django_cron/management/commands/runcrons.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def handle(self, *args, **options):
crons_to_run = map(lambda x: get_class(x), cron_class_names)
except:
error = traceback.format_exc()
print 'Make sure these are valid cron class names: %s\n%s' % (cron_class_names, error)
print('Make sure these are valid cron class names: %s\n%s' % (cron_class_names, error))
sys.exit()

for cron_class in crons_to_run:
Expand All @@ -79,5 +79,5 @@ def run_cron_with_cache_check(cron_class, force=False, silent=False):
cache.delete(cron_class.__name__)
else:
if not silent:
print "%s failed: lock has been found. Other cron started at %s" % \
(cron_class.__name__, cache.get(cron_class.__name__))
print("%s failed: lock has been found. Other cron started at %s" % \
(cron_class.__name__, cache.get(cron_class.__name__)))
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

setup(
name='django-cron',
version='0.3.2',
version='0.3.3',
author='Sumit Chachra',
author_email='[email protected]',
url='http://github.com/tivix/django-cron',
Expand Down

0 comments on commit ef80810

Please sign in to comment.