git://git.onelab.eu
/
myslice.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
9ba2e14
)
renamed template() into template_file()
author
Thierry Parmentelat
<thierry.parmentelat@inria.fr>
Thu, 20 Dec 2012 13:11:00 +0000
(14:11 +0100)
committer
Thierry Parmentelat
<thierry.parmentelat@inria.fr>
Thu, 20 Dec 2012 13:11:00 +0000
(14:11 +0100)
Makefile
patch
|
blob
|
history
engine/plugin.py
patch
|
blob
|
history
plugins/simplelist.py
patch
|
blob
|
history
plugins/tabs.py
patch
|
blob
|
history
plugins/verticallayout.py
patch
|
blob
|
history
diff --git
a/Makefile
b/Makefile
index
5565aae
..
8206a48
100644
(file)
--- a/
Makefile
+++ b/
Makefile
@@
-7,7
+7,7
@@
force:
#################### compute emacs tags
# list files under git but exclude third-party stuff like bootstrap and jquery
myfiles: force
#################### compute emacs tags
# list files under git but exclude third-party stuff like bootstrap and jquery
myfiles: force
- @git ls-files | egrep -v 'insert
_above/
|/bootstrap/|/jquery/|datatables/'
+ @git ls-files | egrep -v 'insert
(_|-)above
|/bootstrap/|/jquery/|datatables/'
# in general it's right to rely on the contents as reported by git
tags: force
# in general it's right to rely on the contents as reported by git
tags: force
diff --git
a/engine/plugin.py
b/engine/plugin.py
index
722787d
..
832f7cd
100644
(file)
--- a/
engine/plugin.py
+++ b/
engine/plugin.py
@@
-17,12
+17,17
@@
DEBUG= [ 'SliceList' ]
class Plugin:
class Plugin:
- uid=0
+ # using a simple incremental scheme to generate uuids for now
+ uuid=0
+
+ @staticmethod
+ def newuuid():
+ Plugin.uuid += 1
+ return Plugin.uuid
def __init__ (self, visible=True, hidable=True, hidden_by_default=False, **settings):
# xxx should generate some random id
def __init__ (self, visible=True, hidable=True, hidden_by_default=False, **settings):
# xxx should generate some random id
- self.uuid=Plugin.uid
- Plugin.uid += 1
+ self.uuid=Plugin.newuuid()
self.visible=visible
self.hidable=hidable
self.hidden_by_default=hidden_by_default
self.visible=visible
self.hidable=hidable
self.hidden_by_default=hidden_by_default
@@
-95,11
+100,11
@@
class Plugin:
return result
# you may redefine this completely, but if you don't we'll just use methods
return result
# you may redefine this completely, but if you don't we'll just use methods
- # . template() to find out which template to use, and
+ # . template
_file
() to find out which template to use, and
# . template_env() to compute a dictionary to pass along to the templating system
def render_content (self, request):
"""Should return an HTML fragment"""
# . 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()
+ template = self.template
_file
()
env=self.template_env(request)
if not isinstance (env,dict):
raise Exception, "%s.template_env returns wrong type"%self.classname()
env=self.template_env(request)
if not isinstance (env,dict):
raise Exception, "%s.template_env returns wrong type"%self.classname()
@@
-155,14
+160,14
@@
class Plugin:
# your plugin is expected to implement either
# (*) def render_content(self, request) -> html fragment
# -- or --
# your plugin is expected to implement either
# (*) def render_content(self, request) -> html fragment
# -- or --
- # (*) def template(self) -> filename
+ # (*) def template
_file
(self) -> filename
# relative to STATIC
# (*) 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
# relative to STATIC
# (*) 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"
+ # if you see this string somewhere your template
_file
() code is not kicking in
+ def template
_file
(self): return "undefined_template"
def template_env (self, request): return {}
# # tell the framework about requirements (for the document <header>)
def template_env (self, request): return {}
# # tell the framework about requirements (for the document <header>)
diff --git
a/plugins/simplelist.py
b/plugins/simplelist.py
index
6e041c6
..
c16c7ea
100644
(file)
--- a/
plugins/simplelist.py
+++ b/
plugins/simplelist.py
@@
-15,7
+15,7
@@
class SimpleList (Plugin) :
# SimpleList is useless per se anyways
def title (self) : return "Title for Simple List"
# SimpleList is useless per se anyways
def title (self) : return "Title for Simple List"
- def template (self): return "simplelist.html"
+ def template
_file
(self): return "simplelist.html"
def requirements (self):
reqs = { 'js_files' : [ "js/simplelist.js" ],
def requirements (self):
reqs = { 'js_files' : [ "js/simplelist.js" ],
diff --git
a/plugins/tabs.py
b/plugins/tabs.py
index
017628b
..
b4ad0c0
100644
(file)
--- a/
plugins/tabs.py
+++ b/
plugins/tabs.py
@@
-11,6
+11,6
@@
class Tabs (Composite):
'css/tabs.css',
] }
'css/tabs.css',
] }
- def template (self):
+ def template
_file
(self):
return "tabs.html"
return "tabs.html"
diff --git
a/plugins/verticallayout.py
b/plugins/verticallayout.py
index
6f97601
..
f109899
100644
(file)
--- a/
plugins/verticallayout.py
+++ b/
plugins/verticallayout.py
@@
-6,4
+6,4
@@
class VerticalLayout (Composite) :
def title (self) : return "VLayout title"
def title (self) : return "VLayout title"
- def template (self): return "verticallayout.html"
+ def template
_file
(self): return "verticallayout.html"