The Project is a structure which permits to manage different objects.

It stores metadata (alias, author, description, version, license, ...) and data (src, models, images, ...).

You have here the default architecture of the project saved in directory "project".

/project

oaproject.cfg (Configuration file) /model (Files sources, Script Python, LPy...) /control (Control, like color map or curve) /world (scene, scene 3D) /cache (Intermediary saved objects) /data (Data files like images, .dat, ...) /lib (Contains python modules and packages) /startup (Preprocessing scripts)

.py (Preprocessing scripts) *import.py (Libs and packages to import in preprocessing)
use:
project = Project(path="/path/to/proj/project")
project.add(category="model", filename="hello.py", content="print 'Hello World'")
project.author = "John Doe"
project.description = "This project is used to said hello to everyone"
project.save()
exception core.project.project.ErrorItemExistsInProject(*args, **kargs)[source]

Bases: openalea.core.customexception.CustomException

desc = u'As item is in project yet, you cannot add it again. Use replacement instead'
message = u'Item %(name)s is in project yet'
title = u'Error: item exists in project yet.'
class core.project.project.Project(path, **kwargs)[source]

Bases: openalea.grapheditor.observer.Observed

add(category, obj=None, **kwargs)[source]
add_item(category, obj=None, **kwargs)[source]
delete()[source]
get(category, name, **kwargs)[source]
get_item(category, filename)[source]
get_model(filename)[source]
get_runnable_model(name)[source]
items(category, **kwds)[source]
move(dest)[source]
remove(category, obj=None, **kwargs)[source]
remove_item(category, obj=None, **kwargs)[source]
rename(new)[source]
rename_item(category, old, new)[source]
run(filename, *args, **kwargs)[source]
run_model(model, *args, **kwargs)[source]
save()[source]

Save a manifest file on disk. It name is defined by config_filename.

It contains list of files that are inside project (manifest) and metadata (author, version, ...).

save_metadata()[source]
start(*args, **kwargs)[source]

Load controls if available, execute all files in startup.

stop(*args, **kwargs)[source]
valid_item_name(category, name)[source]
DEFAULT_CATEGORIES = OrderedDict([('cache', {'title': 'Temporary Data'}), ('data', {'title': 'Data'}), ('model', {'title': 'Model'}), ('world', {'title': 'World'}), ('startup', {'title': 'Startup'}), ('doc', {'title': 'Documentation'}), ('lib', {'title': 'Libraries'})])
DEFAULT_METADATA = OrderedDict([('alias', Control('alias', IStr(), value='MyProject')), ('icon', Control('icon', IFileStr(filter="All (*)", save=False), value='')), ('authors', Control('author', ISequence(), value=[])), ('description', Control('description', IStr(), value='')), ('long_description', Control('long_description', IStr(), value='')), ('citation', Control('citation', IStr(), value='')), ('url', Control('url', IStr(), value='')), ('dependencies', Control('dependencies', ISequence(), value=[])), ('license', Control('license', IStr(), value='')), ('version', Control('version', IStr(), value='0.1'))])
MODE_COPY = 'copy'
config_filename = 'oaproject.cfg'
icon_path[source]
Returns:the complete path of the icon. To modify it, you have to modify the path of project, the name of project and/or the self.icon.
name[source]
path[source]
projectdir[source]

Previous topic

<no title>

Next topic

<no title>

This Page