Project.
Project
This class represents an InstantTerra project.
>>> from wysilab import InstantTerra
>>> it = InstantTerra()
>>> project = it.project # Get the current project
Project.
new
() Create a new project.
Warning
If the current project has not been saved, it will be lost!
>>> project.is_available()
False
>>> project.new()
>>> project.is_available()
True
Project.
save
(filename) filename (str) - Path of the project to save.
Exception - Raise an exception if there is no project to save.
Exception - Raise an exception if it is impossible to save the project.
Save the current project with the specified filename.
>>> project.save("my_project.terrain")
Project.
open
(filename) filename (str) - Path of the project to save.
FileNotFoundError - Raise an exception if the file was not found.
FileExistsError - Raise an exception if the file is not a valid InstantTerra project.
Open a project with the specified filename.
Warning
If the current project has not been saved, it will be lost!
>>> project.is_available()
False
>>> project.open("my_project.terrain")
>>> project.is_available()
True
Project.
close
() Close the current project.
Warning
If the current project has not been saved, it will be lost!
>>> project.is_available()
True
>>> project.close()
>>> project.is_available()
False
Project.
is_available
() True if the project exists, otherwise False.
bool
Returns the status of the current project.
>>> project.is_available()
True
Project.
export_all
() IOError - Raise an exception if exports cannot be done.
Export all nodes of the project.
>>> project.export_all()
Project.
export_node
(node)
IOError - Raise an exception if export cannot be done.
Export one node. The node must be an export node.
>>> project.export_node(node_to_export)
Copyright © 2022 · All Rights Reserved · Wysilab