本文整理汇总了Python中utilities.openInBrowserTab函数的典型用法代码示例。如果您正苦于以下问题:Python openInBrowserTab函数的具体用法?Python openInBrowserTab怎么用?Python openInBrowserTab使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了openInBrowserTab函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: run_suite
def run_suite(module, tests):
"""This allows for a list of test names to be selectively run.
Also, ensures unittest verbose output comes at end, after debug output"""
loader = unittest.defaultTestLoader
if 'QGIS_TEST_SUITE' in os.environ and tests:
suite = loader.loadTestsFromNames(tests, module)
else:
suite = loader.loadTestsFromModule(module)
verb = 2 if 'QGIS_TEST_VERBOSE' in os.environ else 0
res = unittest.TextTestRunner(verbosity=verb).run(suite)
if QGIS_TEST_REPORT and len(TESTREPORTS) > 0:
teststamp = 'Local Server Test Report: ' + \
datetime.datetime.now().strftime('%Y-%m-%d %X')
report = '<html><head><title>{0}</title></head><body>'.format(teststamp)
report += '\n<h2>Failed Image Tests: {0}</h2>'.format(len(TESTREPORTS))
for k, v in list(TESTREPORTS.items()):
report += '\n<h3>{0}</h3>\n{1}'.format(k, v)
report += '</body></html>'
tmp_name = getTempfilePath("html")
with open(tmp_name, 'wb') as temp_file:
temp_file.write(report)
openInBrowserTab('file://' + tmp_name)
return res
开发者ID:liminlu0314,项目名称:QGIS,代码行数:27,代码来源:test_qgis_local_server.py
示例2: runSuite
def runSuite(module, tests):
"""This allows for a list of test names to be selectively run.
Also, ensures unittest verbose output comes at end, after debug output"""
loader = unittest.defaultTestLoader
if 'PAL_SUITE' in os.environ:
if tests:
suite = loader.loadTestsFromNames(tests, module)
else:
raise Exception(
"\n\n####__ 'PAL_SUITE' set, but no tests specified __####\n")
else:
suite = loader.loadTestsFromModule(module)
verb = 2 if 'PAL_VERBOSE' in os.environ else 0
res = unittest.TextTestRunner(verbosity=verb).run(suite)
if PALREPORTS:
teststamp = 'PAL Test Report: ' + \
datetime.datetime.now().strftime('%Y-%m-%d %X')
report = '<html><head><title>{0}</title></head><body>'.format(teststamp)
report += '\n<h2>Failed Tests: {0}</h2>'.format(len(PALREPORTS))
for k, v in list(PALREPORTS.items()):
report += '\n<h3>{0}</h3>\n{1}'.format(k, v)
report += '</body></html>'
tmp_name = getTempfilePath('html')
with open(tmp_name, 'wt') as report_file:
report_file.write(report)
openInBrowserTab('file://' + tmp_name)
return res
开发者ID:GrokImageCompression,项目名称:QGIS,代码行数:31,代码来源:test_qgspallabeling_base.py
示例3: get_capabilities
def get_capabilities(self, params, browser=False):
assert self.processes_running(), "Server processes not running"
params = self._params_to_upper(params)
if ("REQUEST" in params and params["REQUEST"] != "GetCapabilities") or "REQUEST" not in params:
params["REQUEST"] = "GetCapabilities"
url = self._fcgi_url + "?" + self.process_params(params)
res = urllib.urlopen(url)
xml = res.read()
if browser:
tmp = tempfile.NamedTemporaryFile(suffix=".html", delete=False)
tmp.write(xml)
url = tmp.name
tmp.close()
openInBrowserTab(url)
return False, ""
success = "perhaps you left off the .qgs extension" in xml or "WMS_Capabilities" in xml
return success, xml
开发者ID:ncrimier,项目名称:QGIS,代码行数:21,代码来源:qgis_local_server.py
示例4: ServerProcessError
if not os.path.exists(proj):
msg = "{0}".format(proj)
w_proj = os.path.join(self._web_dir, proj)
if os.path.exists(w_proj):
params["MAP"] = w_proj
else:
msg += "\n or\n" + w_proj
raise ServerProcessError("GetMap Request Error", "Project not found at:\n{0}".format(msg))
if ("REQUEST" in params and params["REQUEST"] != "GetMap") or "REQUEST" not in params:
params["REQUEST"] = "GetMap"
url = self._fcgi_url + "?" + self.process_params(params)
if browser:
openInBrowserTab(url)
return False, ""
# try until qgis_mapserv.fcgi process is available (for 20 seconds)
# on some platforms the fcgi_server_process is a daemon handling the
# launch of the fcgi-spawner, which may be running quickly, but the
# qgis_mapserv.fcgi spawned process is not yet accepting connections
resp = None
tmp_png = None
# noinspection PyUnusedLocal
filepath = ""
# noinspection PyUnusedLocal
success = False
start_time = time.time()
while time.time() - start_time < 20:
resp = None
开发者ID:ncrimier,项目名称:QGIS,代码行数:31,代码来源:qgis_local_server.py
注:本文中的utilities.openInBrowserTab函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论