From ebb54b0b36148140dad067e00ee8f77900086e89 Mon Sep 17 00:00:00 2001 From: Antony Chazapis Date: Thu, 24 Nov 2011 12:01:47 +0200 Subject: [PATCH] Merge public app into api. Fixes $1678 --- README.upgrade | 2 +- pithos/{public/functions.py => api/public.py} | 1 + pithos/public/models.py | 3 -- pithos/public/urls.py | 39 ------------------------- pithos/public/views.py | 1 - pithos/settings.py.dist | 1 - pithos/urls.py | 2 +- 7 files changed, 3 insertions(+), 46 deletions(-) rename pithos/{public/functions.py => api/public.py} (99%) delete mode 100644 pithos/public/__init__.py delete mode 100644 pithos/public/models.py delete mode 100644 pithos/public/urls.py delete mode 100644 pithos/public/views.py diff --git a/README.upgrade b/README.upgrade index 3f6f39b..4ab21fe 100644 --- a/README.upgrade +++ b/README.upgrade @@ -14,8 +14,8 @@ UPGRADE 0.7.10 -> 0.7.11 ---------------- +* Add 'south', remove 'pithos.public' in INSTALLED_APPS in settings.py * Install python-django-south -* Add 'south' in INSTALLED_APPS in settings.py * Setup south: python manage.py syncdb python manage.py migrate im 0001 --fake diff --git a/pithos/public/functions.py b/pithos/api/public.py similarity index 99% rename from pithos/public/functions.py rename to pithos/api/public.py index fc14068..86191df 100644 --- a/pithos/public/functions.py +++ b/pithos/api/public.py @@ -88,6 +88,7 @@ def public_read(request, v_public): # badRequest (400), # notModified (304) + print '***', v_public try: v_account, v_container, v_object = request.backend.get_public(request.user_uniq, decode_url(v_public)) diff --git a/pithos/public/__init__.py b/pithos/public/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/pithos/public/models.py b/pithos/public/models.py deleted file mode 100644 index 71a8362..0000000 --- a/pithos/public/models.py +++ /dev/null @@ -1,3 +0,0 @@ -from django.db import models - -# Create your models here. diff --git a/pithos/public/urls.py b/pithos/public/urls.py deleted file mode 100644 index 613ed3e..0000000 --- a/pithos/public/urls.py +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright 2011 GRNET S.A. All rights reserved. -# -# Redistribution and use in source and binary forms, with or -# without modification, are permitted provided that the following -# conditions are met: -# -# 1. Redistributions of source code must retain the above -# copyright notice, this list of conditions and the following -# disclaimer. -# -# 2. Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following -# disclaimer in the documentation and/or other materials -# provided with the distribution. -# -# THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS -# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF -# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED -# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. -# -# The views and conclusions contained in the software and -# documentation are those of the authors and should not be -# interpreted as representing official policies, either expressed -# or implied, of GRNET S.A. - -from django.conf.urls.defaults import * - -urlpatterns = patterns('pithos.public.functions', - (r'^$', 'method_not_allowed'), - (r'^(?P.+?)/?$', 'public_demux') -) diff --git a/pithos/public/views.py b/pithos/public/views.py deleted file mode 100644 index 60f00ef..0000000 --- a/pithos/public/views.py +++ /dev/null @@ -1 +0,0 @@ -# Create your views here. diff --git a/pithos/settings.py.dist b/pithos/settings.py.dist index 1c791de..61855f2 100644 --- a/pithos/settings.py.dist +++ b/pithos/settings.py.dist @@ -153,7 +153,6 @@ INSTALLED_APPS = ( # 'django.contrib.admindocs', 'pithos.im', 'pithos.api', - 'pithos.public', 'pithos.ui', 'south' ) diff --git a/pithos/urls.py b/pithos/urls.py index dea4a01..17cc94b 100644 --- a/pithos/urls.py +++ b/pithos/urls.py @@ -37,7 +37,7 @@ from django.conf.urls.defaults import include, patterns urlpatterns = patterns('', (r'^v1(?:$|/)', include('pithos.api.urls')), (r'^v1\.0(?:$|/)', include('pithos.api.urls')), - (r'^public(?:$|/)', include('pithos.public.urls')), + (r'^public/(?P.+?)/?$', 'pithos.api.public.public_demux'), (r'^im/', include('pithos.im.urls')), (r'^ui', include('pithos.ui.urls')) ) -- 1.7.10.4