Package Modeling :: Package ModelMasons :: Module PyModelMason
[show private | hide private]
[frames | no frames]

Module Modeling.ModelMasons.PyModelMason

PyModelMason generates the python package, modules and classes described in a model, ready to be used w/ the modeling framework.

Its templates are located in sub-package 'Python_bricks'. The generated code is compatible with python v2.1 and v2.2.

Given a model, it can generate the appropriate python code in two different ways: the flat, or 'compact' scheme, and the 'base' scheme.

The former one generates all files within a single directory (namely: in package model.packageName()), none of which (except the models) can be overwritten when the code is regenerated.

The so-called 'base' scheme adds a subpackage 'MDL' within the generated package. All files within MDL/ are ALWAYS overwritten when the python code is regenerated, while others (in the root package) are never overwritten if they exist. This is probably the one you want to use if your model changes often.

CVS information

$Id: PyModelMason.py 974 2006-02-26 14:06:07Z sbigaret $

Classes
PyModelMason See the module's documentation for details

Exceptions
InvalidModelError Raised by checkModelIsValid()

Function Summary
  checkModelIsValid(model, generation_scheme)
Checks that the supplied model is valid for a given python-code generation scheme:

Function Details

checkModelIsValid(model, generation_scheme)

Checks that the supplied model is valid for a given python-code generation scheme:

  • if 'generation_scheme' is 'compact', all models are valid,
  • if 'generation_scheme' is 'base', the model is valid iff a class/entity does not share the same module than any of its subclasses

Parameters:

model -- a instance of Modeling.Model.Model

generation_scheme -- either 'compact' or 'base'

Returns: None

Raises InvalidModelError if the model is invalid.

Note: this is NOT validation of the model itself (responsability of
Modeling.ModelValidation)

Generated by Epydoc 2.1 on Sat Mar 4 13:36:27 2006 http://epydoc.sf.net