Changeset 1615 for trunk/pylucid/PyLucid/template_addons/lucidTag.py
- Timestamp:
- 06/02/08 08:54:23 (2 years ago)
- Files:
-
- 1 modified
-
trunk/pylucid/PyLucid/template_addons/lucidTag.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pylucid/PyLucid/template_addons/lucidTag.py
r1612 r1615 26 26 from PyLucid.system.response import SimpleStringIO 27 27 from PyLucid.system.context_processors import add_css_tag 28 from PyLucid.tools.data_eval import data_eval, DataEvalError 28 29 29 30 from django.conf import settings … … 105 106 {% lucidTag PluginName kwarg1="value1" kwarg2="value2" %} 106 107 """ 107 content = token.contents108 content = content.split(" ", 2)[1:]108 raw_content = token.contents 109 content = raw_content.split(" ", 2)[1:] 109 110 plugin_name = content.pop(0) 111 112 if "." in plugin_name: 113 plugin_name, method_name = plugin_name.split(".", 1) 114 else: 115 method_name = "lucidTag" 116 117 # print "1", content 118 # method_kwargs = {} 119 # if content: 120 # raw_kwargs = content[0] 121 # kwargs = raw_kwargs.replace("=", ":") 122 # kwargs = u"{ %s }" % kwargs 123 # print "2", kwargs 124 # try: 125 # method_kwargs = data_eval(kwargs) 126 # except DataEvalError, err: 127 # return lucidTagNodeError( 128 # plugin_name, method_name, 129 # msg = "Tag args error: %s" % err 130 # ) 131 # 132 # print "3", method_kwargs 110 133 111 134 method_kwargs = {} … … 123 146 method_kwargs[key] = value 124 147 125 if "." in plugin_name:126 plugin_name, method_name = plugin_name.split(".", 1)127 else:128 method_name = "lucidTag"129 130 148 return lucidTagNode(plugin_name, method_name, method_kwargs) 131 149