Changeset 1250

Show
Ignore:
Timestamp:
09/26/07 07:49:52 (2 years ago)
Author:
JensDiemer
Message:

Update the external PyLucid Plugin "DecodeUnicode?" from v0.7.x to v0.8

Location:
PyLucidPlugins/DecodeUnicode
Files:
1 added
2 modified
3 moved

Legend:

Unmodified
Added
Removed
  • PyLucidPlugins/DecodeUnicode/DecodeUnicode.py

    r821 r1250  
    1313Last commit info: 
    1414---------------------------------- 
    15 LastChangedDate: $LastChangedDate:$ 
    16 Revision.......: $Rev:$ 
     15LastChangedDate: $LastChangedDate$ 
     16Revision.......: $Rev$ 
    1717Author.........: $Author$ 
    1818""" 
     
    2020 
    2121 
    22 __version__="$Rev:$" 
     22__version__="$Rev$" 
    2323 
    2424 
     
    3030 
    3131 
    32 from PyLucid.system.BaseModule import PyLucidBaseModule 
    33  
    34  
    35  
    36  
    37 class DecodeUnicode(PyLucidBaseModule): 
     32from PyLucid.system.BasePlugin import PyLucidBasePlugin 
     33 
     34 
     35class DecodeUnicode(PyLucidBasePlugin): 
    3836 
    3937    blocks = [ 
     
    186184 
    187185    def lucidTag(self): 
    188         #~ self.response.debug() 
    189  
    190186        self.block_select() 
    191187 
     
    201197 
    202198        context = { 
    203             "url": self.URLs.actionLink("display"), 
     199            "url": self.URLs.methodLink("display"), 
    204200            "selected_id": selected_id, 
    205201            "blocks": block_data, 
    206202        } 
    207         #~ self.page_msg(context) 
    208         self.templates.write("select", context) 
     203        self._render_template("select", context) 
    209204 
    210205    def display(self, function_info=None): 
     
    218213        else: 
    219214            try: 
    220                 block_id = self.request.form["block"] 
     215                block_id = self.request.POST["block"] 
    221216                block_id = int(block_id) 
    222217            except (KeyError, ValueError): 
     
    245240 
    246241        context = { 
    247             "back_url"  : self.URLs.actionLink("display", back_id), 
     242            "back_url"  : self.URLs.methodLink("display", back_id), 
    248243            "back_name"  : self.blocks[back_id]["name"], 
    249             "next_url"  : self.URLs.actionLink("display", next_id), 
     244            "next_url"  : self.URLs.methodLink("display", next_id), 
    250245            "next_name"  : self.blocks[next_id]["name"], 
    251246 
    252             "url"       : self.URLs.actionLink("display", block_id), 
     247            "url"       : self.URLs.methodLink("display", block_id), 
    253248            "block_name": block["name"], 
    254249            "ucHex": "%X" % block_range[0], # Für decodeunicode.org Link 
     
    259254            "unidata_version": unicodedata.unidata_version, 
    260255        } 
    261         #~ self.templates.write("display", context, debug=True) 
    262         self.templates.write("display", context, debug=False) 
     256        self._render_template("display", context) 
    263257 
    264258    def get_block_data(self, block): 
  • PyLucidPlugins/DecodeUnicode/DecodeUnicode_cfg.py

    r637 r1250  
    1414# Module-Manager Daten 
    1515 
    16 module_manager_data = { 
     16plugin_manager_data = { 
    1717    "lucidTag"  : { 
    1818        "must_login"    : False, 
     
    2121            "name"              : "select", 
    2222            "description"       : "select a unicode block range", 
    23             "template_engine"   : "jinja", 
    2423            "markup"            : None 
    2524        }, 
     
    3130            "name"              : "display", 
    3231            "description"       : "display a unicode block range", 
    33             "template_engine"   : "jinja", 
    3432            "markup"            : None 
    3533        }, 
  • PyLucidPlugins/DecodeUnicode/internal_pages/display.html

    r821 r1250  
    1 {* 
    2     Jinja Template 
    3     <pre>{% debug %}</pre> 
    4 *} 
    5  
    61<fieldset><legend>{{ range_hex1 }}-{{ range_hex2 }} - {{ block_name }}:</legend> 
    72<p> 
     
    2318        <th>unicode name</th> 
    2419    </tr> 
    25     {% for row in block_data %}{% cycle rowclass through "odd", "even" %} 
    26     <tr class="{{ rowclass }}"> 
     20    {% for row in block_data %} 
     21    <tr class="{% cycle 'odd' 'even' %}"> 
    2722        <td>{{ row.id }}</td> 
    2823        <td><strong>{{ row.char }}</strong></td> 
    2924        <td title="Use in Python like this: &gt;print u'{{ row.unicode }}'&lt;">{{ row.unicode }}</td> 
    3025        <td title="Use in Python like this: &gt;print '{{ row.hex }}'&lt;">{{ row.hex }}</td> 
    31         <td>{{ row.html|escapexml }}</td> 
     26        <td>{{ row.html|escape }}</td> 
    3227        <td> 
    3328            <a name="{{ row.id }}"><a href="{{ url }}#{{ row.id }}" title="anchor to this char"> 
  • PyLucidPlugins/DecodeUnicode/internal_pages/select.html

    r638 r1250  
    1 {* 
    2     Jinja Template 
    3     <pre>{% debug %}</pre> 
    4 *} 
    5  
    61<fieldset><legend>Select a unicode block:</legend> 
    72    <label for="block">select a unicode block:</label> 
     
    94        <select name="block"> 
    105            {% for block in blocks %} 
    11             <option value="{{ block.id }}" {% if block.id equals selected_id %}selected="selected"{% endif %}> 
     6            <option value="{{ block.id }}" {% ifequal block.id selected_id %}selected="selected"{% endifequal %}> 
    127                {{ block.id }} - {{ block.name }} 
    138            </option>