From 4f8ae0fcffa421e249c212138bde9fbb1760041d Mon Sep 17 00:00:00 2001 From: Andy Williams Date: Mon, 4 Jul 2016 23:19:48 +0100 Subject: [PATCH] Tidy after bad merge --- app.py | 46 ------------------- templates/about.html | 9 ---- templates/layout.html | 101 ----------------------------------------- templates/theme.html | 3 -- templates/themes.html | 11 ----- templates/welcome.html | 11 ----- 6 files changed, 181 deletions(-) delete mode 100644 app.py delete mode 100644 templates/about.html delete mode 100644 templates/layout.html delete mode 100644 templates/theme.html delete mode 100644 templates/themes.html delete mode 100644 templates/welcome.html diff --git a/app.py b/app.py deleted file mode 100644 index 3127b5c..0000000 --- a/app.py +++ /dev/null @@ -1,46 +0,0 @@ -from flask import Flask -from flask import abort, render_template -from flask_restful import Resource, Api, abort as api_abort - -app = Flask(__name__) -api = Api(app) - -@app.route('/') -def welcome(): - return render_template('welcome.html') - -@app.route('/about/') -def about(): - return render_template('about.html') - -THEMES = { - '1': {'theme_id': '1'}, - 'a': {'theme_id': 'a'}, -} - -class ThemeList(Resource): - def get(self): - return THEMES - -class Theme(Resource): - def get(self, theme_id): - if theme_id not in THEMES: - api_abort(404, message="Theme {} not found".format(theme_id)) - - return THEMES[theme_id] - -@app.route('/themes/') -@app.route('/themes/') -def themes(theme_id=None): - if theme_id: - if theme_id not in THEMES: - abort(404) - return render_template('theme.html', theme_id=theme_id) - else: - return render_template('themes.html', themes=THEMES) - -api.add_resource(ThemeList, '/v1/themes/') -api.add_resource(Theme, '/v1/themes/') - -if __name__ == '__main__': - app.run(debug=True) diff --git a/templates/about.html b/templates/about.html deleted file mode 100644 index 2b840cd..0000000 --- a/templates/about.html +++ /dev/null @@ -1,9 +0,0 @@ -{% extends "layout.html" %} -{% block title %}About{% endblock %} -{% block heading %}About{% endblock %} - -{% block content %} -

Extra is an Enlightenment site for discovering and downloading themes -and other great add-ons to the Enlightenment desktop.

-{% endblock %} - diff --git a/templates/layout.html b/templates/layout.html deleted file mode 100644 index a1eaa4e..0000000 --- a/templates/layout.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - {% block title %}{% endblock %} - Extra Enlightenment - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - - -
-
-
-
-

{% block heading %}{% endblock %}

-
- -{% block content %}TODO{% endblock %} - -
- -
-
-
-
- -
-
- - -
-
-
-
-
-
-
-
-
- -
- - - - diff --git a/templates/theme.html b/templates/theme.html deleted file mode 100644 index 9ac19a5..0000000 --- a/templates/theme.html +++ /dev/null @@ -1,3 +0,0 @@ -{% extends "layout.html" %} -{% block title %}Theme {{ theme_id }}{% endblock %} -{% block heading %}Theme - {{ theme_id }}{% endblock %} diff --git a/templates/themes.html b/templates/themes.html deleted file mode 100644 index aa6eb4c..0000000 --- a/templates/themes.html +++ /dev/null @@ -1,11 +0,0 @@ -{% extends "layout.html" %} -{% block title %}Themes{% endblock %} -{% block heading %}Themes{% endblock %} - -{% block content %} - -{% endblock %} diff --git a/templates/welcome.html b/templates/welcome.html deleted file mode 100644 index 8022e01..0000000 --- a/templates/welcome.html +++ /dev/null @@ -1,11 +0,0 @@ -{% extends "layout.html" %} -{% block title %}Welcome{% endblock %} -{% block heading %}Welcome{% endblock %} - -{% block content %} - - -

About Extra Enlightenment.

-{% endblock %}