Skip to content
This repository has been archived by the owner on Feb 8, 2018. It is now read-only.

Commit

Permalink
move aspen options from command line to env file
Browse files Browse the repository at this point in the history
  • Loading branch information
Changaco committed Feb 27, 2014
1 parent ca129ce commit 7f79ed7
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 30 deletions.
7 changes: 1 addition & 6 deletions Makefile
Expand Up @@ -45,12 +45,7 @@ data:
db: cloud-db schema data

run: env
./$(env_bin)/honcho -e defaults.env,local.env run ./$(env_bin)/aspen \
--www_root=www/ \
--project_root=. \
--show_tracebacks=yes \
--changes_reload=yes \
--network_address=:8537
./$(env_bin)/honcho -e defaults.env,local.env run ./$(env_bin)/aspen

test-cloud-db: env
echo -n $(postgression_database) >> tests/local.env
Expand Down
17 changes: 6 additions & 11 deletions README.md
Expand Up @@ -116,15 +116,10 @@ If Gittip launches successfully it will look like this:

```
$ make run
./env/bin/honcho -e default_local.env,local.env run ./env/bin/aspen \
--www_root=www/ \
--project_root=. \
--show_tracebacks=yes \
--changes_reload=yes \
--network_address=:8537
./env/bin/honcho -e default_local.env,local.env run ./env/bin/aspen
pid-27937 thread-47041048338176 (MainThread) Reading configuration from defaults, environment, and command line.
pid-27937 thread-47041048338176 (MainThread) changes_reload False default
pid-27937 thread-47041048338176 (MainThread) changes_reload True command line option --changes_reload=yes
pid-27937 thread-47041048338176 (MainThread) changes_reload True environment variable ASPEN_CHANGES_RELOAD=1
pid-27937 thread-47041048338176 (MainThread) charset_dynamic UTF-8 default
pid-27937 thread-47041048338176 (MainThread) charset_static None default
pid-27937 thread-47041048338176 (MainThread) configuration_scripts [] default
Expand All @@ -134,15 +129,15 @@ pid-27937 thread-47041048338176 (MainThread) logging_threshold 0
pid-27937 thread-47041048338176 (MainThread) media_type_default text/plain default
pid-27937 thread-47041048338176 (MainThread) media_type_json application/json default
pid-27937 thread-47041048338176 (MainThread) network_address ((u'0.0.0.0', 8080), 2) default
pid-27937 thread-47041048338176 (MainThread) network_address ((u'0.0.0.0', 8537), 2) command line option --network_address=:8537
pid-27937 thread-47041048338176 (MainThread) network_address ((u'0.0.0.0', 8537), 2) environment variable ASPEN_NETWORK_ADDRESS=:8537
pid-27937 thread-47041048338176 (MainThread) network_engine cheroot default
pid-27937 thread-47041048338176 (MainThread) project_root None default
pid-27937 thread-47041048338176 (MainThread) project_root . command line option --project_root=.
pid-27937 thread-47041048338176 (MainThread) project_root . environment variable ASPEN_PROJECT_ROOT=.
pid-27937 thread-47041048338176 (MainThread) renderer_default stdlib_percent default
pid-27937 thread-47041048338176 (MainThread) show_tracebacks False default
pid-27937 thread-47041048338176 (MainThread) show_tracebacks True command line option --show_tracebacks=yes
pid-27937 thread-47041048338176 (MainThread) show_tracebacks True environment variable ASPEN_SHOW_TRACEBACKS=1
pid-27937 thread-47041048338176 (MainThread) www_root None default
pid-27937 thread-47041048338176 (MainThread) www_root www/ command line option --www_root=www/
pid-27937 thread-47041048338176 (MainThread) www_root www/ environment variable ASPEN_WWW_ROOT=www/
pid-27937 thread-47041048338176 (MainThread) project_root is relative to CWD: '.'.
pid-27937 thread-47041048338176 (MainThread) project_root set to /home/zbynek/www.gittip.com.
pid-27937 thread-47041048338176 (MainThread) Found plugin for renderer 'jinja2'
Expand Down
6 changes: 6 additions & 0 deletions defaults.env
Expand Up @@ -54,3 +54,9 @@ GOOGLE_ANALYTICS_ID=
SENTRY_DSN=
LOG_BUSY_THREADS_EVERY=0
LOG_METRICS=0

ASPEN_CHANGES_RELOAD=yes
ASPEN_NETWORK_ADDRESS=:8537
ASPEN_PROJECT_ROOT=.
ASPEN_SHOW_TRACEBACKS=yes
ASPEN_WWW_ROOT=www/
15 changes: 2 additions & 13 deletions gittip.py
Expand Up @@ -109,20 +109,9 @@ def install_requirements():
open(requirements_installed_path, 'w').close()


def run_server(host=None, port=None):
if host is None:
host = 'localhost'
if port is None:
port = default_port

def run_server():
# TODO: Wait for Aspen to quit before exiting

shell(swaddle_path, config_path, aspen_path,
'--www_root=www/',
'--project_root=.',
'--show_tracebacks=yes',
'--changes_reload=yes',
'--network_address=%s:%s' % (host, port))
shell(swaddle_path, config_path, aspen_path)


def shell(*args, **kwargs):
Expand Down

0 comments on commit 7f79ed7

Please sign in to comment.