diff --git a/settings.py b/settings.py index 6505718e6..a4dfb28b4 100644 --- a/settings.py +++ b/settings.py @@ -480,4 +480,4 @@ MONGODB = connect(MONGO_DB.pop('name'), **MONGO_DB) REDIS_POOL = redis.ConnectionPool(host=REDIS['host'], port=6379, db=0) -JAMMIT = jammit.JammitAssets() +JAMMIT = jammit.JammitAssets(NEWSBLUR_DIR) diff --git a/utils/jammit.py b/utils/jammit.py index 948e99721..268a1c49c 100644 --- a/utils/jammit.py +++ b/utils/jammit.py @@ -12,19 +12,22 @@ class JammitAssets: ASSET_FILENAME = 'assets.yml' - def __init__(self): + def __init__(self, assets_dir): """ Initializes the Jammit object by reading the assets.yml file and stores all javascripts and stylesheets in memory for easy lookup in templates. """ + self.assets_dir = assets_dir self.assets = self.read_assets() def read_assets(self): """ Read the assets from the YAML and store it as a lookup dictionary. """ - f = open(self.ASSET_FILENAME, 'r') + filepath = os.path.join(self.assets_dir, self.ASSET_FILENAME) + print filepath + f = open(filepath, 'r') return yaml.load(f.read()) def render_tags(self, asset_type, asset_package):