Ejemplo n.º 1
0
            xbmcgui.Dialog().ok(
                addon_name,
                "Reset the VPN provider. Validate a connection to start using a VPN again.\n"
            )

    # Generate the VPN provider files
    if action == "generate":
        # Only used during development to create location files
        generateAll()
        xbmcgui.Dialog().ok(
            addon_name, "Regenerated some or all of the VPN location files.\n")

    # Delete all of the downloaded VPN files
    if action == "downloads":
        debugTrace("Deleting all downloaded VPN files")
        removeDownloadedFiles()
        xbmcgui.Dialog().ok(
            addon_name,
            "Deleted all of the downloaded VPN files. They'll be downloaded again if required.\n"
        )

    # Copy the log file
    elif action == "log":
        log_path = ""
        dest_path = ""
        try:
            log_path = getLogPath()
            start_dir = ""
            dest_folder = xbmcgui.Dialog().browse(
                0, "Select folder to copy log file into", "files", "", False,
                False, start_dir, False)
Ejemplo n.º 2
0
                xbmcgui.Dialog().ok(addon_name, "Reset the VPN provider. Validate a connection to start using a VPN again.")
        else:
            xbmcgui.Dialog().ok(addon_name, "Connection to VPN being attempted and has been aborted.  Try again in a few seconds.")
            setAPICommand("Disconnect")
            
    # Generate the VPN provider files
    if action == "generate":
        # Only used during development to create location files
        generateAll()
        xbmcgui.Dialog().ok(addon_name, "Regenerated some or all of the VPN location files.")        
           

    # Delete all of the downloaded VPN files
    if action == "downloads":
        debugTrace("Deleting all downloaded VPN files")
        removeDownloadedFiles()
        xbmcgui.Dialog().ok(addon_name, "Deleted all of the downloaded VPN files. They'll be downloaded again if required.")

            
    # Copy the log file        
    elif action == "log":
        log_path = ""
        dest_path = ""
        try:
            log_path = getLogPath()
            start_dir = ""
            dest_folder = xbmcgui.Dialog().browse(0, "Select folder to copy log file into", "files", "", False, False, start_dir, False)
            dest_path = "kodi " + datetime.datetime.now().strftime("%y-%m-%d %H-%M-%S") + ".log"
            dest_path = dest_folder + dest_path.replace(" ", "_")
            # Write VPN log to log before copying
            writeVPNLog()