Commit 62beb57f authored by yoogx's avatar yoogx

* Package Ocarina Python API

parent 28f3a440
......@@ -406,8 +406,9 @@ AC_OUTPUT([
resources/Makefile
resources/behavioural_properties/Makefile
resources/runtime/Makefile
resources/runtime/cheddar/Makefile
resources/runtime/aadl_xml/Makefile
resources/runtime/cheddar/Makefile
resources/runtime/python/Makefile
projects/ocarina.gpr
src/main/Makefile
src/config/ocarina-configuration.adb
......
SUBDIRS = cheddar aadl_xml
SUBDIRS = cheddar aadl_xml python
@DEBUG_FALSE@DEBUG_FLAG = --disable-debug
@DEBUG_TRUE@DEBUG_FLAG = --enable-debug
......
AUTOMAKE_OPTIONS = no-dependencies
PYTHON_FILES = $(srcdir)/ocarina.py
EXTRA_DIST = $(PYTHON_FILES)
ocarina_python = ${shell $(CYGPATH_U) '$(includedir)/ocarina/runtime/python'}
install-data-local:
$(INSTALL) -d $(DESTDIR)$(ocarina_python)
for f in $(PYTHON_FILES); do $(INSTALL) -m 444 $$f $(DESTDIR)$(ocarina_python) ; done
#! /usr/bin/python
'''Python binding to the Ocarina AADL processor'''
################################################################################
import libocarina_python; # Ocarina bindings
################################################################################
def version ():
'''Print Ocarina version'''
libocarina_python.version();
################################################################################
def status ():
'''Print Ocarina status'''
libocarina_python.status();
################################################################################
def load (filename):
'''Load a file'''
libocarina_python.load (filename);
################################################################################
def analyze ():
'''Analyze models'''
libocarina_python.analyze ();
################################################################################
def instantiate (root_system):
'''Instantiate models'''
libocarina_python.instantiate (root_system);
################################################################################
def generate (generator):
'''Generate code'''
libocarina_python.generate (generator);
################################################################################
def main ():
'''Test function'''
load("rma.aadl"); # load a file
load("deployment.aadl"); # load a file
analyze(); # analyze models
instantiate("rma.erc32"); # instantiate
generate("polyorb_hi_ada"); # generate code
if __name__ == "__main__":
main ()
sys.exit (0); # exit
################################################################################
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment