コード例 #1
0
ファイル: package.py プロジェクト: bbrument/core
    def __init__(self, name, metainfo, path=None):
        """
        Create a Package

        :param name: a unique string used as a unique identifier for the package
        :param path: path where the package lies (a directory or a full wralea path)
        :param metainfo: a dictionnary for metainformation.

        Attended keys for the metainfo parameters are:
            - license: a string ex GPL, LGPL, Cecill, Cecill-C
            - version: a string
            - authors: a string
            - institutes: a string
            - url: a string
            - description: a string for the package description
            - publication: optional string for publications

        """

        PackageDict.__init__(self)

        self.name = name
        self.metainfo = metainfo

        # package directory

        if (not path):
            # package directory
            import inspect
            # get the path of the file which call this function
            call_path = os.path.abspath(inspect.stack()[1][1])
            self.path = os.path.dirname(call_path)
            self.wralea_path = call_path

        # wralea.py path is specified
        else:
            if (not os.path.exists(path)):
                os.mkdir(path)
            if (not os.path.isdir(path)):
                self.path = os.path.dirname(path)
                self.wralea_path = path

            else:
                self.path = path
                self.wralea_path = os.path.join(self.path, "__wralea__.py")
コード例 #2
0
ファイル: package.py プロジェクト: VirtualPlants/openalea
    def __init__(self, name, metainfo, path=None):
        """
        Create a Package

        :param name: a unique string used as a unique identifier for the package
        :param path: path where the package lies (a directory or a full wralea path)
        :param metainfo: a dictionnary for metainformation.

        Attended keys for the metainfo parameters are:
            - license: a string ex GPL, LGPL, Cecill, Cecill-C
            - version: a string
            - authors: a string
            - institutes: a string
            - url: a string
            - description: a string for the package description
            - publication: optional string for publications

        """

        PackageDict.__init__(self)

        self.name = name
        self.metainfo = metainfo

        # package directory

        if (not path):
            # package directory
            import inspect
            # get the path of the file which call this function
            call_path = os.path.abspath(inspect.stack()[1][1])
            self.path = os.path.dirname(call_path)
            self.wralea_path = call_path

        # wralea.py path is specified
        else:
            if (not os.path.exists(path)):
                os.mkdir(path)
            if (not os.path.isdir(path)):
                self.path = os.path.dirname(path)
                self.wralea_path = path

            else:
                self.path = path
                self.wralea_path = os.path.join(self.path, "__wralea__.py")
コード例 #3
0
ファイル: package.py プロジェクト: bbrument/core
 def __init__(self, name, metainfo):
     self.metainfo = metainfo
     self.name = name
     PackageDict.__init__(self)
コード例 #4
0
    def __init__(self, name):
        """ Name is the pseudo package name """

        PackageDict.__init__(self)
        self.name = name
        self.item = None
コード例 #5
0
ファイル: package.py プロジェクト: VirtualPlants/openalea
 def __init__(self, name, metainfo):
     self.metainfo = metainfo
     self.name = name
     PackageDict.__init__(self)