| 64 | | def _add_unique_div(self, context, content): |
| 65 | | """ |
| 66 | | Add a html DIV tag with a unique CSS-ID and a class name defined in |
| 67 | | the settings.py |
| 68 | | """ |
| 69 | | id = self.plugin_name + "_" + self.method_name |
| 70 | | id = makeUnique(id, context["CSS_ID_list"]) |
| 71 | | context["CSS_ID_list"].append(id) |
| 72 | | |
| 73 | | try: |
| 74 | | return u'<div class="%s %s" id="%s">\n%s\n</div>\n' % ( |
| 75 | | settings.CSS_DIV_CLASS_NAME, self.plugin_name, id, content |
| 76 | | ) |
| 77 | | except UnicodeDecodeError: |
| 78 | | # FIXME: In some case (with mysql_old) we have trouble here. |
| 79 | | # I get this traceback on www.jensdiemer.de like this: |
| 80 | | # |
| 81 | | #Traceback (most recent call last): |
| 82 | | #File ".../django/template/__init__.py" in render_node |
| 83 | | # 750. result = node.render(context) |
| 84 | | #File ".../PyLucid/defaulttags/lucidTag.py" in render |
| 85 | | # 102. content = self._add_unique_div(context, content) |
| 86 | | #File ".../PyLucid/defaulttags/lucidTag.py" in _add_unique_div |
| 87 | | # 73. return u'<div class="%s" id="%s">\n%s\n</div>\n' % ( |
| 88 | | # |
| 89 | | #UnicodeDecodeError at /FH-D-sseldorf/ |
| 90 | | #'ascii' codec can't decode byte 0xc3 in position 55: ordinal not in range(128) |
| 91 | | # |
| 92 | | #content += "UnicodeDecodeError hack active!" |
| 93 | | return '<div class="%s %s" id="%s">\n%s\n</div>\n' % ( |
| 94 | | settings.CSS_DIV_CLASS_NAME, str(self.plugin_name), str(id), |
| 95 | | content |
| 96 | | ) |
| 97 | | |
| 98 | | |