Skip to content
This repository was archived by the owner on May 12, 2021. It is now read-only.

Commit cc35a7f

Browse files
jcsackettmitechie
authored andcommitted
Brought over pyramid gui.
1 parent 8c2c10e commit cc35a7f

28 files changed

+3026
-1333
lines changed

HACKING-old.rst

Lines changed: 643 additions & 0 deletions
Large diffs are not rendered by default.

HACKING.rst

Lines changed: 36 additions & 598 deletions
Large diffs are not rendered by default.

MANIFEST.in

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Copyright 2015 Canonical Ltd. This software is licensed under the
2+
# GNU Affero General Public License version 3 (see the file LICENSE).
3+
4+
include HACKING.rst
5+
include MANIFEST.in
6+
include Makefile
7+
recursive-include jujugui/static *
8+
recursive-include jujugui/templates *

Makefile

Lines changed: 230 additions & 719 deletions
Large diffs are not rendered by default.

Makefile-old

Lines changed: 733 additions & 0 deletions
Large diffs are not rendered by default.

config.js

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,21 @@ var config = {
33
'port': 8888,
44
'public_hostname': 'localhost',
55
'template_dirs': [
6-
__dirname + '/app/templates/',
7-
__dirname + '/app/subapps/browser/templates/'
6+
__dirname + '/jujugui/static/gui/src/app/templates/',
7+
__dirname + '/jujugui/static/gui/src/app/subapps/browser/templates/'
8+
],
9+
'view_dirs': [
10+
__dirname + '/jujugui/static/gui/src/lib/views/',
11+
__dirname + '/jujugui/static/gui/src/lib/views/browser'
812
],
913
'scss_dirs': [
1014
// Must have the top level path first.
11-
__dirname + '/app/assets/css/',
12-
__dirname + '/app/assets/css/browser',
13-
__dirname + '/app/assets/css/inspector',
14-
__dirname + '/app/assets/css/machine-view'
15+
__dirname + '/jujugui/static/gui/src/app/assets/css/'
16+
__dirname + '/jujugui/static/gui/src/app/assets/css/browser'
17+
__dirname + '/jujugui/static/gui/src/app/assets/css/inspector'
18+
__dirname + '/jujugui/static/gui/src/app/assets/css/machine-view'
1519
],
16-
'public_dir': __dirname + '/app'
20+
'public_dir': __dirname + '/jujugui/static/gui/build/app'
1721
}
1822
};
1923

development.ini

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
###
2+
# app configuration
3+
# http://docs.pylonsproject.org/projects/pyramid/en/1.5-branch/narr/environment.html
4+
###
5+
6+
[app:main]
7+
use = egg:jujugui
8+
9+
pyramid.reload_templates = true
10+
pyramid.default_locale_name = en
11+
12+
jujugui.sandbox = true
13+
14+
###
15+
# wsgi server configuration
16+
###
17+
18+
[server:main]
19+
use = egg:waitress#main
20+
host = 0.0.0.0
21+
port = 6543
22+
23+
###
24+
# logging configuration
25+
# http://docs.pylonsproject.org/projects/pyramid/en/1.5-branch/narr/logging.html
26+
###
27+
28+
[loggers]
29+
keys = root, jujugui
30+
31+
[handlers]
32+
keys = console
33+
34+
[formatters]
35+
keys = generic
36+
37+
[logger_root]
38+
level = INFO
39+
handlers = console
40+
41+
[logger_jujugui]
42+
level = DEBUG
43+
handlers =
44+
qualname = jujugui
45+
46+
[handler_console]
47+
class = StreamHandler
48+
args = (sys.stderr,)
49+
level = NOTSET
50+
formatter = generic
51+
52+
[formatter_generic]
53+
format = %(asctime)s %(levelname)-5.5s [%(name)s][%(threadName)s] %(message)s

grunt.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ module.exports = function(grunt) {
1515

1616
},
1717
files: {
18-
'build-shared/juju-ui/assets': 'app/assets/images/*'
18+
'jujugui/static/gui/build/app/assets': 'jujugui/static/gui/src/app/assets/images/*'
1919
}
2020
}
2121
}

jujugui/__init__.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Copyright 2015 Canonical Ltd. This software is licensed under the
2+
# GNU Affero General Public License version 3 (see the file LICENSE).
3+
4+
from pyramid.config import Configurator
5+
6+
7+
def main(global_config, **settings):
8+
"""Return a Pyramid WSGI application."""
9+
config = Configurator(settings=settings)
10+
return make_application(config)
11+
12+
13+
def make_application(config):
14+
"""Set up the routes and return the WSGI application."""
15+
# We use two separate included app/routes so that we can
16+
# have the gui parts behind a separate route from the
17+
# assets when we embed it in e.g. the storefront.
18+
config.include('jujugui.gui')
19+
config.include('jujugui.assets')
20+
return config.make_wsgi_app()

jujugui/assets.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Copyright 2015 Canonical Ltd. This software is licensed under the
2+
# GNU Affero General Public License version 3 (see the file LICENSE).
3+
4+
5+
def assets(config):
6+
config.add_static_view(
7+
'juju-ui/assets',
8+
'jujugui:static/gui/build/app/assets',
9+
cache_max_age=3600)
10+
11+
12+
def includeme(config):
13+
return assets(config)

0 commit comments

Comments
 (0)