示例#1
0
    def default(self):
        """
        :return: a default empty project
        """
        _path = self.defaultdir
        proj = Project(_path / "temp")
        if not proj.path.exists():
            txt = '''"""
OpenAlea Lab editor
This temporary script is saved in temporary project in
%s

You can rename/move this project thanks to the button "Save As" in menu.
"""''' % str(proj.path)
            proj.add("model", filename="model.py", content=txt)
            proj.save()

        return proj
示例#2
0
    def default(self):
        """
        :return: a default empty project
        """
        # TODO: should define a generic "create" method that returns a patched item.
        # for the moment, patch it manually
        _path = self.defaultdir
        proj = Project(_path / "temp")
        proj.label = "Temporary Project"
        if not proj.path.exists():
            txt = '''"""
OpenAlea Lab editor
This temporary script is saved in temporary project in
%s

You can rename/move this project thanks to the button "Save As" in menu.
"""''' % str(proj.path)
            proj.add("model", filename="model.py", content=txt)
            proj.save()

        return proj