From 33b28c55989c66e23200e43e75f16c16ae25ee7d Mon Sep 17 00:00:00 2001 From: Jan Dittberner Date: Mon, 29 Dec 2014 12:59:14 +0100 Subject: [PATCH 1/7] define celery timezone, restrict celery content to json --- gvafile/gvafile/settings/base.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gvafile/gvafile/settings/base.py b/gvafile/gvafile/settings/base.py index fc83245..4984ea6 100644 --- a/gvafile/gvafile/settings/base.py +++ b/gvafile/gvafile/settings/base.py @@ -286,7 +286,9 @@ CELERY_ROUTES = ( 'gvacommon.celeryrouters.LdapRouter', 'gvacommon.celeryrouters.FileRouter', ) -CELERY_ACCEPT_CONTENT = ['pickle', 'yaml', 'json'] +CELERY_TIMEZONE = 'Europe/Berlin' +CELERY_ENABLE_UTC = True +CELERY_ACCEPT_CONTENT = ['json'] CELERY_TASK_SERIALIZER = 'json' CELERY_RESULT_SERIALIZER = 'json' ########## END CELERY CONFIGURATION From 546441d49920caf43eb7d33976c2d71ae85f16d5 Mon Sep 17 00:00:00 2001 From: Jan Dittberner Date: Thu, 1 Jan 2015 22:32:37 +0100 Subject: [PATCH 2/7] unify routers, add support for mysql and pgsql tasks - add new celeryrouters.GvaRouter - remove LdapRouter and FileRouter --- .gitignore | 1 + celeryrouters.py | 23 +++++++---------------- 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/.gitignore b/.gitignore index 3bb2efd..5f1ace6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ .*.swp *.pyc +.ropeproject/ diff --git a/celeryrouters.py b/celeryrouters.py index e468813..ec7b122 100644 --- a/celeryrouters.py +++ b/celeryrouters.py @@ -2,23 +2,14 @@ from __future__ import unicode_literals -class LdapRouter(object): +class GvaRouter(object): def route_for_task(self, task, args=None, kwargs=None): - if 'ldap' in task: - return {'exchange': 'ldap', + for route in ['ldap', 'file', 'mysql', 'pgsql']: + if route in task: + return { + 'exchange': route, 'exchange_type': 'direct', - 'queue': 'ldap'} + 'queue': route, + } return None - - -class FileRouter(object): - - def route_for_task(self, task, args=None, kwargs=None): - if 'file' in task: - return {'exchange': 'file', - 'exchange_type': 'direct', - 'queue': 'file'} - return None - - From 64688933fa8ee945a817bdf72c47ba385368c715 Mon Sep 17 00:00:00 2001 From: Jan Dittberner Date: Thu, 1 Jan 2015 22:37:39 +0100 Subject: [PATCH 3/7] fix typo --- docs/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index ee786a2..12d1951 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -242,7 +242,7 @@ man_pages = [ # dir menu entry, description, category) texinfo_documents = [ ('index', 'gvafile', u'gvafile Documentation', - u'Jan Dittberner', 'gvafile', 'GNUViech admin filserver tools.', + u'Jan Dittberner', 'gvafile', 'GNUViech admin fileserver tools.', 'Miscellaneous'), ] From 800fff8908d6efe6e459bded943218bd2fedb98f Mon Sep 17 00:00:00 2001 From: Jan Dittberner Date: Thu, 1 Jan 2015 22:38:38 +0100 Subject: [PATCH 4/7] switch to gvacommon.celeryrouters.GvaRouter --- gvafile/gvafile/settings/base.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gvafile/gvafile/settings/base.py b/gvafile/gvafile/settings/base.py index 4984ea6..ea656d4 100644 --- a/gvafile/gvafile/settings/base.py +++ b/gvafile/gvafile/settings/base.py @@ -283,8 +283,7 @@ CELERY_RESULT_BACKEND = 'amqp' CELERY_RESULT_PERSISTENT = True CELERY_TASK_RESULT_EXPIRES = None CELERY_ROUTES = ( - 'gvacommon.celeryrouters.LdapRouter', - 'gvacommon.celeryrouters.FileRouter', + 'gvacommon.celeryrouters.GvaRouter', ) CELERY_TIMEZONE = 'Europe/Berlin' CELERY_ENABLE_UTC = True From cfc023cb14767ff733f0a2d27a3c11eb0b0150c2 Mon Sep 17 00:00:00 2001 From: Jan Dittberner Date: Mon, 19 Jan 2015 22:00:48 +0100 Subject: [PATCH 5/7] move tasks from osusers to fileservertasks.tasks --- gvafile/fileservertasks/__init__.py | 4 ++++ gvafile/{osusers => fileservertasks}/tasks.py | 0 gvafile/gvafile/settings/base.py | 2 +- gvafile/osusers/__init__.py | 3 --- gvafile/osusers/models.py | 3 --- 5 files changed, 5 insertions(+), 7 deletions(-) create mode 100644 gvafile/fileservertasks/__init__.py rename gvafile/{osusers => fileservertasks}/tasks.py (100%) delete mode 100644 gvafile/osusers/__init__.py delete mode 100644 gvafile/osusers/models.py diff --git a/gvafile/fileservertasks/__init__.py b/gvafile/fileservertasks/__init__.py new file mode 100644 index 0000000..cb2d3eb --- /dev/null +++ b/gvafile/fileservertasks/__init__.py @@ -0,0 +1,4 @@ +""" +This module contains :py:mod:`fileservertasks.tasks`. + +""" diff --git a/gvafile/osusers/tasks.py b/gvafile/fileservertasks/tasks.py similarity index 100% rename from gvafile/osusers/tasks.py rename to gvafile/fileservertasks/tasks.py diff --git a/gvafile/gvafile/settings/base.py b/gvafile/gvafile/settings/base.py index ea656d4..81901a9 100644 --- a/gvafile/gvafile/settings/base.py +++ b/gvafile/gvafile/settings/base.py @@ -224,7 +224,7 @@ DJANGO_APPS = ( # Apps specific for this project go here. LOCAL_APPS = ( - 'osusers', + 'fileservertasks', ) # See: https://docs.djangoproject.com/en/dev/ref/settings/#installed-apps diff --git a/gvafile/osusers/__init__.py b/gvafile/osusers/__init__.py deleted file mode 100644 index b960717..0000000 --- a/gvafile/osusers/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -""" -This module contains :py:mod:`osusers.tasks`. -""" diff --git a/gvafile/osusers/models.py b/gvafile/osusers/models.py deleted file mode 100644 index d1ff455..0000000 --- a/gvafile/osusers/models.py +++ /dev/null @@ -1,3 +0,0 @@ -""" -Empty models module required for Django to accept this as an app. -""" From 70977c5a610e31eedfe90c83389f8b5a37732e2c Mon Sep 17 00:00:00 2001 From: Jan Dittberner Date: Mon, 19 Jan 2015 22:05:57 +0100 Subject: [PATCH 6/7] adapt documentation to changed package structure --- docs/changelog.rst | 2 ++ docs/code.rst | 48 +++++++++++++++++++++++----------------------- 2 files changed, 26 insertions(+), 24 deletions(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index 8d24e5c..8a080fd 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -1,6 +1,8 @@ Changelog ========= +* :support:`-` refactor osusers.tasks, move to fileservertasks.tasks + * :release:`0.2.0 <2014-12-27>` * :support:`-` restrict permissions of mailbox base directories to be read only * :feature:`-` add new mailbox handling tasks diff --git a/docs/code.rst b/docs/code.rst index 227508a..aafd591 100644 --- a/docs/code.rst +++ b/docs/code.rst @@ -16,67 +16,67 @@ The project module :py:mod:`gvafile` .. automodule:: gvafile -:py:mod:`gvafile.celery` ------------------------- +:py:mod:`celery ` +--------------------------------- .. automodule:: gvafile.celery :members: -:py:mod:`gvafile.urls` ----------------------- +:py:mod:`urls ` +----------------------------- .. automodule:: gvafile.urls -:py:mod:`gvafile.exceptions` ----------------------------- +:py:mod:`exceptions ` +----------------------------------------- .. automodule:: gvafile.exceptions -:py:mod:`gvafile.wsgi` ----------------------- +:py:mod:`wsgi ` +----------------------------- .. automodule:: gvafile.wsgi :members: -:py:mod:`gvafile.settings` --------------------------- +:py:mod:`settings ` +------------------------------------- .. automodule:: gvafile.settings -:py:mod:`gvafile.settings.base` -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +:py:mod:`base ` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. automodule:: gvafile.settings.base :members: -:py:mod:`gvafile.settings.local` -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +:py:mod:`local ` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. automodule:: gvafile.settings.local -:py:mod:`gvafile.settings.production` -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +:py:mod:`production ` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. automodule:: gvafile.settings.production -:py:mod:`gvafile.settings.test` -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +:py:mod:`test ` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. automodule:: gvafile.settings.test -:py:mod:`osusers` app -===================== +:py:mod:`filservertasks` app +============================ -.. automodule:: osusers +.. automodule:: fileservertasks -:py:mod:`osusers.tasks` ------------------------ +:py:mod:`tasks ` +--------------------------------------- -.. automodule:: osusers.tasks +.. automodule:: fileservertasks.tasks :members: :undoc-members: From 7f4247bf769623c0f1be80b79357f5e6906b2234 Mon Sep 17 00:00:00 2001 From: Jan Dittberner Date: Mon, 19 Jan 2015 22:25:42 +0100 Subject: [PATCH 7/7] update changelog, add release version --- LICENSE.txt | 2 +- docs/changelog.rst | 1 + docs/conf.py | 6 +++--- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/LICENSE.txt b/LICENSE.txt index 8c51745..96e8baa 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,4 +1,4 @@ -Copyright (c) 2014 Jan Dittberner +Copyright (c) 2014, 2015 Jan Dittberner Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation diff --git a/docs/changelog.rst b/docs/changelog.rst index 8a080fd..496e4fc 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -1,6 +1,7 @@ Changelog ========= +* :release:`0.3.0 <2015-01-19>` * :support:`-` refactor osusers.tasks, move to fileservertasks.tasks * :release:`0.2.0 <2014-12-27>` diff --git a/docs/conf.py b/docs/conf.py index 12d1951..279711e 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -55,16 +55,16 @@ master_doc = 'index' # General information about the project. project = u'gvafile' -copyright = u'2014, Jan Dittberner' +copyright = u'2014, 2015 Jan Dittberner' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # # The short X.Y version. -version = '0.2.0' +version = '0.3' # The full version, including alpha/beta/rc tags. -release = '0.2.0' +release = '0.3.0' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages.