|
43 | 43 |
|
44 | 44 | from werkzeug.exceptions import Forbidden |
45 | 45 |
|
46 | | -from xstatic.main import XStatic |
47 | | - |
| 46 | +from moin import log |
48 | 47 | from moin.app import create_app, before_wiki, setup_user_anon |
49 | 48 | from moin.apps.frontend.views import show_item |
50 | 49 | from moin.constants.keys import CONTENTTYPE, CURRENT, NAME_EXACT, THEME_NAME, LATEST_REVS |
|
55 | 54 | CONTENTTYPE_OTHER_SUFFIX, |
56 | 55 | ) |
57 | 56 | from moin.items import Item |
58 | | - |
59 | | -from moin import log |
| 57 | +from moin.utils import get_xstatic_module_path_map |
60 | 58 |
|
61 | 59 | logging = log.getLogger(__name__) |
62 | 60 |
|
@@ -130,13 +128,12 @@ def Dump(directory="HTML", theme="topside_cms", exclude_ns="userprofiles", user= |
130 | 128 | shutil.copytree(norm(join(wiki_root, "wiki_local")), norm(join(html_root, "+serve/wiki_local"))) |
131 | 129 |
|
132 | 130 | # copy files from xstatic packaging into "+serve" subdirectory |
133 | | - pkg = app.cfg.pkg |
134 | 131 | xstatic_dirs = ["font_awesome", "jquery", "jquery_tablesorter", "autosize"] |
135 | 132 | if theme in ["basic"]: |
136 | 133 | xstatic_dirs.append("bootstrap") |
137 | | - for dirs in xstatic_dirs: |
138 | | - xs = XStatic(getattr(pkg, dirs), root_url="/static", provider="local", protocol="http") |
139 | | - shutil.copytree(xs.base_dir, norm(join(html_root, "+serve", dirs))) |
| 134 | + module_path_map = get_xstatic_module_path_map(xstatic_dirs) |
| 135 | + for xs_dir in xstatic_dirs: |
| 136 | + shutil.copytree(module_path_map[xs_dir], norm(join(html_root, "+serve", xs_dir))) |
140 | 137 |
|
141 | 138 | # copy directories for theme's static files |
142 | 139 | if theme == "topside_cms": |
|
0 commit comments