rename render_env -> template_env
authorThierry Parmentelat <thierry.parmentelat@inria.fr>
Thu, 20 Dec 2012 10:58:27 +0000 (11:58 +0100)
committerThierry Parmentelat <thierry.parmentelat@inria.fr>
Thu, 20 Dec 2012 10:58:27 +0000 (11:58 +0100)
Makefile
engine/composite.py
engine/plugin.py
engine/prelude.py
engine/views.py
slice/views.py

index 92f9d13..5565aae 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -23,6 +23,8 @@ list-js: force
        @find . -type f -name '*.js' | grep -v '/all-static/'
 list-css: force
        @find . -type f -name '*.css' | grep -v '/all-static/'
+list-img:
+       @find . -type f -name '*.png' | grep -v '/all-static/'
 
 #################### manage static contents (extract from all the modules into the single all-static location)
 static: force
index cd653f8..ec2a678 100644 (file)
@@ -9,7 +9,7 @@ class Composite (Plugin):
     def insert (self, plugin):
         self.sons.append(plugin)
 
-    def render_env (self, request):
+    def template_env (self, request):
         # this is designed so as to support a template like
         # {% for son in sons %} {{ son.rendered }} ...
         return { 'sons': 
@@ -21,4 +21,4 @@ class Composite (Plugin):
     # xxx need a way to select an active son, like e.g.
     # Composite (active='some string')
     # and we could then try to find that string in either title or uuid or some other place
-    # in which case the corresponding 'son' entry in render_env above would son.active=True
+    # in which case the corresponding 'son' entry in template_env above would son.active=True
index c7df2d3..722787d 100644 (file)
@@ -96,13 +96,13 @@ class Plugin:
         
     # you may redefine this completely, but if you don't we'll just use methods 
     # . template() to find out which template to use, and 
-    # . render_env() to compute a dictionary to pass along to the templating system
+    # . template_env() to compute a dictionary to pass along to the templating system
     def render_content (self, request):
         """Should return an HTML fragment"""
         template = self.template()
-        env=self.render_env(request)
+        env=self.template_env(request)
         if not isinstance (env,dict):
-            raise Exception, "%s.render_env returns wrong type"%self.classname()
+            raise Exception, "%s.template_env returns wrong type"%self.classname()
         # expose this class's settings to the template
         # xxx we might need to check that this does not overwrite env..
         env.update(self._settings)
@@ -157,13 +157,13 @@ class Plugin:
     # -- or --
     # (*) def template(self) -> filename
     #   relative to STATIC 
-    # (*) def render_env (self, request) -> dict
+    # (*) def template_env (self, request) -> dict
     #   this is the variable->value association used to render the template
     # in which case the html template will be used
 
     # if you see this string somewhere your template() code is not kicking in
     def template (self):                return "undefined_template"
-    def render_env (self, request):     return {}
+    def template_env (self, request):     return {}
 
 #    # tell the framework about requirements (for the document <header>)
 #    # the notion of 'Media' in django provides for medium-dependant
index b983558..2975cca 100644 (file)
@@ -45,7 +45,7 @@ class Prelude:
     # probably insert_above is not powerful enough to handle that
     # 
     # so a much simpler and safer approach is for use to compute the html header directly
-    def render_env (self): 
+    def template_env (self): 
         env={}
         env['js_files']=  self.js_files
         env['css_files']= self.css_files
index 7160944..7758ac6 100644 (file)
@@ -49,7 +49,7 @@ def test_plugin_view (request):
 
     # request.plugin_prelude holds a summary of the requirements() for all plugins
     # define {js,css}_{files,chunks}
-    prelude_env = request.plugin_prelude.render_env()
+    prelude_env = request.plugin_prelude.template_env()
     print 'prelude_env',prelude_env
     template_env.update(prelude_env)
 
index 857499a..994e915 100644 (file)
@@ -29,7 +29,7 @@ def fake_slice_view (request, name=None):
 @login_required
 def tab_view (request):
     prelude=Prelude( js_files='bootstrap/js/bootstrap.js', css_files='bootstrap/css/bootstrap.css')
-    prelude_env = prelude.render_env()
+    prelude_env = prelude.template_env()
     tab_env = {'title':'Page for playing with Tabs',
                'topmenu_items': topmenu_items('tab',request),
                'username':the_user (request),