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

Commit

Permalink
Merge pull request #2227 from gittip/wireup-env
Browse files Browse the repository at this point in the history
Wireup env
  • Loading branch information
rummik committed Apr 2, 2014
2 parents f62de9a + acec1f8 commit 1c1c51b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
5 changes: 4 additions & 1 deletion configure-aspen.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

from aspen import log_dammit


# Wireup Algorithm
# ================

Expand All @@ -36,12 +37,14 @@
}


env = gittip.wireup.env()
gittip.wireup.canonical()
website.db = gittip.wireup.db()
gittip.wireup.billing()
gittip.wireup.username_restrictions(website)
gittip.wireup.nanswers()
gittip.wireup.envvars(website)
gittip.wireup.accounts_elsewhere(website, env)
gittip.wireup.other_stuff(website, env)
tell_sentry = gittip.wireup.make_sentry_teller(website)

# The homepage wants expensive queries. Let's periodically select into an
Expand Down
13 changes: 3 additions & 10 deletions gittip/wireup.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,12 +146,7 @@ class BadEnvironment(SystemExit):
pass


def envvars(website):
env = _env()


# Accounts Elsewhere
# ==================
def accounts_elsewhere(website, env):

twitter = Twitter(
website.db,
Expand Down Expand Up @@ -205,9 +200,7 @@ def envvars(website):
website.platforms = AccountElsewhere.platforms = PlatformRegistry(all_platforms)


# Other Stuff
# ===========

def other_stuff(website, env):
website.asset_version_url = env.gittip_asset_version_url.replace('%version', website.version)
website.asset_url = env.gittip_asset_url
website.cache_static = env.gittip_cache_static
Expand All @@ -221,7 +214,7 @@ def envvars(website):
website.log_metrics = env.log_metrics


def _env():
def env():
env = Environment(
DATABASE_URL = unicode,
CANONICAL_HOST = unicode,
Expand Down

0 comments on commit 1c1c51b

Please sign in to comment.