Skip to content

Commit

Permalink
cleanup #48
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Fekete committed Oct 16, 2019
1 parent 3064182 commit ca7fc20
Show file tree
Hide file tree
Showing 11 changed files with 54 additions and 290 deletions.
8 changes: 1 addition & 7 deletions abcd/server/__init__.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
import logging
from abcd.server.app import create_app

logging.basicConfig(level=logging.DEBUG)
app = create_app()

if __name__ == '__main__':
# app.logger.setLevel(logging.DEBUG)
# handler = logging.StreamHandler()
# app.logger.addHandler(handler)

app.run(host='0.0.0.0', debug=True)
app.run(host='0.0.0.0')
Empty file removed abcd/server/api/__init__.py
Empty file.
12 changes: 5 additions & 7 deletions abcd/server/app/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,16 @@

from abcd.server.app.db import db
from abcd.server.app.nav import nav, BootstrapRenderer, DatabaseNav
from abcd.server.app.views import index # database, api, index
from abcd.server.app.views import index, database, api


def create_app():
# Define the WSGI application object
app = Flask(__name__)
app.logger.info('Creating application')
app.logger.info('Creating an application')

app.config['SECRET_KEY'] = os.getenv('SECRET_KEY', os.urandom(12).hex())
app.config['ABCD_URL'] = os.getenv('ABCD_URL', 'localhost:27017/abcd')

app.config['ABCD_URL'] = os.getenv('ABCD_URL', 'mongodb://localhost:27017/abcd')

# Initialize extensions/add-ons/plugins.
nav.init_app(app)
Expand All @@ -26,9 +25,8 @@ def create_app():

# Setup redirects and register blueprints.
app.register_blueprint(index.bp)

# app.register_blueprint(api.bp, url_prefix='/api')
# app.register_blueprint(database.bp, url_prefix='/db')
app.register_blueprint(database.bp, url_prefix='/db')
app.register_blueprint(api.bp, url_prefix='/api')

@app.errorhandler(404)
def not_found(error):
Expand Down
7 changes: 5 additions & 2 deletions abcd/server/app/db.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
from abcd import ABCD
from flask_paginate import Pagination, get_page_args


# from flask_paginate import Pagination, get_page_args


class Database(ABCD):
"""Wrapper for the ABCD factory method for registering a the database for the Flask application."""

def __init__(self):
super().__init__()

def init_app(self, app):
pass


db = Database()
db = Database()
78 changes: 0 additions & 78 deletions abcd/server/app/models.py

This file was deleted.

19 changes: 5 additions & 14 deletions abcd/server/app/nav.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
from dominate import tags
from flask_nav.renderers import Renderer

# from flask import url_for

nav = Nav()


Expand All @@ -19,18 +17,11 @@ def __init__(self, title, *args, **kwargs):
def main_navbar():
return TopNavbar(
'ABCD',
View('Databases', 'index.index'),
View('GraphQL', 'index.graphql'),
View('Login', 'index.login'),

View('New', 'index.new'),

Subgroup(
'Links',
Link('Docs', 'https://libatoms.github.io/abcd/'),
Separator(),
Link('Github', 'https://github.com/libatoms/abcd'),
),
View('Home', 'index.index'),
View('API', 'api.index'),
View('Databases', 'database.database', database_name='default'),
Link('Docs', 'https://libatoms.github.io/abcd/'),
Link('Github', 'https://github.com/libatoms/abcd'),
)


Expand Down
99 changes: 0 additions & 99 deletions abcd/server/app/schema.py

This file was deleted.

12 changes: 6 additions & 6 deletions abcd/server/app/templates/database/database.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,19 +59,19 @@
<th class="column-header col-data-{{ column.slug }}">{{ column.name }}</th>{% endfor %}
</tr>
</thead>
<tbody>{% for row in atoms.items %}
<tr id="{{ row.id }}">{% for column in info.columns %}
<td class="col-data-{{ column.slug }}">{{ row[column.slug] }}</td>{% endfor %}
</tr>
{% endfor %}
{# <tbody>{% for row in atoms.items %}#}
{# <tr id="{{ row.id }}">{% for column in info.columns %}#}
{# <td class="col-data-{{ column.slug }}">{{ row[column.slug] }}</td>{% endfor %}#}
{# </tr>#}
{# {% endfor %}#}
</tbody>
</table>
</div>
</div>
</div>


{{ render_navigation(atoms) }}
{# {{ render_navigation(atoms) }}#}
</div>

{%- endblock %}
Expand Down
18 changes: 0 additions & 18 deletions abcd/server/app/templates/graphql.html

This file was deleted.

Loading

0 comments on commit ca7fc20

Please sign in to comment.