]> git.ipfire.org Git - thirdparty/patchwork.git/commitdiff
Move to a more recent django project structure
authorJeremy Kerr <jk@ozlabs.org>
Sun, 24 May 2015 08:57:33 +0000 (16:57 +0800)
committerJeremy Kerr <jk@ozlabs.org>
Wed, 27 May 2015 02:26:41 +0000 (10:26 +0800)
This change updates patchwor to the newer project struture: we've moved
the actual application out of the apps/ directory, and the
patchwork-specific templates to under the patchwork application.

This gives us the manage.py script in the top-level now.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
120 files changed:
apps/patchwork/templatetags/__init__.py [deleted file]
docs/HACKING
docs/INSTALL
lib/apache2/patchwork.mod_python.conf
lib/apache2/patchwork.wsgi
manage.py [moved from apps/manage.py with 100% similarity]
patchwork/__init__.py [moved from apps/__init__.py with 100% similarity]
patchwork/admin.py [moved from apps/patchwork/admin.py with 100% similarity]
patchwork/bin/__init__.py [moved from apps/patchwork/__init__.py with 100% similarity]
patchwork/bin/bash_completion [moved from apps/patchwork/bin/bash_completion with 100% similarity]
patchwork/bin/parsemail-batch.sh [moved from apps/patchwork/bin/parsemail-batch.sh with 100% similarity]
patchwork/bin/parsemail.py [moved from apps/patchwork/bin/parsemail.py with 100% similarity]
patchwork/bin/parsemail.sh [moved from apps/patchwork/bin/parsemail.sh with 83% similarity]
patchwork/bin/patchwork-cron.py [moved from apps/patchwork/bin/patchwork-cron.py with 100% similarity]
patchwork/bin/pwclient [moved from apps/patchwork/bin/pwclient with 100% similarity]
patchwork/bin/rehash.py [moved from apps/patchwork/bin/rehash.py with 100% similarity]
patchwork/bin/update-patchwork-status.py [moved from apps/patchwork/bin/update-patchwork-status.py with 100% similarity]
patchwork/context_processors.py [moved from apps/patchwork/context_processors.py with 100% similarity]
patchwork/filters.py [moved from apps/patchwork/filters.py with 100% similarity]
patchwork/fixtures/default_projects.xml [moved from apps/patchwork/fixtures/default_projects.xml with 100% similarity]
patchwork/fixtures/initial_data.xml [moved from apps/patchwork/fixtures/initial_data.xml with 100% similarity]
patchwork/forms.py [moved from apps/patchwork/forms.py with 100% similarity]
patchwork/models.py [moved from apps/patchwork/models.py with 100% similarity]
patchwork/paginator.py [moved from apps/patchwork/paginator.py with 100% similarity]
patchwork/parser.py [moved from apps/patchwork/parser.py with 100% similarity]
patchwork/requestcontext.py [moved from apps/patchwork/requestcontext.py with 100% similarity]
patchwork/settings/__init__.py [moved from apps/patchwork/bin/__init__.py with 100% similarity]
patchwork/settings/base.py [moved from apps/patchwork/settings/base.py with 97% similarity]
patchwork/settings/dev.py [moved from apps/patchwork/settings/dev.py with 100% similarity]
patchwork/settings/prod.py [moved from apps/patchwork/settings/prod.py with 100% similarity]
patchwork/templates/patchwork/activation_email.txt [moved from templates/patchwork/activation_email.txt with 100% similarity]
patchwork/templates/patchwork/activation_email_subject.txt [moved from templates/patchwork/activation_email_subject.txt with 100% similarity]
patchwork/templates/patchwork/bundle.html [moved from templates/patchwork/bundle.html with 100% similarity]
patchwork/templates/patchwork/bundles.html [moved from templates/patchwork/bundles.html with 100% similarity]
patchwork/templates/patchwork/confirm-error.html [moved from templates/patchwork/confirm-error.html with 100% similarity]
patchwork/templates/patchwork/filters.html [moved from templates/patchwork/filters.html with 100% similarity]
patchwork/templates/patchwork/help/about.html [moved from templates/patchwork/help/about.html with 100% similarity]
patchwork/templates/patchwork/help/index.html [moved from templates/patchwork/help/index.html with 100% similarity]
patchwork/templates/patchwork/help/pwclient.html [moved from templates/patchwork/help/pwclient.html with 100% similarity]
patchwork/templates/patchwork/list.html [moved from templates/patchwork/list.html with 100% similarity]
patchwork/templates/patchwork/login.html [moved from templates/patchwork/login.html with 100% similarity]
patchwork/templates/patchwork/logout.html [moved from templates/patchwork/logout.html with 100% similarity]
patchwork/templates/patchwork/mail-form.html [moved from templates/patchwork/mail-form.html with 100% similarity]
patchwork/templates/patchwork/mail-settings.html [moved from templates/patchwork/mail-settings.html with 100% similarity]
patchwork/templates/patchwork/optin-request.html [moved from templates/patchwork/optin-request.html with 100% similarity]
patchwork/templates/patchwork/optin-request.mail [moved from templates/patchwork/optin-request.mail with 100% similarity]
patchwork/templates/patchwork/optin.html [moved from templates/patchwork/optin.html with 100% similarity]
patchwork/templates/patchwork/optout-request.html [moved from templates/patchwork/optout-request.html with 100% similarity]
patchwork/templates/patchwork/optout-request.mail [moved from templates/patchwork/optout-request.mail with 100% similarity]
patchwork/templates/patchwork/optout.html [moved from templates/patchwork/optout.html with 100% similarity]
patchwork/templates/patchwork/pagination.html [moved from templates/patchwork/pagination.html with 100% similarity]
patchwork/templates/patchwork/patch-change-notification-subject.text [moved from templates/patchwork/patch-change-notification-subject.text with 100% similarity]
patchwork/templates/patchwork/patch-change-notification.mail [moved from templates/patchwork/patch-change-notification.mail with 100% similarity]
patchwork/templates/patchwork/patch-list.html [moved from templates/patchwork/patch-list.html with 100% similarity]
patchwork/templates/patchwork/patch.html [moved from templates/patchwork/patch.html with 100% similarity]
patchwork/templates/patchwork/profile.html [moved from templates/patchwork/profile.html with 100% similarity]
patchwork/templates/patchwork/project.html [moved from templates/patchwork/project.html with 100% similarity]
patchwork/templates/patchwork/projects.html [moved from templates/patchwork/projects.html with 100% similarity]
patchwork/templates/patchwork/pwclient [new symlink]
patchwork/templates/patchwork/pwclientrc [moved from templates/patchwork/pwclientrc with 100% similarity]
patchwork/templates/patchwork/register.mail [moved from templates/patchwork/register.mail with 100% similarity]
patchwork/templates/patchwork/registration-confirm.html [moved from templates/patchwork/registration-confirm.html with 100% similarity]
patchwork/templates/patchwork/registration_form.html [moved from templates/patchwork/registration_form.html with 100% similarity]
patchwork/templates/patchwork/todo-list.html [moved from templates/patchwork/todo-list.html with 100% similarity]
patchwork/templates/patchwork/todo-lists.html [moved from templates/patchwork/todo-lists.html with 100% similarity]
patchwork/templates/patchwork/user-link-confirm.html [moved from templates/patchwork/user-link-confirm.html with 100% similarity]
patchwork/templates/patchwork/user-link.html [moved from templates/patchwork/user-link.html with 100% similarity]
patchwork/templates/patchwork/user-link.mail [moved from templates/patchwork/user-link.mail with 100% similarity]
patchwork/templatetags/__init__.py [moved from apps/patchwork/settings/__init__.py with 100% similarity]
patchwork/templatetags/filter.py [moved from apps/patchwork/templatetags/filter.py with 100% similarity]
patchwork/templatetags/listurl.py [moved from apps/patchwork/templatetags/listurl.py with 100% similarity]
patchwork/templatetags/order.py [moved from apps/patchwork/templatetags/order.py with 100% similarity]
patchwork/templatetags/patch.py [moved from apps/patchwork/templatetags/patch.py with 100% similarity]
patchwork/templatetags/person.py [moved from apps/patchwork/templatetags/person.py with 100% similarity]
patchwork/templatetags/pwurl.py [moved from apps/patchwork/templatetags/pwurl.py with 100% similarity]
patchwork/templatetags/syntax.py [moved from apps/patchwork/templatetags/syntax.py with 100% similarity]
patchwork/tests/__init__.py [moved from apps/patchwork/tests/__init__.py with 100% similarity]
patchwork/tests/mail/0001-git-pull-request.mbox [moved from apps/patchwork/tests/mail/0001-git-pull-request.mbox with 100% similarity]
patchwork/tests/mail/0002-git-pull-request-wrapped.mbox [moved from apps/patchwork/tests/mail/0002-git-pull-request-wrapped.mbox with 100% similarity]
patchwork/tests/mail/0003-git-pull-request-with-diff.mbox [moved from apps/patchwork/tests/mail/0003-git-pull-request-with-diff.mbox with 100% similarity]
patchwork/tests/mail/0004-git-pull-request-git+ssh.mbox [moved from apps/patchwork/tests/mail/0004-git-pull-request-git+ssh.mbox with 100% similarity]
patchwork/tests/mail/0005-git-pull-request-ssh.mbox [moved from apps/patchwork/tests/mail/0005-git-pull-request-ssh.mbox with 100% similarity]
patchwork/tests/mail/0006-git-pull-request-http.mbox [moved from apps/patchwork/tests/mail/0006-git-pull-request-http.mbox with 100% similarity]
patchwork/tests/mail/0007-cvs-format-diff.mbox [moved from apps/patchwork/tests/mail/0007-cvs-format-diff.mbox with 100% similarity]
patchwork/tests/mail/0008-git-rename.mbox [moved from apps/patchwork/tests/mail/0008-git-rename.mbox with 100% similarity]
patchwork/tests/mail/0009-git-rename-with-diff.mbox [moved from apps/patchwork/tests/mail/0009-git-rename-with-diff.mbox with 100% similarity]
patchwork/tests/mail/0010-invalid-charset.mbox [moved from apps/patchwork/tests/mail/0010-invalid-charset.mbox with 100% similarity]
patchwork/tests/mail/0011-no-newline-at-end-of-file.mbox [moved from apps/patchwork/tests/mail/0011-no-newline-at-end-of-file.mbox with 100% similarity]
patchwork/tests/patches/0001-add-line.patch [moved from apps/patchwork/tests/patches/0001-add-line.patch with 100% similarity]
patchwork/tests/patches/0002-utf-8.patch [moved from apps/patchwork/tests/patches/0002-utf-8.patch with 100% similarity]
patchwork/tests/test_bundles.py [moved from apps/patchwork/tests/test_bundles.py with 100% similarity]
patchwork/tests/test_confirm.py [moved from apps/patchwork/tests/test_confirm.py with 100% similarity]
patchwork/tests/test_encodings.py [moved from apps/patchwork/tests/test_encodings.py with 100% similarity]
patchwork/tests/test_expiry.py [moved from apps/patchwork/tests/test_expiry.py with 100% similarity]
patchwork/tests/test_filters.py [moved from apps/patchwork/tests/test_filters.py with 100% similarity]
patchwork/tests/test_list.py [moved from apps/patchwork/tests/test_list.py with 100% similarity]
patchwork/tests/test_mail_settings.py [moved from apps/patchwork/tests/test_mail_settings.py with 100% similarity]
patchwork/tests/test_mboxviews.py [moved from apps/patchwork/tests/test_mboxviews.py with 100% similarity]
patchwork/tests/test_notifications.py [moved from apps/patchwork/tests/test_notifications.py with 100% similarity]
patchwork/tests/test_patchparser.py [moved from apps/patchwork/tests/test_patchparser.py with 100% similarity]
patchwork/tests/test_person.py [moved from apps/patchwork/tests/test_person.py with 100% similarity]
patchwork/tests/test_registration.py [moved from apps/patchwork/tests/test_registration.py with 100% similarity]
patchwork/tests/test_updates.py [moved from apps/patchwork/tests/test_updates.py with 100% similarity]
patchwork/tests/test_user.py [moved from apps/patchwork/tests/test_user.py with 100% similarity]
patchwork/tests/test_xmlrpc.py [moved from apps/patchwork/tests/test_xmlrpc.py with 100% similarity]
patchwork/tests/utils.py [moved from apps/patchwork/tests/utils.py with 100% similarity]
patchwork/urls.py [moved from apps/patchwork/urls.py with 100% similarity]
patchwork/utils.py [moved from apps/patchwork/utils.py with 100% similarity]
patchwork/views/__init__.py [moved from apps/patchwork/views/__init__.py with 100% similarity]
patchwork/views/base.py [moved from apps/patchwork/views/base.py with 100% similarity]
patchwork/views/bundle.py [moved from apps/patchwork/views/bundle.py with 100% similarity]
patchwork/views/mail.py [moved from apps/patchwork/views/mail.py with 100% similarity]
patchwork/views/patch.py [moved from apps/patchwork/views/patch.py with 100% similarity]
patchwork/views/project.py [moved from apps/patchwork/views/project.py with 100% similarity]
patchwork/views/user.py [moved from apps/patchwork/views/user.py with 100% similarity]
patchwork/views/xmlrpc.py [moved from apps/patchwork/views/xmlrpc.py with 100% similarity]
templates/patchwork/pwclient [deleted symlink]
tools/patchwork-update-commits
tools/post-receive.hook
tox.ini

diff --git a/apps/patchwork/templatetags/__init__.py b/apps/patchwork/templatetags/__init__.py
deleted file mode 100644 (file)
index e69de29..0000000
index cab59eb7496f1dd347488c36e408c74069a8ca83..c1b478efe5be6734034076dd3316091337262acf 100644 (file)
@@ -43,9 +43,9 @@ It's always a good idea to use virtualenv to develop python software.
 
 5. Now one can run patchwork within that environment
 
-   (django-1.7)$ ./apps/manage.py --version
+   (django-1.7)$ ./manage.py --version
    1.7
-   (django-1.7)$ ./apps/manage.py runserver
+   (django-1.7)$ ./manage.py runserver
 
 6. To exit the virtual environment
 
index 16ab2b5983a3cc3ebc28d3c1f85728199ee0174c..b006178c5e4d63bb9aff9ed85f174bf6b9b32a74 100644 (file)
@@ -135,8 +135,7 @@ in brackets):
 
     Then, get patchwork to create its tables in your configured database:
 
-     cd apps/
-     PYTHONPATH=../lib/python ./manage.py syncdb
+     PYTHONPATH=lib/python ./manage.py syncdb
 
     And add privileges for your mail and web users. This is only needed if
     you use the ident-based approach. If you use password-based database
@@ -190,7 +189,7 @@ in brackets):
 
         Once you have apache set up, you can start the fastcgi server with:
 
-          cd /srv/patchwork/apps
+          cd /srv/patchwork/
           ./manage.py runfcgi method=prefork \
                               socket=/srv/patchwork/var/fcgi.sock \
                               pidfile=/srv/patchwork/var/fcgi.pid
@@ -222,14 +221,14 @@ in brackets):
     directory. (Note, do not use the parsemail.py script directly). Something
     like this in /etc/aliases is suitable for postfix:
 
-      patchwork: "|/srv/patchwork/apps/patchwork/bin/parsemail.sh"
+      patchwork: "|/srv/patchwork/patchwork/bin/parsemail.sh"
 
     You may need to customise the parsemail.sh script if you haven't installed
     patchwork in /srv/patchwork.
 
     Test that you can deliver a patch to this script:
 
-     sudo -u nobody /srv/patchwork/apps/patchwork/bin/parsemail.sh < mail
+     sudo -u nobody /srv/patchwork/patchwork/bin/parsemail.sh < mail
 
 
 7. Set up the patchwork cron script
@@ -240,9 +239,9 @@ in brackets):
     Something like this in your crontab should work:
 
       # m h  dom mon dow   command
-      PYTHONPATH=apps:.
+      PYTHONPATH=.
       DJANGO_SETTINGS_MODULE=settings
-      */10 * * * * cd patchwork; python apps/patchwork/bin/patchwork-cron.py
+      */10 * * * * cd patchwork; python patchwork/bin/patchwork-cron.py
 
 
     - the frequency should be the same as the NOTIFICATION_DELAY_MINUTES
index 639573852441aa166648b7d36af9fa25ac5e4d0e..c46f86cda0390206704492427347ab37a3004d65 100644 (file)
@@ -7,7 +7,7 @@ NameVirtualHost patchwork.example.com:80
        <Location "/">
            SetHandler python-program
            PythonHandler django.core.handlers.modpython
-           PythonPath "['/srv/patchwork/apps', '/srv/patchwork/lib/python'] + sys.path"
+           PythonPath "['/srv/patchwork', '/srv/patchwork/lib/python'] + sys.path"
            SetEnv DJANGO_SETTINGS_MODULE settings
        </Location>
 
index 869bb9de6c147e73dadc5ab998905a8ddb2948fb..52feb5863066c1972ca4a73c571d562816a916d9 100644 (file)
@@ -12,8 +12,7 @@ import sys
 basedir = os.path.join(
     os.path.dirname(__file__), os.path.pardir, os.path.pardir)
 sys.path.append(basedir)
-sys.path.append(os.path.join(basedir, 'apps'))
 
-os.environ['DJANGO_SETTINGS_MODULE'] = 'apps.settings'
+os.environ['DJANGO_SETTINGS_MODULE'] = 'patchwork.settings.prod'
 import django.core.handlers.wsgi
 application = django.core.handlers.wsgi.WSGIHandler()
similarity index 100%
rename from apps/manage.py
rename to manage.py
similarity index 100%
rename from apps/__init__.py
rename to patchwork/__init__.py
similarity index 100%
rename from apps/patchwork/admin.py
rename to patchwork/admin.py
similarity index 83%
rename from apps/patchwork/bin/parsemail.sh
rename to patchwork/bin/parsemail.sh
index 246c2a168ebde4d0ac5a3cd521152465d10e5b28..d9ad0053c030289cabc585c8c7c4c482dbf77619 100755 (executable)
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
 BIN_DIR=`dirname $0`
-PATCHWORK_BASE=`readlink -e $BIN_DIR/../../..`
+PATCHWORK_BASE=`readlink -e $BIN_DIR/../..`
 
-PYTHONPATH="$PATCHWORK_BASE/apps":"$PATCHWORK_BASE/lib/python:$PYTHONPATH" \
+PYTHONPATH="$PATCHWORK_BASE":"$PATCHWORK_BASE/lib/python:$PYTHONPATH" \
         DJANGO_SETTINGS_MODULE=settings \
-        "$PATCHWORK_BASE/apps/patchwork/bin/parsemail.py"
+        "$PATCHWORK_BASE/patchwork/bin/parsemail.py"
 
 exit 0
similarity index 100%
rename from apps/patchwork/forms.py
rename to patchwork/forms.py
similarity index 100%
rename from apps/patchwork/models.py
rename to patchwork/models.py
similarity index 100%
rename from apps/patchwork/parser.py
rename to patchwork/parser.py
similarity index 97%
rename from apps/patchwork/settings/base.py
rename to patchwork/settings/base.py
index 5440de67befb72f97be2f88a080eb1562b2b1704..9b52989da8bfabd04107fb655fe111140df57857 100644 (file)
@@ -7,7 +7,7 @@ import os
 import django
 
 ROOT_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)),
-                        os.pardir, os.pardir, os.pardir)
+                        os.pardir, os.pardir)
 
 #
 # Core settings
diff --git a/patchwork/templates/patchwork/pwclient b/patchwork/templates/patchwork/pwclient
new file mode 120000 (symlink)
index 0000000..5ce255f
--- /dev/null
@@ -0,0 +1 @@
+../../bin/pwclient
\ No newline at end of file
similarity index 100%
rename from apps/patchwork/urls.py
rename to patchwork/urls.py
similarity index 100%
rename from apps/patchwork/utils.py
rename to patchwork/utils.py
diff --git a/templates/patchwork/pwclient b/templates/patchwork/pwclient
deleted file mode 120000 (symlink)
index ae4faf3..0000000
+++ /dev/null
@@ -1 +0,0 @@
-../../apps/patchwork/bin/pwclient
\ No newline at end of file
index b2a658afdb3947c03eb7b32373621d28aac13af8..820fd1cabf9b1dfdb2ff4f9b0b945c5db3803885 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/bash
 
 toolsdir="$(dirname "$0")"
-pwpath="${toolsdir}"/../apps/patchwork
+pwpath="${toolsdir}"/../patchwork
 
 if [ "$#" -lt 1 ]
 then
index a38522e22f350693957281659347f39cbcca44da..8f05b8d85dc3e98c3c63a4a3ca0b813ae26e79c8 100755 (executable)
@@ -15,7 +15,7 @@ STATE_MAP="refs/heads/master:Accepted"
 #
 EXCLUDE=""
 
-PWDIR=/srv/patchwork/apps/patchwork
+PWDIR=/srv/patchwork/patchwork
 
 do_exit=0
 trap "do_exit=1" INT
diff --git a/tox.ini b/tox.ini
index 8d99e6a8176ee46e0936a47b427f1487862881e1..485f7c7acfa292847ab297e442fce0f11f3eba24 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -8,14 +8,14 @@ commands = flake8 {posargs}
 
 [flake8]
 ignore = E121,E122,E123,E124,E125,E126,E127,E128,E129,E131,E251,H405
-exclude = ./apps/patchwork/tests
+exclude = ./patchwork/tests
 
 [testenv:lint]
 basepython = python2.7
 deps =
     pylint
     -r{toxinidir}/docs/requirements-django-1.7-mysql.txt
-commands = pylint apps --rcfile=pylint.rc
+commands = pylint patchwork --rcfile=pylint.rc
 
 [testenv:coverage]
 basepython = python2.7
@@ -26,16 +26,16 @@ setenv =
     DJANGO_SETTINGS_MODULE = patchwork.settings.dev
 commands =
     coverage erase
-    {toxinidir}/apps/manage.py syncdb
-    coverage run --omit=*tox* --branch {toxinidir}/apps/manage.py test patchwork
+    {toxinidir}/manage.py syncdb
+    coverage run --omit=*tox* --branch {toxinidir}/manage.py test patchwork
     coverage report -m
 
 [testenv]
 basepython =
     py27: python2.7
 commands =
-    {toxinidir}/apps/manage.py syncdb
-    {toxinidir}/apps/manage.py test patchwork
+    {toxinidir}/manage.py syncdb
+    {toxinidir}/manage.py test patchwork
 deps =
     python-dateutil==1.5
     MySQL-python==1.2.5