Exemple #1
0
def __getPluginPath__(plugin):
    """ Get path to classes in plugin (if running under Eclipse)
        @param plugin Plugin ID
        @return Path to the classes in the plugin, or None
    """
    try:
        # Under Eclipse, should be able to locate the bundle
        from org.eclipse.core.runtime import Platform
        from org.eclipse.core.runtime import FileLocator
        from org.eclipse.core.runtime import Path
        bundle = Platform.getBundle(plugin)
        # While in the IDE, the classes are in a bin subdir
        url = FileLocator.find(bundle, Path("bin"), None)
        if url:
            return FileLocator.resolve(url).getPath()
        # In an exported product, the classes are
        # at the root of the jar or the expanded
        # plugin directory
        return FileLocator.getBundleFile(bundle).getPath()
    except:
        # Not running under Eclipse
        return None
def __getPluginPath__(plugin):
    """ Get path to classes in plugin (if running under Eclipse)
        @param plugin Plugin ID
        @return Path to the classes in the plugin, or None
    """
    try:
        # Under Eclipse, should be able to locate the bundle
        from org.eclipse.core.runtime import Platform
        from org.eclipse.core.runtime import FileLocator
        from org.eclipse.core.runtime import Path
        bundle = Platform.getBundle(plugin)
        # While in the IDE, the classes are in a bin subdir
        url = FileLocator.find(bundle, Path("bin"), None)
        if url:
            return FileLocator.resolve(url).getPath()
        # In an exported product, the classes are
        # at the root of the jar or the expanded
        # plugin directory
        return FileLocator.getBundleFile(bundle).getPath()
    except:
        # Not running under Eclipse
        return None
Exemple #3
0
 except:
     # Need to locate NDArray binaries
     try:
         # When running under Eclipse, locate org.epics.util and NDArray bundle
         from org.eclipse.core.runtime import Platform
         from org.eclipse.core.runtime import FileLocator
         from org.eclipse.core.runtime import Path
         
         bundle = Platform.getBundle("org.epics.util")
         url = FileLocator.find(bundle, Path("bin"), None)
         if url:
             # While in the IDE, the plugin classes are in a bin subdir
             sys.path.append(FileLocator.resolve(url).getPath())
         else:
             # In an exported product, the classes are at the root
             sys.path.append(FileLocator.getBundleFile(bundle).getPath())
         
         bundle = Platform.getBundle("org.csstudio.ndarray")
         url = FileLocator.find(bundle, Path("bin"), None)
         if url:
             sys.path.append(FileLocator.resolve(url).getPath())
         else:
             sys.path.append(FileLocator.getBundleFile(bundle).getPath())
     except:
         # Not running under Eclipse
         # When executing tests from IDE/repository,
         # use binaries compiled by IDE
         if os.path.exists("../../org.csstudio.ndarray/bin"):
             sys.path.append("../../../../core/plugins/org.epics.util/bin")
             sys.path.append("../../org.csstudio.ndarray/bin")
         else:
Exemple #4
0
except:
    # Need to locate NDArray binaries
    try:
        # When running under Eclipse, locate org.epics.util and NDArray bundle
        from org.eclipse.core.runtime import Platform
        from org.eclipse.core.runtime import FileLocator
        from org.eclipse.core.runtime import Path
        
        bundle = Platform.getBundle("org.epics.util")
        url = FileLocator.find(bundle, Path("bin"), None)
        if url:
            # While in the IDE, the plugin classes are in a bin subdir
            sys.path.append(FileLocator.resolve(url).getPath())
        else:
            # In an exported product, the classes are at the root
            sys.path.append(FileLocator.getBundleFile(bundle).getPath())
        
        bundle = Platform.getBundle("org.csstudio.ndarray")
        url = FileLocator.find(bundle, Path("bin"), None)
        if url:
            sys.path.append(FileLocator.resolve(url).getPath())
        else:
            sys.path.append(FileLocator.getBundleFile(bundle).getPath())
    except:
        # Not running under Eclipse
        # When executing tests from IDE/repository,
        # use binaries compiled by IDE
        if os.path.exists("../../org.csstudio.ndarray/bin"):
            sys.path.append("../../../../core/plugins/org.epics.util/bin")
            sys.path.append("../../org.csstudio.ndarray/bin")
        else: