projects
/
cmless
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added %%current_year%% as template keyword.
[cmless]
/
bin
/
template.py
diff --git
a/bin/template.py
b/bin/template.py
index
f27f493
..
a39090f
100644
(file)
--- a/
bin/template.py
+++ b/
bin/template.py
@@
-2,7
+2,7
@@
# See LICENSE file for copyright and license details.
# Python imports
# See LICENSE file for copyright and license details.
# Python imports
-import os
+import os
, datetime
# CMless imports
import config, misc
# CMless imports
import config, misc
@@
-25,3
+25,9
@@
def body(template):
body = misc.process_markup(body)
return template.replace(config.template_delimiter + keyword +
config.template_delimiter, body)
body = misc.process_markup(body)
return template.replace(config.template_delimiter + keyword +
config.template_delimiter, body)
+
+def current_year(template):
+ keyword = "current_year"
+ now = datetime.datetime.now()
+ return template.replace(config.template_delimiter + keyword +
+ config.template_delimiter, str(now.year))