mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-09-18 21:50:56 +00:00
Merge branch 'master' of github.com:samuelclay/NewsBlur
* 'master' of github.com:samuelclay/NewsBlur: Forcing Jammit asset path to be absolute, relative to configured directory.
This commit is contained in:
commit
89002d9bc6
2 changed files with 6 additions and 3 deletions
|
@ -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)
|
||||
|
|
|
@ -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):
|
||||
|
|
Loading…
Add table
Reference in a new issue