本文整理汇总了Python中webui.WebUI类的典型用法代码示例。如果您正苦于以下问题:Python WebUI类的具体用法?Python WebUI怎么用?Python WebUI使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了WebUI类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: handle
def handle(req):
req.content_type = req.headers_out['Content-Type'] = 'text/html'
cfg = config.Config('/data/pypi/config.ini')
request = RequestWrapper(cfg, req)
pseudoenv = {}
pseudoenv['CONTENT_TYPE'] = req.headers_in.get('content-type', '')
pseudoenv['REMOTE_ADDR'] = req.get_remote_host(apache.REMOTE_NOLOOKUP)
pseudoenv['HTTP_USER_AGENT'] = req.headers_in.get('user-agent', '')
pseudoenv['QUERY_STRING'] = req.args
pseudoenv['HTTP_CGI_AUTHORIZATION'] = req.headers_in.get('authorization',
'')
pseudoenv['REQUEST_METHOD'] = req.method
path_info = req.path_info
pseudoenv['PATH_INFO'] = path_info
try:
handler = WebUI(request, pseudoenv)
handler.run()
except:
s = StringIO.StringIO()
traceback.print_exc(None, s)
req.write("<pre>")
req.write(cgi.escape(s.getvalue()))
req.write("</pre>")
req.headers_out['Content-Type'] = 'text/html'
req.content_type = req.headers_out['Content-Type']
return apache.OK
开发者ID:ericholscher,项目名称:pypi,代码行数:26,代码来源:pypi.py
示例2: CLOUD
class CLOUD(object):
# TODO:
# - based on reply from qa team, the access url should be full qualified
# name or ip address base on auth conf. since the web server might not be
# resolved in testing environment or against certain conf which may cause
# problem when verifying traffic pass-through successfully or not. pre_url
# is temporary solution which is used to trigger the auth process. for
# example, pre_url in full qualified name to trigger auth process while
# url in ip address to verify traffic.
def __init__(self, url, title, pre_url=None):
self.url = url
self.title = title
self.pre_url = pre_url if pre_url else url
self.w = WebUI()
self.mode = None
self.popup = None
def check_cloud_on(self, locator, displayed):
for i in range(4):
try:
self.w.wait_until_element_displayed(displayed)
break
except Exception, e:
self.w.warn('Fail to find element %s, before check %s, will try again' \
%(str(displayed), str(locator)), True)
if i == 3:
raise WebUIException('Fail to find element %s, before check %s' \
%(str(displayed), str(locator)))
check_element = self.w.find_element(locator)
if not check_element.is_selected():
check_element.click()
开发者ID:gvsurenderreddy,项目名称:AerohiveAuto,代码行数:33,代码来源:__init__.py
示例3: new_policy
def new_policy():
wui=WebUI()
hm=HM()
if wui.session_id is None:
hm.login(wui.d("login.server"),
wui.d("login.username"),
wui.d("login.password"))
hm.new_policy(wui.d("policy.name"))
开发者ID:gvsurenderreddy,项目名称:AerohiveAuto,代码行数:8,代码来源:new_policy.py
示例4: policy_config
def policy_config():
wui=WebUI()
hm=HM()
if wui.session_id is None:
hm.login_by_vhm(wui.d("login.server"),
wui.d("login.username"),
wui.d("login.password"))
hm.config_ssid_express(wui.d("policy.name"))
开发者ID:gvsurenderreddy,项目名称:AerohiveAuto,代码行数:8,代码来源:policy_config_express.py
示例5: update
def update():
wui=WebUI()
hm=HM()
if wui.session_id is None:
hm.login(wui.d("login.server"),
wui.d("login.username"),
wui.d("login.password"))
hm.update_hm_service(wui.d("service.name"))
开发者ID:gvsurenderreddy,项目名称:AerohiveAuto,代码行数:8,代码来源:hm_service.py
示例6: main
def main():
wui = WebUI()
hm = HM()
if wui.session_id is None:
hm.login(wui.d("login.server"),
wui.d("login.username"),
wui.d("login.password"))
hm.test()
开发者ID:gvsurenderreddy,项目名称:AerohiveAuto,代码行数:8,代码来源:t.py
示例7: upload_and_activate_configuration
def upload_and_activate_configuration():
wui = WebUI()
hm = HM()
hm.login(wui.d("login.server"),
wui.d("login.username"),
wui.d("login.password"))
hm.to_hiveaps_table()
hm.upload_and_activate_configuration(wui.d("ap.mgt0_ip"))
开发者ID:gvsurenderreddy,项目名称:AerohiveAuto,代码行数:8,代码来源:manage_ap.py
示例8: update
def update():
wui=WebUI()
hm=HM()
if wui.session_id is None:
hm.login(wui.d("login.server"),
wui.d("login.username"),
wui.d("login.password"))
hm.to_hiveaps_table()
hm.update_country_code(wui.d("ap.mgt0_ip"))
开发者ID:gvsurenderreddy,项目名称:AerohiveAuto,代码行数:9,代码来源:update_country_code.py
示例9: modify
def modify():
wui=WebUI()
hm=HM()
if wui.session_id is None:
hm.login(wui.d("login.server"),
wui.d("login.username"),
wui.d("login.password"))
hm.to_hiveaps_table()
hm.modify(wui.d("modify.mgt0_ip"), wui.d("modify.name"))
开发者ID:gvsurenderreddy,项目名称:AerohiveAuto,代码行数:9,代码来源:modify.py
示例10: policy_config
def policy_config():
wui=WebUI()
hm=HM()
configer = Configuration()
if wui.session_id is None:
hm.login(wui.d("login.server"),
wui.d("login.username"),
wui.d("login.password"))
for config_object in wui.d("policy.name").split():
configer.create_config(config_object)
开发者ID:gvsurenderreddy,项目名称:AerohiveAuto,代码行数:10,代码来源:policy_config.py
示例11: update
def update():
wui = WebUI()
hm = HM()
if wui.session_id is None:
hm.login(wui.d("login.server"),
wui.d("login.username"),
wui.d("login.password"))
hm.to_hiveaps_table()
hm.update_bootstrap(wui.d("ap.mgt0_ip"))
hm.check_update_result(wui.d("ap.mgt0_ip"))
开发者ID:gvsurenderreddy,项目名称:AerohiveAuto,代码行数:10,代码来源:update_bootstrap.py
示例12: create_device_sn
def create_device_sn():
wui = WebUI()
d = Devices(wui.d("visit.url"), wui.d("visit.title"))
if wui.session_id:
d.to_url_home()
d.to_menu(wui.d('devices.menu_name'))
d.wait_until_to_menu_success(wui.d("devices.menu_name"))
if d.check_sn_exist(wui.d('devices.sn_number')):
wui.info('this is serial number is exist, do remove it.', True)
d.remove_devices_by_serial_numbers(wui.d('devices.sn_number'))
d.add_devices_by_serial_numbers(wui.d('devices.sn_number'))
else:
d.logout()
开发者ID:gvsurenderreddy,项目名称:AerohiveAuto,代码行数:13,代码来源:create_device_sn.py
示例13: login_hm
def login_hm():
wui = WebUI()
import platform
if platform.system() == 'Windows':
server = 'https://10.155.40.100/'
else:
server = wui.d('hm_server')
admin = wui.d('user_admin.name')
admin_pwd = wui.d('user_admin.passwd')
hm = HM()
hm.login(server, admin, admin_pwd)
开发者ID:gvsurenderreddy,项目名称:AerohiveAuto,代码行数:13,代码来源:test.py
示例14: create_network_policy
def create_network_policy():
wui = WebUI()
cloud = CLOUD(wui.d("visit.url"), wui.d("visit.title"))
if wui.session_id:
cloud.to_url_home()
cloud.to_menu(wui.d("policy.menu_name"))
cloud.wait_until_to_menu_success(wui.d("policy.menu_name"))
cloud.to_page_before_policy()
cloud.create_network_policy(wui.d("policy.name"), wui.d("policy.Description"))
cloud.wait_until_create_policy_result(wui.d("policy.success_msg"), check_success=wui.d("policy.check_success"))
# cloud.to_page_before_deployed_ssid()
# cloud.create_SSID(wui.d("ssid.name"), wui.d("ssid.name"))
# cloud.wait_until_create_ssid_result(wui.d("ssid.success_msg"), check_success=wui.d("ssid.check_success"))
#
# cloud.to_page_device_templates()
# cloud.to_page_additional_settings()
#
# cloud.to_page_deploy_policy()
# cloud.wait_until_to_deploy_policy_page(wui.d("deploy_policy.menu_title"))
# cloud.select_checkbox_deploy_policy(wui.d("deploy_policy.check_mac"), wui.d("deploy_policy.dut_number"))
# cloud.wait_until_to_deploy_policy_success(wui.d("deploy_policy.success_msg"), check_success=wui.d("deploy_policy.check_success"))
# cloud.wait_until_login_success(popup=wui.d("login.popup_timer"), success_page=wui.d("login.success_page"))
# if wui.d("login.success_page") == 'false':
# return
# else:
# cloud.to_url_after_login(redirect=wui.d("visit.auto_redirect"))
else:
cloud.policy_mode()
cloud.logout()
开发者ID:gvsurenderreddy,项目名称:AerohiveAuto,代码行数:33,代码来源:hshao_test.py
示例15: cwp_register_negative
def cwp_register_negative():
wui = WebUI()
cwp = CWP(wui.d("visit.url"), wui.d("visit.title"), wui.d("visit.pre_url"))
cwp.to_url_before_login()
cwp.register(wui.d("register.first_name"),
wui.d("register.last_name"),
wui.d("register.email"),
wui.d("register.phone"),
wui.d("register.visiting"),
wui.d("register.reason"))
cwp.wait_until_login_fail()
开发者ID:gvsurenderreddy,项目名称:AerohiveAuto,代码行数:11,代码来源:cwp_register_negative.py
示例16: cwp_login_negative_amigopod
def cwp_login_negative_amigopod():
wui = WebUI()
cwp = CWP(wui.d("visit.url"), wui.d("visit.title"), wui.d("visit.pre_url"))
if wui.session_id is None:
cwp.to_url_before_login(location='CWP_custom_loginpage_amigopod')
cwp.login_amigopod(wui.d("login.username"),
wui.d("login.password"))
cwp.wait_until_login_fail(failed_page=wui.d("login.failed_page"), redirect_page_name=wui.d("redirect.page_name"))
elif wui.session_id and wui.d("visit.login_page_exist") == "true":
cwp.login_amigopod(wui.d("login.username"),
wui.d("login.password"))
cwp.wait_until_login_fail(failed_page=wui.d("login.failed_page"), redirect_page_name=wui.d("redirect.page_name"))
开发者ID:gvsurenderreddy,项目名称:AerohiveAuto,代码行数:12,代码来源:cwp_login_negative_amigoopod.py
示例17: cwp_register_negative
def cwp_register_negative():
wui = WebUI()
cwp = CWP(wui.d("visit.url"), wui.d("visit.title"), wui.d("visit.pre_url"))
cwp.to_url_before_login()
cwp.register123(wui.d("register.first_name"),
wui.d("register.last_name"),
wui.d("register.email"),
wui.d("register.visiting"))
cwp.wait_until_login_fail(redirect_page_name='registration123')
开发者ID:gvsurenderreddy,项目名称:AerohiveAuto,代码行数:9,代码来源:cwp_register_negative_registration123.py
示例18: __init__
def __init__(self, url, title, pre_url=None):
self.url = url
self.title = title
self.pre_url = pre_url if pre_url else url
self.w = WebUI()
self.mode = None
self.popup = None
开发者ID:gvsurenderreddy,项目名称:AerohiveAuto,代码行数:8,代码来源:__init__.py
示例19: main
def main():
wui = WebUI()
hm = HM()
if wui.session_id is None:
hm.login(wui.d("login.server"),
wui.d("login.username"),
wui.d("login.password"))
hm.to_hiveaps_table(type='rogue')
wui.unregister_cleanup(hm.logout)
hm.mitigation(wui.d("ap.ssid"), wui.d("ap.mac"), wui.d("ap.reporting_hostname"))
开发者ID:gvsurenderreddy,项目名称:AerohiveAuto,代码行数:10,代码来源:mitigation.py
示例20: new_network_policy
def new_network_policy():
wui = WebUI()
cloud = CLOUD(wui.d("visit.url"), wui.d("visit.title"))
if wui.session_id:
cloud.to_url_home()
cloud.unit_click_configure()
cloud.unit_new_netpolicy()
cloud.unit_config_netpolicy(wui.d("policy.name"))
cloud.unit_new_ssid()
cloud.unit_config_basicssid(wui.d("ssid.name"), wui.d("ssid.security"), wui.d("ssid.key"))
#cloud.unit_select_all_ssid()
cloud.unit_select_ssid(wui.d("ssid.name"))
cloud.unit_click_devicetemplate()
cloud.unit_click_additional()
cloud.unit_uploadconfig(wui.d("device.mac"))
开发者ID:gvsurenderreddy,项目名称:AerohiveAuto,代码行数:15,代码来源:new_network_policy.py
注:本文中的webui.WebUI类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论