[PATCH ][Wok]Issue # 317 : Ginger should NOT depeden on

From: Atreyee Mukhopadhyay <atreyee@linux.vnet.ibm.com> This change will make any plugin UI extended by another. Gingers390x related changes will be imported dynamically to ginger when ginger390x plugin is installed. Atreyee Mukhopadhyay (1): Issue # 317: Ginger should NOT depeden on Ginger s390x src/wok/root.py | 8 ++++++++ src/wok/template.py | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) -- 2.1.0

From: Atreyee Mukhopadhyay <atreyee@linux.vnet.ibm.com> This change will make Gingers390x extend Ginger UI. All s390x specific functionality changes are moved to js files in Gingers390x plugin. --- src/wok/root.py | 8 ++++++++ src/wok/template.py | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/wok/root.py b/src/wok/root.py index 7a5fe9c..d1a2cc9 100644 --- a/src/wok/root.py +++ b/src/wok/root.py @@ -120,6 +120,13 @@ class Root(Resource): data = {} data['ui_dir'] = paths.ui_dir + data['scripts'] = [] + for plugin, app in cherrypy.tree.apps.iteritems(): + if app.root.extends is not None: + scripts = app.root.extends.get(script_name, {}) + if page in scripts.keys(): + data['scripts'].append(scripts[page]) + if page.endswith('.html'): context = template.render('/tabs/' + page, data) cherrypy.response.cookie["lastPage"] = "/#" + last_page @@ -140,6 +147,7 @@ class WokRoot(Root): self.domain = 'wok' self.messages = messages self.log_map = ROOT_REQUESTS + self.extends = None @cherrypy.expose def login(self, *args): diff --git a/src/wok/template.py b/src/wok/template.py index b47041a..2162c8a 100644 --- a/src/wok/template.py +++ b/src/wok/template.py @@ -99,7 +99,7 @@ def render_cheetah_file(resource, data): 'localedir': paths.mo_dir, 'lang': [lang]} params['lang'] = gettext_conf - params['data'] = {'ui_dir': paths.ui_dir} + params['data'] = data return Template(file=filename, searchList=params).respond() except OSError, e: if e.errno == errno.ENOENT: -- 2.1.0

Reviewed-by: Aline Manera <alinefm@linux.vnet.ibm.com> On 04/27/2016 01:40 PM, atreyee@linux.vnet.ibm.com wrote:
From: Atreyee Mukhopadhyay <atreyee@linux.vnet.ibm.com>
This change will make Gingers390x extend Ginger UI. All s390x specific functionality changes are moved to js files in Gingers390x plugin. --- src/wok/root.py | 8 ++++++++ src/wok/template.py | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/src/wok/root.py b/src/wok/root.py index 7a5fe9c..d1a2cc9 100644 --- a/src/wok/root.py +++ b/src/wok/root.py @@ -120,6 +120,13 @@ class Root(Resource): data = {} data['ui_dir'] = paths.ui_dir
+ data['scripts'] = [] + for plugin, app in cherrypy.tree.apps.iteritems(): + if app.root.extends is not None: + scripts = app.root.extends.get(script_name, {}) + if page in scripts.keys(): + data['scripts'].append(scripts[page]) + if page.endswith('.html'): context = template.render('/tabs/' + page, data) cherrypy.response.cookie["lastPage"] = "/#" + last_page @@ -140,6 +147,7 @@ class WokRoot(Root): self.domain = 'wok' self.messages = messages self.log_map = ROOT_REQUESTS + self.extends = None
@cherrypy.expose def login(self, *args): diff --git a/src/wok/template.py b/src/wok/template.py index b47041a..2162c8a 100644 --- a/src/wok/template.py +++ b/src/wok/template.py @@ -99,7 +99,7 @@ def render_cheetah_file(resource, data): 'localedir': paths.mo_dir, 'lang': [lang]} params['lang'] = gettext_conf - params['data'] = {'ui_dir': paths.ui_dir} + params['data'] = data return Template(file=filename, searchList=params).respond() except OSError, e: if e.errno == errno.ENOENT:

Reviewed-by: Daniel Barboza <dhbarboza82@gmail.com> On 04/27/2016 01:40 PM, atreyee@linux.vnet.ibm.com wrote:
From: Atreyee Mukhopadhyay <atreyee@linux.vnet.ibm.com>
This change will make Gingers390x extend Ginger UI. All s390x specific functionality changes are moved to js files in Gingers390x plugin. --- src/wok/root.py | 8 ++++++++ src/wok/template.py | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/src/wok/root.py b/src/wok/root.py index 7a5fe9c..d1a2cc9 100644 --- a/src/wok/root.py +++ b/src/wok/root.py @@ -120,6 +120,13 @@ class Root(Resource): data = {} data['ui_dir'] = paths.ui_dir
+ data['scripts'] = [] + for plugin, app in cherrypy.tree.apps.iteritems(): + if app.root.extends is not None: + scripts = app.root.extends.get(script_name, {}) + if page in scripts.keys(): + data['scripts'].append(scripts[page]) + if page.endswith('.html'): context = template.render('/tabs/' + page, data) cherrypy.response.cookie["lastPage"] = "/#" + last_page @@ -140,6 +147,7 @@ class WokRoot(Root): self.domain = 'wok' self.messages = messages self.log_map = ROOT_REQUESTS + self.extends = None
@cherrypy.expose def login(self, *args): diff --git a/src/wok/template.py b/src/wok/template.py index b47041a..2162c8a 100644 --- a/src/wok/template.py +++ b/src/wok/template.py @@ -99,7 +99,7 @@ def render_cheetah_file(resource, data): 'localedir': paths.mo_dir, 'lang': [lang]} params['lang'] = gettext_conf - params['data'] = {'ui_dir': paths.ui_dir} + params['data'] = data return Template(file=filename, searchList=params).respond() except OSError, e: if e.errno == errno.ENOENT:
participants (3)
-
Aline Manera
-
atreyee@linux.vnet.ibm.com
-
Daniel Henrique Barboza