[copr] bkabrda-workspace: Restructured the app to be more consistent (a8b23b8)

bkabrda at fedoraproject.org bkabrda at fedoraproject.org
Mon Nov 19 09:23:37 UTC 2012


Repository : http://git.fedorahosted.org/cgit/copr.git

On branch  : bkabrda-workspace

>---------------------------------------------------------------

commit a8b23b8a1b61bbc5c501ca9b1a348bd3ad6ea6d2
Author: Bohuslav Kabrda <bkabrda at redhat.com>
Date:   Mon Nov 19 10:23:23 2012 +0100

    Restructured the app to be more consistent


>---------------------------------------------------------------

 wsgi/coprs/__init__.py                             |   14 ++++++++------
 wsgi/coprs/views/backend_ns/__init__.py            |    3 +++
 .../backend_general.py}                            |    4 ++--
 wsgi/coprs/views/coprs_ns/__init__.py              |    3 +++
 .../views/coprs_ns/{builds.py => coprs_builds.py}  |    2 +-
 .../coprs_ns/{general.py => coprs_general.py}      |    6 ++----
 6 files changed, 19 insertions(+), 13 deletions(-)

diff --git a/wsgi/coprs/__init__.py b/wsgi/coprs/__init__.py
index 690ef09..b921968 100644
--- a/wsgi/coprs/__init__.py
+++ b/wsgi/coprs/__init__.py
@@ -32,15 +32,17 @@ def page_not_found(message):
 import coprs.models
 import coprs.filters
 
-from coprs.views.coprs_ns import builds # this uses coprs_ns blueprint
-from coprs.views.coprs_ns import general
+from coprs.views import coprs_ns
+from coprs.views.coprs_ns import coprs_builds
+from coprs.views.coprs_ns import coprs_general
+from coprs.views import backend_ns
+from coprs.views.backend_ns import backend_general
 from coprs.views import misc
-from coprs.views import waiting_builds
 
-app.register_blueprint(general.coprs_ns)
+app.register_blueprint(coprs_ns.coprs_ns)
 app.register_blueprint(misc.misc)
-app.register_blueprint(waiting_builds.waiting_builds_ns)
+app.register_blueprint(backend_ns.backend_ns)
 
 @app.route("/")
 def start():
-    return general.coprs_show()
+    return coprs_general.coprs_show()
diff --git a/wsgi/coprs/views/backend_ns/__init__.py b/wsgi/coprs/views/backend_ns/__init__.py
new file mode 100644
index 0000000..7386bd5
--- /dev/null
+++ b/wsgi/coprs/views/backend_ns/__init__.py
@@ -0,0 +1,3 @@
+import flask
+
+backend_ns = flask.Blueprint('backend_ns', __name__, url_prefix = '/backend')
diff --git a/wsgi/coprs/views/waiting_builds.py b/wsgi/coprs/views/backend_ns/backend_general.py
similarity index 88%
rename from wsgi/coprs/views/waiting_builds.py
rename to wsgi/coprs/views/backend_ns/backend_general.py
index a748168..01e4829 100644
--- a/wsgi/coprs/views/waiting_builds.py
+++ b/wsgi/coprs/views/backend_ns/backend_general.py
@@ -3,9 +3,9 @@ import flask
 from coprs import db
 from coprs import models
 
-waiting_builds_ns = flask.Blueprint('waiting_builds', __name__, url_prefix = '/waiting_builds')
+from coprs.views.backend_ns import backend_ns
 
- at waiting_builds_ns.route('/')
+ at backend_ns.route('/waiting_builds/')
 def waiting_builds():
     query = db.session.query(models.Build, models.Copr, models.User).\
                         join(models.Build.copr).\
diff --git a/wsgi/coprs/views/coprs_ns/__init__.py b/wsgi/coprs/views/coprs_ns/__init__.py
index e69de29..03a1fe1 100644
--- a/wsgi/coprs/views/coprs_ns/__init__.py
+++ b/wsgi/coprs/views/coprs_ns/__init__.py
@@ -0,0 +1,3 @@
+import flask
+
+coprs_ns = flask.Blueprint('coprs_ns', __name__, url_prefix = '/coprs')
diff --git a/wsgi/coprs/views/coprs_ns/builds.py b/wsgi/coprs/views/coprs_ns/coprs_builds.py
similarity index 98%
rename from wsgi/coprs/views/coprs_ns/builds.py
rename to wsgi/coprs/views/coprs_ns/coprs_builds.py
index d5e00cd..1f1ac53 100644
--- a/wsgi/coprs/views/coprs_ns/builds.py
+++ b/wsgi/coprs/views/coprs_ns/coprs_builds.py
@@ -12,7 +12,7 @@ from coprs.logic import builds_logic
 from coprs.logic import coprs_logic
 
 from coprs.views.misc import login_required
-from coprs.views.coprs_ns.general import coprs_ns
+from coprs.views.coprs_ns import coprs_ns
 
 @coprs_ns.route('/detail/<username>/<coprname>/builds/', defaults = {'page': 1})
 @coprs_ns.route('/detail/<username>/<coprname>/builds/<int:page>/')
diff --git a/wsgi/coprs/views/coprs_ns/general.py b/wsgi/coprs/views/coprs_ns/coprs_general.py
similarity index 98%
rename from wsgi/coprs/views/coprs_ns/general.py
rename to wsgi/coprs/views/coprs_ns/coprs_general.py
index c4a0fbb..a4e34a6 100644
--- a/wsgi/coprs/views/coprs_ns/general.py
+++ b/wsgi/coprs/views/coprs_ns/coprs_general.py
@@ -7,11 +7,9 @@ from coprs import models
 
 from coprs.views.misc import login_required
 
-from coprs.logic import coprs_logic
+from coprs.views.coprs_ns import coprs_ns
 
-coprs_ns = flask.Blueprint('coprs_ns',
-                           __name__,
-                           url_prefix = '/coprs')
+from coprs.logic import coprs_logic
 
 @coprs_ns.route('/', defaults = {'page': 1})
 @coprs_ns.route('/<int:page>/')



More information about the copr-devel mailing list