Skip to content
Browse files
fix #1370
  • Loading branch information
ralsina committed Sep 15, 2015
1 parent 256e410 commit 8845dfdba805158cb87b3e047ef413bf6821bb6c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
@@ -19,6 +19,8 @@ Features

* Look for bundle assets also in output/, allowing bundling of files
created by plugins (Issue #1370)
* Remove bogus ambiguity on listing links (Issue #2080)
* Unix-slash caused conflict in windows (Issue #2079)
* Locale is now threadsafe, avoid races in threaded builds (Issue #2071)
@@ -101,7 +101,11 @@ def build_bundle(output, inputs):
files.append(os.path.join(dname, fname))
file_dep = [os.path.join(kw['output_folder'], fname)
for fname in files if
utils.get_asset_path(fname,,['FILES_FOLDERS']) or fname == os.path.join('assets', 'css', 'code.css')]
output_dir=kw['output_folder']) or fname == os.path.join('assets', 'css', 'code.css')]
# code.css will be generated by us if it does not exist in
# FILES_FOLDERS or theme assets. It is guaranteed that the
# generation will happen before this task.
@@ -968,12 +968,14 @@ def get_crumbs(path, is_file=False, index_folder=None):
return list(reversed(_crumbs))

def get_asset_path(path, themes, files_folders={'files': ''}, _themes_dir='themes'):
def get_asset_path(path, themes, files_folders={'files': ''}, _themes_dir='themes', output_dir='output'):
"""Return the "real", absolute path to the asset.
By default, it checks which theme provides the asset.
If the asset is not provided by a theme, then it will be checked for
If it's not provided by either, it will be chacked in output, where
it may have been created by another plugin.
>>> print(get_asset_path('assets/css/rst.css', ['bootstrap3', 'base']))
@@ -1000,6 +1002,10 @@ def get_asset_path(path, themes, files_folders={'files': ''}, _themes_dir='theme
if os.path.isfile(candidate):
return candidate

candidate = os.path.join(output_dir, path)
if os.path.isfile(candidate):
return candidate

# whatever!
return None

0 comments on commit 8845dfd

Please sign in to comment.