コード例 #1
0
ファイル: wb_doclib_grt.py プロジェクト: aoyanglee/Travel-Inc
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
0
ファイル: wb_doclib_grt.py プロジェクト: Arrjaan/Cliff
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.",
            "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
コード例 #3
0
def openDocLib():
    global docLibTab
    global server_port

    app = App.get()

    # if docs datafiles are not installed, just open the docs home page
    datafile = os.path.join(app.get_resource_path(""),
                            "modules/data/DocLibrary/mysqldoclib.sqlite")
    if not os.path.exists(datafile):
        Utilities.open_url("http://dev.mysql.com/doc/")
        return 1

    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.select_view(docLibTab)
        return 1

    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
コード例 #4
0
def openDocLib():
    Utilities.open_url("http://dev.mysql.com/doc/refman/5.7/en/index.html")
    return 1
コード例 #5
0
def openDocLib():
    Utilities.open_url("http://dev.mysql.com/doc/refman/5.7/en/index.html")
    return 1