当前位置: 首页>>代码示例>>Python>>正文


Python Utilities.open_url方法代码示例

本文整理汇总了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
开发者ID:aoyanglee,项目名称:Travel-Inc,代码行数:48,代码来源:wb_doclib_grt.py

示例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
开发者ID:Roguelazer,项目名称:mysql-workbench,代码行数:5,代码来源:wb_docs_grt.py


注:本文中的mforms.Utilities.open_url方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。