From d06e352233ca170fe3f59830bab20b1c6523e6c6 Mon Sep 17 00:00:00 2001 From: Steve Nyemba Date: Sat, 27 Jan 2024 17:52:16 -0600 Subject: [PATCH] bug fix: disk menu read --- cms/disk.py | 10 ++++++++-- cms/engine/__init__.py | 3 +-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/cms/disk.py b/cms/disk.py index 89c8526..7710811 100644 --- a/cms/disk.py +++ b/cms/disk.py @@ -29,8 +29,14 @@ def build (_config): #(_path,_content): _path = _config['layout']['root'] _items = folders(_path) _subItems = [ content (os.sep.join([_path,_name]))for _name in _items ] - # return dict(zip()) - return dict.fromkeys(_items,_subItems) + _r = {} + for _name in _items : + _index = _items.index(_name) + if _name not in _r : + _r[_name] = [] + _r[_name] += _subItems[_index] + return _r + # return dict.fromkeys(_items,_subItems) def html(uri) : _html = (open(uri)).read() diff --git a/cms/engine/__init__.py b/cms/engine/__init__.py index 8b5c150..b85632a 100644 --- a/cms/engine/__init__.py +++ b/cms/engine/__init__.py @@ -149,7 +149,6 @@ class Loader : _path = os.sep.join([PATH,_key+".py"]) if not os.path.exists(_path): - print ([' ?? ',_path]) continue for _name in _conf[_key] : _pointer = self._load_plugin(path=_path,name=_name) @@ -303,7 +302,7 @@ class Router : for _name in _system : _path = _system[_name]['path'] self._apps[_name] = Getter(path=_path,caller=_app,location=_path) - print ([_name, self._apps[_name].plugins().keys()]) + # print ([_name, self._apps[_name].plugins().keys()]) self._apps['main'] = _app def set(self,_id): self._id = _id