-
Notifications
You must be signed in to change notification settings - Fork 6
(Experimental) Port Envs to use conda-js #8
Changes from 71 commits
a6522d6
11ca2d6
816514a
fed4f19
1c21868
daf09e6
98cd096
c63225f
35fece9
2319538
19fc70d
fcd0156
8fd4d00
4035087
3878956
8196a9e
bdfe21d
66602ce
1e75d32
4b35852
7866bb8
bb040a9
4576c64
d9de5e0
d5b1b2e
8c4f826
1ed61fc
a8f4f5c
f002321
f0ab57a
de5e3aa
e0eed65
ed483f3
fecf8ac
c02e3fa
629f699
0b11f53
205e460
4db2a26
99f93b5
89f32a9
47ba77b
a352d2e
6613307
fb5ca7a
5a04574
6e10399
9c7b01b
854a7ad
f8edc29
528ac96
a45f20a
3f49e7a
144cdfe
1a9f490
7004548
afc130e
bf17558
f27286f
676240e
7eb2231
74cbad9
ac4c53a
6407206
3cb5d6a
e7b8e1c
c4d17a6
ed3929c
e7a4108
d015b2b
f9adb48
2f5eb72
95664d6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
set SRC_DIR=%RECIPE_DIR%\.. | ||
cd %SRC_DIR% | ||
|
||
python setup.py install --single-version-externally-managed --record=record.txt |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,15 @@ | ||
import sys | ||
import argparse | ||
import datetime | ||
import webbrowser | ||
|
||
from flask import Flask, Blueprint, url_for | ||
|
||
import tornado.ioloop | ||
import tornado.web | ||
import tornado.wsgi | ||
import sockjs.tornado | ||
|
||
blueprint = Blueprint('views', __name__) | ||
from . import views | ||
|
||
|
@@ -11,12 +18,33 @@ def static(filename): | |
|
||
def start_server(args): | ||
app = Flask(__name__) | ||
app.config['SECRET_KEY'] = 'secret' | ||
app.jinja_env.globals['static'] = static | ||
|
||
blueprint.url_prefix = args.url_prefix | ||
app.register_blueprint(blueprint) | ||
|
||
app.run(port=args.port, debug=args.debug) | ||
# app.run(port=args.port, debug=args.debug) | ||
|
||
wsgi_app = tornado.wsgi.WSGIContainer(app) | ||
condajs_ws = sockjs.tornado.SockJSRouter(views.CondaJsWebSocketRouter, '/condajs_ws') | ||
routes = condajs_ws.urls | ||
routes.append((r".*", tornado.web.FallbackHandler, dict(fallback=wsgi_app))) | ||
application = tornado.web.Application(routes, debug=args.debug) | ||
|
||
try: | ||
application.listen(args.port) | ||
except OSError as e: | ||
print("There was an error starting the server:") | ||
print(e) | ||
return | ||
|
||
ioloop = tornado.ioloop.IOLoop.instance() | ||
if not args.debug: | ||
delta = datetime.timedelta(seconds=3) | ||
ioloop.add_timeout(delta, lambda: webbrowser.open_new_tab('http://localhost:%s' % args.port)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there a reason for this 3 second timeout? It looks like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, I just wanted to make sure the server had started first. We should also automatically bind to an open port in case the user runs multiple instances. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
OK. I changed this in https://github.com/ContinuumIO/conda-ui/commit/95664d6c16e04e2b0fbc3bf7c23e8cf3db620971.
I opened https://github.com/ContinuumIO/conda-ui/issues/9 for this. |
||
ioloop.start() | ||
|
||
|
||
def main(): | ||
parser = argparse.ArgumentParser(description="Web user interface for Conda") | ||
|
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
.bootstrap-tagsinput { | ||
background-color: #fff; | ||
border: 1px solid #ccc; | ||
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); | ||
display: inline-block; | ||
padding: 4px 6px; | ||
margin-bottom: 10px; | ||
color: #555; | ||
vertical-align: middle; | ||
border-radius: 4px; | ||
max-width: 100%; | ||
line-height: 22px; | ||
} | ||
.bootstrap-tagsinput input { | ||
border: none; | ||
box-shadow: none; | ||
outline: none; | ||
background-color: transparent; | ||
padding: 0; | ||
margin: 0; | ||
width: auto !important; | ||
max-width: inherit; | ||
} | ||
.bootstrap-tagsinput input:focus { | ||
border: none; | ||
box-shadow: none; | ||
} | ||
.bootstrap-tagsinput .tag { | ||
margin-right: 2px; | ||
color: white; | ||
} | ||
.bootstrap-tagsinput .tag [data-role="remove"] { | ||
margin-left: 8px; | ||
cursor: pointer; | ||
} | ||
.bootstrap-tagsinput .tag [data-role="remove"]:after { | ||
content: "x"; | ||
padding: 0px 2px; | ||
} | ||
.bootstrap-tagsinput .tag [data-role="remove"]:hover { | ||
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); | ||
} | ||
.bootstrap-tagsinput .tag [data-role="remove"]:hover:active { | ||
box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sockjs-tornado
has to be propagated torepo.continuum.io
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can help, but first I need a recipe. Can you add one to conda-recipes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, I've pushed the recipe up to conda-recipes.