Beispiel #1
0
def build(c):
    outDir = findMatchingOutDir(__file__)
    outDir.mkdir(parents=True)
    outPluginDir = outDir / "globalPlugins"

    nvdaPluginDir = findMatchingPkgDir(__file__)  # packages/plugins/nvda
    pkgDir = nvdaPluginDir.parents[1]

    __copySourceFiles(outPluginDir, nvdaPluginDir / "src")

    __updatePythonImportsForNVDA(outPluginDir)

    pathToCopiedDependencyAdapter = __copyDependencyAdapter(
        outPluginDir,
        Path(__file__).parent / "dependencyAdapter.py")

    __copyDependenciesFromVirtualEnv(pkgDir, outPluginDir,
                                     pathToCopiedDependencyAdapter)

    readMeOutFilename = __convertReadMeToHtml(outDir,
                                              nvdaPluginDir / "readme.md")

    __updateManifestPlaceholders(
        outDir,
        nvdaPluginDir / "manifest.ini",
        readMeOutFilename,
        constantsExtractor.getVersionNumber(),
    )
Beispiel #2
0
def build(c):
    outDir = findMatchingOutDir(__file__)  # out/nativeApp
    nativeAppPkgDir = findMatchingPkgDir(__file__)  # packages/nativeApp
    pkgDir = nativeAppPkgDir.parents[0]

    __copySrcToOut(outDir, pkgDir)

    pathToExe = __createExeFromCopiedSrc(
        outDir, pkgDir, PATH_TO_ENTRY_POINT_FROM_PACKAGE_ROOT)

    nameForManifest, pathToHydratedManifest = __hydrateManifest(
        outDir, nativeAppPkgDir, pathToExe)

    __createRefToManifest(nameForManifest, pathToHydratedManifest)
Beispiel #3
0
def copy(c):
    nvdaConfigPathAsStr = os.environ["NVDA_CONFIG_PATH"]
    nvdaConfigPath = Path(nvdaConfigPathAsStr)

    addOnsDir = nvdaConfigPath / "addons"
    if not addOnsDir.is_dir():
        return

    outDir = findMatchingOutDir(__file__)

    manifestDict, _ = __readManifestDictFromFile(outDir / "manifest.ini")
    pluginName = manifestDict["name"]

    thisPluginsDir = addOnsDir / pluginName
    if thisPluginsDir.is_dir():
        shutil.rmtree(thisPluginsDir)

    shutil.copytree(outDir, thisPluginsDir)
Beispiel #4
0
def start(c):
    outDir = findMatchingOutDir(__file__)

    pathToExe = __getPathToExe(outDir, PATH_TO_ENTRY_POINT_FROM_PACKAGE_ROOT)

    subprocess.call(str(pathToExe.resolve()))
Beispiel #5
0
def clean(c):
    outDir = findMatchingOutDir(__file__)
    if outDir.is_dir():
        shutil.rmtree(outDir)