示例#1
0
    def __init__(self, jar_file, manifest):
        """
        Sets up the bundle details

        :param jar_file: Path to the JAR file (can be empty, but shouldn't)
        :param manifest: The parsed Manifest of the JAR file (mandatory)
        :raise ValueError: Invalid manifest argument
        """
        # Validate parameters
        if not manifest:
            raise ValueError("Manifest can't be None")

        # Extract information from the manifest
        self._manifest = manifest
        name = self._manifest.get('Bundle-SymbolicName', '').split(';', 2)[0]
        version = Version(self._manifest.get('Bundle-Version'))

        # Configure the Artifact
        Artifact.__init__(self, "java", name, version, jar_file)

        # Store Package information
        self.all_exports = \
            self._manifest.extract_packages_list('Export-Package')
        self.all_imports = \
            self._manifest.extract_packages_list('Import-Package')
        self.all_require = \
            self._manifest.extract_packages_list('Require-Bundle')
示例#2
0
    def __init__(self, jar_file, manifest):
        """
        Sets up the bundle details

        :param jar_file: Path to the JAR file (can be empty, but shouldn't)
        :param manifest: The parsed Manifest of the JAR file (mandatory)
        :raise ValueError: Invalid manifest argument
        """
        # Validate parameters
        if not manifest:
            raise ValueError("Manifest can't be None")

        # Extract information from the manifest
        self._manifest = manifest
        name = self._manifest.get('Bundle-SymbolicName', '').split(';', 2)[0]
        version = Version(self._manifest.get('Bundle-Version'))

        # Configure the Artifact
        Artifact.__init__(self, "java", name, version, jar_file)

        # Store Package information
        self.all_exports = \
            self._manifest.extract_packages_list('Export-Package')
        self.all_imports = \
            self._manifest.extract_packages_list('Import-Package')
        self.all_require = \
            self._manifest.extract_packages_list('Require-Bundle')
示例#3
0
    def __init__(self, name, version, imports, filename):
        """
        Sets up the bundle details

        :param name: Name of the module
        :param version: Version of the module (as a string)
        :param imports: List of names of imported modules
        :param filename: Path to the .py file
        :raise ValueError: Invalid argument
        """
        Artifact.__init__(self, "python", name, version, filename)

        # Store information
        self.all_imports = imports
示例#4
0
    def __init__(self, name, version, imports, filename):
        """
        Sets up the bundle details

        :param name: Name of the module
        :param version: Version of the module (as a string)
        :param imports: List of names of imported modules
        :param filename: Path to the .py file
        :raise ValueError: Invalid argument
        """
        Artifact.__init__(self, "python", name, version, filename)

        # Store information
        self.all_imports = imports