本文整理汇总了Python中forms.Form.dotted_quad方法的典型用法代码示例。如果您正苦于以下问题:Python Form.dotted_quad方法的具体用法?Python Form.dotted_quad怎么用?Python Form.dotted_quad使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类forms.Form
的用法示例。
在下文中一共展示了Form.dotted_quad方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from forms import Form [as 别名]
# 或者: from forms.Form import dotted_quad [as 别名]
def main(self, wan_ip0=0, wan_ip1=0, wan_ip2=0, wan_ip3=0,
subnet0=0, subnet1=0, subnet2=0, subnet3=0,
gateway0=0, gateway1=0, gateway2=0, gateway3=0,
dns10=0, dns11=0, dns12=0, dns13=0,
dns20=0, dns21=0, dns22=0, dns23=0,
dns30=0, dns31=0, dns32=0, dns33=0,
message=None, **kwargs):
if not cfg.users.expert():
return ''
store = filedict_con(cfg.store_file, 'router')
defaults = {'connect_type': "'DHCP'",
}
for k,c in defaults.items():
if not k in kwargs:
try:
kwargs[k] = store[k]
except KeyError:
exec("if not '%(k)s' in kwargs: store['%(k)s'] = kwargs['%(k)s'] = %(c)s" % {'k':k, 'c':c})
form = Form(title="WAN Connection",
action="/router/setup/wan/index",
name="wan_connection_form",
message=message)
form.dropdown('Connection Type', vals=["DHCP", "Static IP"], id="connect_type", onchange="hideshow_static()")
form.html('<div id="static_ip_form">')
form.dotted_quad("WAN IP Address", name="wan_ip", quad=[wan_ip0, wan_ip1, wan_ip2, wan_ip3])
form.dotted_quad("Subnet Mask", name="subnet", quad=[subnet0, subnet1, subnet2, subnet3])
form.dotted_quad("Gateway", name="gateway", quad=[gateway0, gateway1, gateway2, gateway3])
form.dotted_quad("Static DNS 1", name="dns1", quad=[dns10, dns11, dns12, dns13])
form.dotted_quad("Static DNS 2", name="dns2", quad=[dns20, dns21, dns22, dns23])
form.dotted_quad("Static DNS 3", name="dns3", quad=[dns30, dns31, dns32, dns33])
form.html('</div>')
form.html(""" <script LANGUAGE="JavaScript">
<!--
hideshow_static();
// -->
</script>""")
form.submit("Set Wan")
return form.render()