[odrs-web] Rename the Flask project directory to 'odrs'



commit e2b1feb751460e2805a0266f67de4df2c28cb2c4
Author: Richard Hughes <richard hughsie com>
Date:   Wed Jun 26 13:04:21 2019 +0100

    Rename the Flask project directory to 'odrs'
    
    This allows us to remove hacks where we needed to import modules from 'app' and
    also the instance 'app' itself.

 Dockerfile                                        |   2 +-
 app_data/cron.py                                  |   2 +-
 app_data/flaskapp.py                              |   2 +-
 app_data/httpd-cfg/odrs.gnome.org.conf            |   6 +++---
 app_data/httpd-pre-init/entrypoint.sh             |   2 +-
 app_data/{app => odrs}/__init__.py                |   4 ++--
 app_data/{app => odrs}/db.py                      |   0
 app_data/{app => odrs}/models.py                  |   0
 app_data/{app => odrs}/static/Chart.js            |   0
 app_data/{app => odrs}/static/app-page.png        | Bin
 app_data/{app => odrs}/static/gnome-logo.svg      |   0
 app_data/{app => odrs}/static/review-submit.png   | Bin
 app_data/{app => odrs}/static/robots.txt          |   0
 app_data/{app => odrs}/static/style.css           |   0
 app_data/{app => odrs}/templates/default.html     |   0
 app_data/{app => odrs}/templates/delete.html      |   0
 app_data/{app => odrs}/templates/distros.html     |   0
 app_data/{app => odrs}/templates/error.html       |   0
 app_data/{app => odrs}/templates/graph-month.html |   0
 app_data/{app => odrs}/templates/graph-year.html  |   0
 app_data/{app => odrs}/templates/index.html       |   0
 app_data/{app => odrs}/templates/login.html       |   0
 app_data/{app => odrs}/templates/modadmin.html    |   0
 app_data/{app => odrs}/templates/mods.html        |   0
 app_data/{app => odrs}/templates/oars.html        |   0
 app_data/{app => odrs}/templates/privacy.html     |   0
 app_data/{app => odrs}/templates/show-all.html    |   0
 app_data/{app => odrs}/templates/show.html        |   0
 app_data/{app => odrs}/templates/stats.html       |   0
 app_data/{app => odrs}/templates/users.html       |   0
 app_data/{app => odrs}/util.py                    |   0
 app_data/{app => odrs}/views.py                   |   2 +-
 app_data/{app => odrs}/views_admin.py             |   2 +-
 app_data/wsgi-scripts/odrs.wsgi                   |   2 +-
 34 files changed, 12 insertions(+), 12 deletions(-)
---
diff --git a/Dockerfile b/Dockerfile
index b3329ed..849174f 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -20,7 +20,7 @@ WORKDIR ${ODRS_HOME}
 
 COPY app_data ${ODRS_HOME}
 
-RUN python36 /opt/app-root/src/cron.py ratings /opt/app-root/src/app/static/ratings.json
+RUN python36 /opt/app-root/src/cron.py ratings /opt/app-root/src/odrs/static/ratings.json
 
 RUN chown -R 1000310000:0 ${ODRS_HOME} && \
     chmod -R 664 ${ODRS_HOME} && \
diff --git a/app_data/cron.py b/app_data/cron.py
index fff8b20..12b57fe 100755
--- a/app_data/cron.py
+++ b/app_data/cron.py
@@ -8,7 +8,7 @@
 import json
 import sys
 
-from app.db import Database, CursorError
+from odrs.db import Database, CursorError
 
 if __name__ == '__main__':
 
diff --git a/app_data/flaskapp.py b/app_data/flaskapp.py
index 43ee5c4..d516a1a 100755
--- a/app_data/flaskapp.py
+++ b/app_data/flaskapp.py
@@ -5,7 +5,7 @@
 #
 # SPDX-License-Identifier: GPL-3.0+
 
-from app import app
+from odrs import app
 
 if __name__ == '__main__':
     app.debug = True
diff --git a/app_data/httpd-cfg/odrs.gnome.org.conf b/app_data/httpd-cfg/odrs.gnome.org.conf
index 67bd749..8738aa9 100644
--- a/app_data/httpd-cfg/odrs.gnome.org.conf
+++ b/app_data/httpd-cfg/odrs.gnome.org.conf
@@ -7,8 +7,8 @@
     SSLCertificateFile /var/serving-cert/tls.crt
     SSLCertificateKeyFile /var/serving-cert/tls.key
 
-    Alias /static/ /opt/app-root/src/app/static
-    Alias /1.0/reviews/api/ratings /opt/app-root/src/app/static/ratings.json
+    Alias /static/ /opt/app-root/src/odrs/static
+    Alias /1.0/reviews/api/ratings /opt/app-root/src/odrs/static/ratings.json
 
     WSGIDaemonProcess odrs.gnome.org processes=10 threads=15 maximum-requests=100
     WSGIProcessGroup odrs.gnome.org
@@ -31,7 +31,7 @@
     </Location>
 </VirtualHost>
 
-<Directory "/opt/app-root/src/app/static">
+<Directory "/opt/app-root/src/odrs/static">
   AllowOverride None
 
   Require all granted
diff --git a/app_data/httpd-pre-init/entrypoint.sh b/app_data/httpd-pre-init/entrypoint.sh
index d04587b..62eedcf 100755
--- a/app_data/httpd-pre-init/entrypoint.sh
+++ b/app_data/httpd-pre-init/entrypoint.sh
@@ -5,4 +5,4 @@ sed -i "s/replace_odrs_username/${MYSQL_DB_USERNAME}/" ${HTTPD_CONFIGURATION_PAT
 sed -i "s/replace_odrs_password/${MYSQL_DB_PASSWORD}/" ${HTTPD_CONFIGURATION_PATH}/odrs.gnome.org.conf
 sed -i "s/replace_odrs_host/${MYSQL_DB_HOST}/" ${HTTPD_CONFIGURATION_PATH}/odrs.gnome.org.conf
 
-while true; do python36 /opt/app-root/src/cron.py ratings /opt/app-root/src/app/static/ratings.json ; sleep 
43200 ; done &
+while true; do python36 /opt/app-root/src/cron.py ratings /opt/app-root/src/odrs/static/ratings.json ; sleep 
43200 ; done &
diff --git a/app_data/app/__init__.py b/app_data/odrs/__init__.py
similarity index 95%
rename from app_data/app/__init__.py
rename to app_data/odrs/__init__.py
index 9539b92..3a372af 100644
--- a/app_data/app/__init__.py
+++ b/app_data/odrs/__init__.py
@@ -45,5 +45,5 @@ def error_page_not_found(msg=None):
     flash(msg)
     return render_template('error.html'), 404
 
-from app import views
-from app import views_admin
+from odrs import views
+from odrs import views_admin
diff --git a/app_data/app/db.py b/app_data/odrs/db.py
similarity index 100%
rename from app_data/app/db.py
rename to app_data/odrs/db.py
diff --git a/app_data/app/models.py b/app_data/odrs/models.py
similarity index 100%
rename from app_data/app/models.py
rename to app_data/odrs/models.py
diff --git a/app_data/app/static/Chart.js b/app_data/odrs/static/Chart.js
similarity index 100%
rename from app_data/app/static/Chart.js
rename to app_data/odrs/static/Chart.js
diff --git a/app_data/app/static/app-page.png b/app_data/odrs/static/app-page.png
similarity index 100%
rename from app_data/app/static/app-page.png
rename to app_data/odrs/static/app-page.png
diff --git a/app_data/app/static/gnome-logo.svg b/app_data/odrs/static/gnome-logo.svg
similarity index 100%
rename from app_data/app/static/gnome-logo.svg
rename to app_data/odrs/static/gnome-logo.svg
diff --git a/app_data/app/static/review-submit.png b/app_data/odrs/static/review-submit.png
similarity index 100%
rename from app_data/app/static/review-submit.png
rename to app_data/odrs/static/review-submit.png
diff --git a/app_data/app/static/robots.txt b/app_data/odrs/static/robots.txt
similarity index 100%
rename from app_data/app/static/robots.txt
rename to app_data/odrs/static/robots.txt
diff --git a/app_data/app/static/style.css b/app_data/odrs/static/style.css
similarity index 100%
rename from app_data/app/static/style.css
rename to app_data/odrs/static/style.css
diff --git a/app_data/app/templates/default.html b/app_data/odrs/templates/default.html
similarity index 100%
rename from app_data/app/templates/default.html
rename to app_data/odrs/templates/default.html
diff --git a/app_data/app/templates/delete.html b/app_data/odrs/templates/delete.html
similarity index 100%
rename from app_data/app/templates/delete.html
rename to app_data/odrs/templates/delete.html
diff --git a/app_data/app/templates/distros.html b/app_data/odrs/templates/distros.html
similarity index 100%
rename from app_data/app/templates/distros.html
rename to app_data/odrs/templates/distros.html
diff --git a/app_data/app/templates/error.html b/app_data/odrs/templates/error.html
similarity index 100%
rename from app_data/app/templates/error.html
rename to app_data/odrs/templates/error.html
diff --git a/app_data/app/templates/graph-month.html b/app_data/odrs/templates/graph-month.html
similarity index 100%
rename from app_data/app/templates/graph-month.html
rename to app_data/odrs/templates/graph-month.html
diff --git a/app_data/app/templates/graph-year.html b/app_data/odrs/templates/graph-year.html
similarity index 100%
rename from app_data/app/templates/graph-year.html
rename to app_data/odrs/templates/graph-year.html
diff --git a/app_data/app/templates/index.html b/app_data/odrs/templates/index.html
similarity index 100%
rename from app_data/app/templates/index.html
rename to app_data/odrs/templates/index.html
diff --git a/app_data/app/templates/login.html b/app_data/odrs/templates/login.html
similarity index 100%
rename from app_data/app/templates/login.html
rename to app_data/odrs/templates/login.html
diff --git a/app_data/app/templates/modadmin.html b/app_data/odrs/templates/modadmin.html
similarity index 100%
rename from app_data/app/templates/modadmin.html
rename to app_data/odrs/templates/modadmin.html
diff --git a/app_data/app/templates/mods.html b/app_data/odrs/templates/mods.html
similarity index 100%
rename from app_data/app/templates/mods.html
rename to app_data/odrs/templates/mods.html
diff --git a/app_data/app/templates/oars.html b/app_data/odrs/templates/oars.html
similarity index 100%
rename from app_data/app/templates/oars.html
rename to app_data/odrs/templates/oars.html
diff --git a/app_data/app/templates/privacy.html b/app_data/odrs/templates/privacy.html
similarity index 100%
rename from app_data/app/templates/privacy.html
rename to app_data/odrs/templates/privacy.html
diff --git a/app_data/app/templates/show-all.html b/app_data/odrs/templates/show-all.html
similarity index 100%
rename from app_data/app/templates/show-all.html
rename to app_data/odrs/templates/show-all.html
diff --git a/app_data/app/templates/show.html b/app_data/odrs/templates/show.html
similarity index 100%
rename from app_data/app/templates/show.html
rename to app_data/odrs/templates/show.html
diff --git a/app_data/app/templates/stats.html b/app_data/odrs/templates/stats.html
similarity index 100%
rename from app_data/app/templates/stats.html
rename to app_data/odrs/templates/stats.html
diff --git a/app_data/app/templates/users.html b/app_data/odrs/templates/users.html
similarity index 100%
rename from app_data/app/templates/users.html
rename to app_data/odrs/templates/users.html
diff --git a/app_data/app/util.py b/app_data/odrs/util.py
similarity index 100%
rename from app_data/app/util.py
rename to app_data/odrs/util.py
diff --git a/app_data/app/views.py b/app_data/odrs/views.py
similarity index 99%
rename from app_data/app/views.py
rename to app_data/odrs/views.py
index 1f79406..163bba7 100644
--- a/app_data/app/views.py
+++ b/app_data/odrs/views.py
@@ -15,7 +15,7 @@ import math
 from flask import request, url_for, redirect, flash, render_template, send_from_directory, Response
 from flask_login import login_user, logout_user
 
-from app import app, get_db
+from odrs import app, get_db
 
 from .db import CursorError
 from .models import Review
diff --git a/app_data/app/views_admin.py b/app_data/odrs/views_admin.py
similarity index 99%
rename from app_data/app/views_admin.py
rename to app_data/odrs/views_admin.py
index 234ffcb..032f0ac 100644
--- a/app_data/app/views_admin.py
+++ b/app_data/odrs/views_admin.py
@@ -14,7 +14,7 @@ from math import ceil
 from flask import abort, request, flash, render_template, redirect, url_for
 from flask_login import login_required, current_user
 
-from app import app, get_db
+from odrs import app, get_db
 from .db import CursorError
 from .util import json_error
 
diff --git a/app_data/wsgi-scripts/odrs.wsgi b/app_data/wsgi-scripts/odrs.wsgi
index a60d5ed..158bca7 100644
--- a/app_data/wsgi-scripts/odrs.wsgi
+++ b/app_data/wsgi-scripts/odrs.wsgi
@@ -16,5 +16,5 @@ def application(environ, start_response):
                 'MYSQL_DB_PASSWORD',
                 'ODRS_REVIEWS_SECRET']:
         os.environ[key] = environ[key]
-    from app import app as _application
+    from odrs import app as _application
     return _application(environ, start_response)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]