本文整理汇总了Python中mforms.Utilities.open_url方法的典型用法代码示例。如果您正苦于以下问题:Python Utilities.open_url方法的具体用法?Python Utilities.open_url怎么用?Python Utilities.open_url使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mforms.Utilities
的用法示例。
在下文中一共展示了Utilities.open_url方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: openDocLib
# 需要导入模块: from mforms import Utilities [as 别名]
# 或者: from mforms.Utilities import open_url [as 别名]
def openDocLib():
global docLibTab
global server_port
if docLibTab:
if docLibTab is True: # this will be True if an external browser is used
Utilities.open_url("http://localhost:%i"%server_port)
return 1
App.get().select_view("wb.doclib")
return 1
app = App.get()
try:
import mysqldoclib
except ImportError:
Utilities.show_error("Cannot Open Documentation Library",
'''pysqlite2 is not installed, please install python-sqlite2 or pysqlite2 to be able to use this feature.
Try running "easy_install pysqlite" with superuser privileges in the command line shell or, if using
Ubuntu, enable the Universe repository and install the python-pysqlite2 package from there.''',
"OK", "", "")
return 0
if server_port is None:
ready_event = Event()
#datadir = "./modules/data/DocLibrary/"
datadir = os.path.join(app.get_resource_path(""), "modules/data/DocLibrary")
thread.start_new_thread(run_server, (datadir, ready_event))
# wait up to 1s for the doclib server to start
ready_event.wait(1)
if platform.system() == "Linux":
docLibTab = True
Utilities.open_url("http://localhost:%i"%server_port)
return 1
docLibTab = DocLibTab(server_port)
docLibTab.set_identifier("wb.doclib")
app.dock_view(docLibTab, "maintab")
app.set_view_title(docLibTab, "Doc Library (loading)")
app.set_status_text("Opening Doc Library...")
return 1
示例2: openDocLib
# 需要导入模块: from mforms import Utilities [as 别名]
# 或者: from mforms.Utilities import open_url [as 别名]
def openDocLib():
Utilities.open_url("http://dev.mysql.com/doc/refman/5.7/en/index.html")
return 1