当前位置: 首页>>代码示例>>Python>>正文


Python net.websafe函数代码示例

本文整理汇总了Python中net.websafe函数的典型用法代码示例。如果您正苦于以下问题:Python websafe函数的具体用法?Python websafe怎么用?Python websafe使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了websafe函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: render

 def render(self):
     x = '<input type="password" name="%s"' % net.websafe(self.name)
     if self.value: x += ' value="%s"' % net.websafe(self.value)
     x += self.addatts()
     x += ' />'
     x += self.rendernote(self.note)
     return x
开发者ID:macroyuyang,项目名称:card,代码行数:7,代码来源:form.py

示例2: render

 def render(self):
     x = '<textarea name="%s"' % net.websafe(self.name)
     x += self.addatts()
     x += '>'
     if self.value is not None: x += net.websafe(self.value)
     x += '</textarea>'
     return x
开发者ID:Ashwini5555,项目名称:fobliki,代码行数:7,代码来源:form.py

示例3: render

 def render(self):
     attrs = self.attrs.copy()
     attrs['name'] = self.name
     attrs['type'] = net.websafe(self.type)
     if self.value is not None:
         attrs['value'] = self.value
     html = attrs.pop('html', None) or net.websafe(self.name)
     return '<button %s>%s</button>' % (attrs, html)
开发者ID:darrenkuo,项目名称:the_clustering_experiment,代码行数:8,代码来源:form.py

示例4: render

 def render(self):
     x = '<textarea name="%s"' % net.websafe(self.name)
     x += self.addatts()
     x += '>'
     if self.value is not None: x += net.websafe(self.value).decode('utf-8')
     x += '</textarea>'
     x = self.rendernote(self.note) + x
     return x
开发者ID:sibande,项目名称:blog.py,代码行数:8,代码来源:form.py

示例5: render

 def render(self):
     x = '<select name="%s"%s>\n' % (net.websafe(self.name), self.addatts())
     for arg in self.args:
         if self.value == arg: select_p = ' selected="selected"'
         else: select_p = ''
         x += "  <option"+select_p+">%s</option>\n" % net.websafe(arg)
     x += '</select>\n'
     return x
开发者ID:Codesleuth,项目名称:rabbitmq-dotnet-client,代码行数:8,代码来源:form.py

示例6: render

 def render(self):
     attrs = self.attrs.copy()
     attrs["name"] = self.name
     if self.value is not None:
         attrs["value"] = self.value
     html = attrs.pop("html", None) or net.websafe(self.name)
     return "<button %s>%s</button>" % (attrs, html)
开发者ID:28554010,项目名称:sub,代码行数:7,代码来源:form.py

示例7: render_css

 def render_css(self): 
     out = [] 
     out.append(self.rendernote(self.note)) 
     for i in self.inputs: 
         out.append('<label for="%s">%s</label>' % (i.id, net.websafe(i.description))) 
         out.append(i.pre) 
         out.append(i.render()) 
         out.append(i.post) 
         out.append('\n') 
     return ''.join(out) 
开发者ID:sibande,项目名称:blog.py,代码行数:10,代码来源:form.py

示例8: _render_option

    def _render_option(self, arg, indent='  '):
        if isinstance(arg, (tuple, list)):
            value, desc= arg
        else:
            value, desc = arg, arg 

        if self.value == value or (isinstance(self.value, list) and value in self.value):
            select_p = ' selected="selected"'
        else:
            select_p = ''
        return indent + '<option%s value="%s">%s</option>\n' % (select_p, net.websafe(value), net.websafe(desc))
开发者ID:aandoni,项目名称:Pablo,代码行数:11,代码来源:form.py

示例9: render_css

 def render_css(self):
     out = []
     out.append(self.rendernote(self.note))
     for i in self.inputs:
         if not i.is_hidden():
             out.append('<label for="%s">%s</label>' % (i.id, net.websafe(i.description)))
         out.append(i.pre)
         out.append(i.render())
         out.append(self.rendernote(i.note))
         out.append(i.post)
         out.append("\n")
     return "".join(out)
开发者ID:28554010,项目名称:sub,代码行数:12,代码来源:form.py

示例10: render

    def render(self):
        out = ''
        out += self.rendernote(self.note)
#         out += '<table>\n'
        
        for i in self.inputs:
            html = utils.safeunicode(i.pre) + i.render() + self.rendernote(i.note) + utils.safeunicode(i.post)
            if i.is_hidden():
                out += '    <div style="display: none;">%s</div>\n' % (html)
            else:
                out += '    <label for="%s">%s</label>%s\n' % (i.id, net.websafe(i.description), html)
#         out += "</table>"
        return out
开发者ID:aandoni,项目名称:Pablo,代码行数:13,代码来源:form.py

示例11: render_css

 def render_css(self): 
     out = [] 
     out.append(self.rendernote(self.note)) 
     for i in self.inputs:
         out.append('<div class="row">')
         if not i.is_hidden():
             out.append('<label for="%s">%s</label>' % (i.id, net.websafe(i.description))) 
         out.append(i.pre)
         out.append(i.render()) 
         out.append(self.rendernote(i.note))
         out.append(i.post)
         out.append('</div>')
         out.append('\n')
     return ''.join(out) 
开发者ID:badrul,项目名称:newtifry,代码行数:14,代码来源:form.py

示例12: render

 def render(self):
     x = '<span>'
     for arg in self.args:
         if isinstance(arg, (tuple, list)):
             value, desc= arg
         else:
             value, desc = arg, arg 
         attrs = self.attrs.copy()
         attrs['name'] = self.name
         attrs['type'] = 'radio'
         attrs['value'] = arg
         if self.value == arg:
             attrs['checked'] = 'checked'
         x += '<input %s/> %s' % (attrs, net.websafe(desc))
     x += '</span>'
     return x
开发者ID:badrul,项目名称:newtifry,代码行数:16,代码来源:form.py

示例13: render

    def render(self):
        out = ""
        out += self.rendernote(self.note)
        out += "<table>\n"

        for i in self.inputs:
            html = i.pre + i.render() + self.rendernote(i.note) + i.post
            if i.is_hidden():
                out += '    <tr style="display: none;"><th></th><td>%s</td></tr>\n' % (html)
            else:
                out += '    <tr><th><label for="%s">%s</label></th><td>%s</td></tr>\n' % (
                    i.id,
                    net.websafe(i.description),
                    html,
                )
        out += "</table>"
        return out
开发者ID:phb,项目名称:socorro,代码行数:17,代码来源:form.py

示例14: render

 def render(self):
     out = ''
     out += self.rendernote(self.note)
     out += '<table class="formtab table table-bordered">\n'
     out += '<thead ><tr class=active><th>%s</th><th class=rtd><a class="btn"\
            href="javascript:history.go(-1);">%s</a></th></tr></thead>\n'%(self.title, net.websafe("返回"))
     
     for i in self.inputs:
         html = safeunicode(i.pre) + i.render() + self.rendernote(i.note) + safeunicode(i.post)
         if i.is_hidden():
             out += '    <tr style="display: none;"><td></td><td>%s</td></tr>\n' % (html)
         else:
             out += '    <tr><td>%s</td><td>%s</td></tr>\n' % ( net.websafe(i.description),html)
     if self.error:
          out += '    <tr><td colspan=2>%s</td></tr>\n' % ( self.rendernote(self.error))
     out += "</table>"
     return out
开发者ID:shtrend,项目名称:ToughRADIUS,代码行数:17,代码来源:__init__.py

示例15: rendernote

 def rendernote(self, note):
     if note: return '<span class="error">%s</span>' % net.websafe(note)
     else: return ""
开发者ID:badrul,项目名称:newtifry,代码行数:3,代码来源:form.py


注:本文中的net.websafe函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。