Skip to content

Commit e111430

Browse files
authored
Merge pull request #2034 from roland-ruedenauer/fix-issue-2031
Fix issue #2031: 'Config' object has no attribute 'pkg'
2 parents 1957426 + cb56eee commit e111430

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

src/moin/cli/maint/dump_html.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@
4343

4444
from werkzeug.exceptions import Forbidden
4545

46-
from xstatic.main import XStatic
47-
46+
from moin import log
4847
from moin.app import create_app, before_wiki, setup_user_anon
4948
from moin.apps.frontend.views import show_item
5049
from moin.constants.keys import CONTENTTYPE, CURRENT, NAME_EXACT, THEME_NAME, LATEST_REVS
@@ -55,8 +54,7 @@
5554
CONTENTTYPE_OTHER_SUFFIX,
5655
)
5756
from moin.items import Item
58-
59-
from moin import log
57+
from moin.utils import get_xstatic_module_path_map
6058

6159
logging = log.getLogger(__name__)
6260

@@ -130,13 +128,12 @@ def Dump(directory="HTML", theme="topside_cms", exclude_ns="userprofiles", user=
130128
shutil.copytree(norm(join(wiki_root, "wiki_local")), norm(join(html_root, "+serve/wiki_local")))
131129

132130
# copy files from xstatic packaging into "+serve" subdirectory
133-
pkg = app.cfg.pkg
134131
xstatic_dirs = ["font_awesome", "jquery", "jquery_tablesorter", "autosize"]
135132
if theme in ["basic"]:
136133
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)))
140137

141138
# copy directories for theme's static files
142139
if theme == "topside_cms":

0 commit comments

Comments
 (0)