From 41259685b07fd2a8ddd394740c2430e0b226c5f3 Mon Sep 17 00:00:00 2001 From: Andrew Croce Date: Tue, 17 Jul 2018 10:41:50 -0400 Subject: [PATCH 01/10] Icon ui method --- atst/app.py | 3 ++- atst/ui.py | 5 +++++ static/icons/trash.svg | 1 + templates/styleguide.html.to | 1 + 4 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 atst/ui.py create mode 100644 static/icons/trash.svg diff --git a/atst/app.py b/atst/app.py index ed1be4a6..7dcc1b9a 100644 --- a/atst/app.py +++ b/atst/app.py @@ -15,10 +15,10 @@ from atst.handlers.dev import Dev from atst.home import home from atst.api_client import ApiClient from atst.sessions import RedisSessions +from atst.ui import UI ENV = os.getenv("TORNADO_ENV", "dev") - def make_app(config, deps, **kwargs): routes = [ @@ -104,6 +104,7 @@ def make_app(config, deps, **kwargs): ) app.config = config app.sessions = deps["sessions"] + app.ui = UI return app diff --git a/atst/ui.py b/atst/ui.py new file mode 100644 index 00000000..6926febb --- /dev/null +++ b/atst/ui.py @@ -0,0 +1,5 @@ +class UI: + + def icon(name): + with open("../static/icons/%(name)s.svg") as svg: + return svg.read() diff --git a/static/icons/trash.svg b/static/icons/trash.svg new file mode 100644 index 00000000..c03b2a7e --- /dev/null +++ b/static/icons/trash.svg @@ -0,0 +1 @@ + diff --git a/templates/styleguide.html.to b/templates/styleguide.html.to index 4439a21d..8a2c489c 100644 --- a/templates/styleguide.html.to +++ b/templates/styleguide.html.to @@ -5,6 +5,7 @@