9. project — project.py

project.py

Functions for managing a project in pyFormex.

class project.Project(filename, create=False, signature='pyFormex', compression=0, binary=False, legacy=True)

A project is a persistent storage of a Python dictionary.

Create a new project with the given filename.

If the filename exists and create is False, the file is opened and the contents is read into the project dictionary. If not, a new empty file and project are created.

If legacy = True, the Project is allowed to read unsigned file formats. Writing is always done with signature though.

Project objects have the following methods:

header_data()
Construct the data to be saved in the header.
set_data_from_header(data)
Set the project data from the header.
save()
Save the project to file.
load()

Load a project from file.

The loaded definitions will update the current project.

delete()
Unrecoverably delete the project file.

Documentation

Previous topic

8. simple — Predefined geometries with a simple shape.

Next topic

10. utils — A collection of miscellaneous utility functions.

This Page