本文整理匯總了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()