aeonic-svn Mailing List for Aeonic - Model Driven Server Apps
Status: Alpha
Brought to you by:
ahatzis
You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(109) |
Sep
(6) |
Oct
(44) |
Nov
(98) |
Dec
(57) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(19) |
Feb
(53) |
Mar
(36) |
Apr
(45) |
May
(21) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(4) |
Jun
(9) |
Jul
(17) |
Aug
(3) |
Sep
(7) |
Oct
(7) |
Nov
(14) |
Dec
(5) |
2009 |
Jan
(11) |
Feb
|
Mar
(2) |
Apr
(8) |
May
(3) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
2010 |
Jan
(1) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
(17) |
Nov
(13) |
Dec
(63) |
2011 |
Jan
(58) |
Feb
(32) |
Mar
(47) |
Apr
(21) |
May
(83) |
Jun
(12) |
Jul
(16) |
Aug
|
Sep
(82) |
Oct
(21) |
Nov
(71) |
Dec
(61) |
2012 |
Jan
(11) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <ah...@us...> - 2012-01-19 14:17:05
|
Revision: 1284 http://aeonic.svn.sourceforge.net/aeonic/?rev=1284&view=rev Author: ahatzis Date: 2012-01-19 14:16:54 +0000 (Thu, 19 Jan 2012) Log Message: ----------- added `xmeID` attribute to `M2::Classes::Kernel::Element` Modified Paths: -------------- branches/77/src/AeonicXME/specs/xme_m2.cmof Added Paths: ----------- branches/77/src/AeonicXME/specs/m2/ branches/77/src/AeonicXME/specs/m2/m2patch.cmof Added: branches/77/src/AeonicXME/specs/m2/m2patch.cmof =================================================================== --- branches/77/src/AeonicXME/specs/m2/m2patch.cmof (rev 0) +++ branches/77/src/AeonicXME/specs/m2/m2patch.cmof 2012-01-19 14:16:54 UTC (rev 1284) @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<xmi:XMI xmi:version="2.1" xmlns:xmi="http://schema.omg.org/spec/XMI/2.1" xmlns:cmof="http://schema.omg.org/spec/MOF/2.0/cmof.xml"> + + <cmof:Package xmi:version="2.1" xmlns:xmi="http://schema.omg.org/spec/XMI/2.1" xmlns:cmof="http://schema.omg.org/spec/MOF/2.0/cmof.xml" xmlns:xme="http://schema.aeonic.net/spec/XME/1.0/xme.xml" xmi:id="__M2_Patch" name="M2_Patch"> + + <difference xmi:type="xmi:Add" xmi:id="XME-M2_patch-Constructs-Element-xmeID"> + <target href="Classes-Kernel-Element" /> + <addition href="Classes-Kernel-Element-xmeID" /> + <ownedAttribute xmi:type="cmof:Property" xmi:id="Classes-Kernel-Element-xmeID" name="xmeID" type="Core-PrimitiveTypes-String" lower="0"> + <ownedComment xmi:type="cmof:Comment" xmi:id="Classes-Kernel-Element-xmeID-_ownedComment.0" annotatedElement="Classes-Kernel-Element-xmeID"> + <body>XME:ID of this element.</body> + </ownedComment> + </ownedAttribute> + </difference> + + </cmof:Package> +</xmi:XMI> \ No newline at end of file Modified: branches/77/src/AeonicXME/specs/xme_m2.cmof =================================================================== --- branches/77/src/AeonicXME/specs/xme_m2.cmof 2012-01-19 14:05:41 UTC (rev 1283) +++ branches/77/src/AeonicXME/specs/xme_m2.cmof 2012-01-19 14:16:54 UTC (rev 1284) @@ -4,7 +4,7 @@ <include href="http://www.omg.org/spec/UML/20090901/Superstructure.cmof#_0"/> <!-- <include href="file:///home/anh/workspace/xis-0.1/models/OMG/UML 2.3/Superstructure.cmof#_0"/> --> - <!-- <include href="m2/m2patch.cmof#__M2_Patch"/> --> + <include href="m2/m2patch.cmof#__M2_Patch"/> </cmof:Package> </xmi:XMI> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ah...@us...> - 2012-01-19 14:05:53
|
Revision: 1283 http://aeonic.svn.sourceforge.net/aeonic/?rev=1283&view=rev Author: ahatzis Date: 2012-01-19 14:05:41 +0000 (Thu, 19 Jan 2012) Log Message: ----------- language of supported opaque expressions changed from `"Python 3.2"` to `"Python3.2"` in all layers Modified Paths: -------------- branches/77/src/AeonicXME/constructions.py branches/77/src/AeonicXME/specs/m3/code/Operation/_construct.py branches/77/src/AeonicXME/specs/m3/m3patch.cmof branches/77/src/AeonicXME/testdata/testM3_generateM2_small.cmof branches/77/src/AeonicXME/testdata/testM3_reportM2.cmof branches/77/src/AeonicXME/testdata/testM4_M3properties.cmof branches/77/src/AeonicXME/testdata/testM4_constructM3.cmof branches/77/src/AeonicXME/testdata/testM4_patchM3.cmof branches/77/src/AeonicXME/testdata/testM4_reportM3.cmof branches/77/src/AeonicXME/tests/testM4_constructM3.py Modified: branches/77/src/AeonicXME/constructions.py =================================================================== --- branches/77/src/AeonicXME/constructions.py 2012-01-19 12:49:43 UTC (rev 1282) +++ branches/77/src/AeonicXME/constructions.py 2012-01-19 14:05:41 UTC (rev 1283) @@ -1932,10 +1932,10 @@ def is_python(self, rev=None, layer=None): """Returns True if the specification is defined in a language starting - with 'Python 3.' + with 'Python3.' """ - return self.ownedAttribute["language"][0].startswith('Python 3.') + return self.ownedAttribute["language"][0].startswith('Python3.') def construct(self, rev=None, layer=None, conditionType='body'): """Returns a compiled Python code representing the method body.""" Modified: branches/77/src/AeonicXME/specs/m3/code/Operation/_construct.py =================================================================== --- branches/77/src/AeonicXME/specs/m3/code/Operation/_construct.py 2012-01-19 12:49:43 UTC (rev 1282) +++ branches/77/src/AeonicXME/specs/m3/code/Operation/_construct.py 2012-01-19 14:05:41 UTC (rev 1283) @@ -56,7 +56,7 @@ # for spec in child.childElement["specification"]: # if spec.get_attribute("xmi:type") in ["cmof:OpaqueExpression"]: # for lang in spec.childElement["language"]: -# if lang.text.startswith('Python 3.'): +# if lang.text.startswith('Python3.'): # # Inject the Python code as defined in the body of the OpaqueExpression: # for line in spec.childElement["body"][0].text.split('\n'): # lines.append("\t\t" + line) Modified: branches/77/src/AeonicXME/specs/m3/m3patch.cmof =================================================================== --- branches/77/src/AeonicXME/specs/m3/m3patch.cmof 2012-01-19 12:49:43 UTC (rev 1282) +++ branches/77/src/AeonicXME/specs/m3/m3patch.cmof 2012-01-19 14:05:41 UTC (rev 1283) @@ -15,7 +15,7 @@ </ownedComment> <ownedRule xmi:type="cmof:Constraint" xmi:id="Core-Constructs-Element-_new-spec" name="spec" constrainedElement="Core-Constructs-Element-_new" namespace="Core-Constructs-Element-_new"> <specification xmi:type="cmof:OpaqueExpression" xmi:id="Core-Constructs-Element-_new-spec-specification"> - <language>Python 3.2</language> + <language>Python3.2</language> <body><include src="code/Element/_new.py" /></body> </specification> </ownedRule> @@ -41,7 +41,7 @@ </ownedComment> <ownedRule xmi:type="cmof:Constraint" xmi:id="Core-Constructs-Element-_specify-spec" name="spec" constrainedElement="Core-Constructs-Element-_specify" namespace="Core-Constructs-Element-_specify"> <specification xmi:type="cmof:OpaqueExpression" xmi:id="Core-Constructs-Element-_specify-spec-specification"> - <language>Python 3.2</language> + <language>Python3.2</language> <body><include src="code/Element/_specify.py" /></body> </specification> </ownedRule> @@ -77,7 +77,7 @@ </ownedComment> <ownedRule xmi:type="cmof:Constraint" xmi:id="Core-Constructs-Element-_src_metaprops-spec" name="spec" constrainedElement="Core-Constructs-Element-_src_metaprops" namespace="Core-Constructs-Element-_src_metaprops"> <specification xmi:type="cmof:OpaqueExpression" xmi:id="Core-Constructs-Element-_src_metaprops-spec-specification"> - <language>Python 3.2</language> + <language>Python3.2</language> <body><include src="code/Element/_src_metaprops.py" /></body> </specification> </ownedRule> @@ -108,7 +108,7 @@ </ownedComment> <ownedRule xmi:type="cmof:Constraint" xmi:id="Core-Constructs-NamedElement-_new-spec" name="spec" constrainedElement="Core-Constructs-NamedElement-_new" namespace="Core-Constructs-NamedElement-_new"> <specification xmi:type="cmof:OpaqueExpression" xmi:id="Core-Constructs-NamedElement-_new-spec-specification"> - <language>Python 3.2</language> + <language>Python3.2</language> <body><include src="code/NamedElement/_new.py" /></body> </specification> </ownedRule> @@ -124,7 +124,7 @@ </ownedComment> <ownedRule xmi:type="cmof:Constraint" xmi:id="Core-Constructs-NamedElement-_specify-spec" name="spec" constrainedElement="Core-Constructs-NamedElement-_specify" namespace="Core-Constructs-NamedElement-_specify"> <specification xmi:type="cmof:OpaqueExpression" xmi:id="Core-Constructs-NamedElement-_specify-spec-specification"> - <language>Python 3.2</language> + <language>Python3.2</language> <body><include src="code/NamedElement/_specify.py" /></body> </specification> </ownedRule> @@ -164,7 +164,7 @@ </ownedComment> <ownedRule xmi:type="cmof:Constraint" xmi:id="Core-Constructs-NamedElement-qualifiedName-spec" name="spec" constrainedElement="Core-Constructs-NamedElement-qualifiedName" namespace="Core-Constructs-NamedElement-qualifiedName"> <specification xmi:type="cmof:OpaqueExpression" xmi:id="Core-Constructs-NamedElement-qualifiedName-spec-specification"> - <language>Python 3.2</language> + <language>Python3.2</language> <body><include src="code/NamedElement/qualifiedName.py" /></body> </specification> </ownedRule> @@ -190,7 +190,7 @@ </ownedComment> <ownedRule xmi:type="cmof:Constraint" xmi:id="Core-Constructs-NamedElement-_python_qualifiedName-spec" name="spec" constrainedElement="Core-Constructs-NamedElement-_python_qualifiedName" namespace="Core-Constructs-NamedElement-_python_qualifiedName"> <specification xmi:type="cmof:OpaqueExpression" xmi:id="Core-Constructs-NamedElement-_python_qualifiedName-spec-specification"> - <language>Python 3.2</language> + <language>Python3.2</language> <body><include src="code/NamedElement/_python_qualifiedName.py" /></body> </specification> </ownedRule> @@ -216,7 +216,7 @@ </ownedComment> <ownedRule xmi:type="cmof:Constraint" xmi:id="Core-Constructs-Namespace-_new-spec" name="spec" constrainedElement="Core-Constructs-Namespace-_new" namespace="Core-Constructs-Namespace-_new"> <specification xmi:type="cmof:OpaqueExpression" xmi:id="Core-Constructs-Namespace-_new-spec-specification"> - <language>Python 3.2</language> + <language>Python3.2</language> <body><include src="code/Namespace/_new.py" /></body> </specification> </ownedRule> @@ -232,7 +232,7 @@ </ownedComment> <ownedRule xmi:type="cmof:Constraint" xmi:id="Core-Constructs-Namespace-_specify-spec" name="spec" constrainedElement="Core-Constructs-Namespace-_specify" namespace="Core-Constructs-Namespace-_specify"> <specification xmi:type="cmof:OpaqueExpression" xmi:id="Core-Constructs-Namespace-_specify-spec-specification"> - <language>Python 3.2</language> + <language>Python3.2</language> <body><include src="code/Namespace/_specify.py" /></body> </specification> </ownedRule> @@ -282,7 +282,7 @@ </ownedComment> <ownedRule xmi:type="cmof:Constraint" xmi:id="Core-Constructs-MultiplicityElement-_specify-spec" name="spec" constrainedElement="Core-Constructs-MultiplicityElement-_specify" namespace="Core-Constructs-MultiplicityElement-_specify"> <specification xmi:type="cmof:OpaqueExpression" xmi:id="Core-Constructs-MultiplicityElement-_specify-spec-specification"> - <language>Python 3.2</language> + <language>Python3.2</language> <body><include src="code/MultiplicityElement/_specify.py" /></body> </specification> </ownedRule> @@ -318,7 +318,7 @@ </ownedComment> <ownedRule xmi:type="cmof:Constraint" xmi:id="Core-Constructs-TypedElement-_specify-spec" name="spec" constrainedElement="Core-Constructs-TypedElement-_specify" namespace="Core-Constructs-TypedElement-_specify"> <specification xmi:type="cmof:OpaqueExpression" xmi:id="Core-Constructs-TypedElement-_specify-spec-specification"> - <language>Python 3.2</language> + <language>Python3.2</language> <body><include src="code/TypedElement/_specify.py" /></body> </specification> </ownedRule> @@ -354,7 +354,7 @@ </ownedComment> <ownedRule xmi:type="cmof:Constraint" xmi:id="Core-Constructs-PackageableElement-_specify-spec" name="spec" constrainedElement="Core-Constructs-PackageableElement-_specify" namespace="Core-Constructs-PackageableElement-_specify"> <specification xmi:type="cmof:OpaqueExpression" xmi:id="Core-Constructs-PackageableElement-_specify-spec-specification"> - <language>Python 3.2</language> + <language>Python3.2</language> <body><include src="code/PackageableElement/_specify.py" /></body> </specification> </ownedRule> @@ -390,7 +390,7 @@ </ownedComment> <ownedRule xmi:type="cmof:Constraint" xmi:id="Core-Constructs-ValueSpecification-_specify-spec" name="spec" constrainedElement="Core-Constructs-ValueSpecification-_specify" namespace="Core-Constructs-ValueSpecification-_specify"> <specification xmi:type="cmof:OpaqueExpression" xmi:id="Core-Constructs-ValueSpecification-_specify-spec-specification"> - <language>Python 3.2</language> + <language>Python3.2</language> <body><include src="code/ValueSpecification/_specify.py" /></body> </specification> </ownedRule> @@ -426,7 +426,7 @@ </ownedComment> <ownedRule xmi:type="cmof:Constraint" xmi:id="Core-Constructs-Package-_new-spec" name="spec" constrainedElement="Core-Constructs-Package-_new" namespace="Core-Constructs-Package-_new"> <specification xmi:type="cmof:OpaqueExpression" xmi:id="Core-Constructs-Package-_new-spec-specification"> - <language>Python 3.2</language> + <language>Python3.2</language> <body><include src="code/Package/_new.py" /></body> </specification> </ownedRule> @@ -442,7 +442,7 @@ </ownedComment> <ownedRule xmi:type="cmof:Constraint" xmi:id="Core-Constructs-Package-_specify-spec" name="spec" constrainedElement="Core-Constructs-Package-_specify" namespace="Core-Constructs-Package-_specify"> <specification xmi:type="cmof:OpaqueExpression" xmi:id="Core-Constructs-Package-_specify-spec-specification"> - <language>Python 3.2</language> + <language>Python3.2</language> <body><include src="code/Package/_specify.py" /></body> </specification> </ownedRule> @@ -478,7 +478,7 @@ </ownedComment> <ownedRule xmi:type="cmof:Constraint" xmi:id="Core-Constructs-Package-_registerModule-spec" name="spec" constrainedElement="Core-Constructs-Package-_registerModule" namespace="Core-Constructs-Package-_registerModule"> <specification xmi:type="cmof:OpaqueExpression" xmi:id="Core-Constructs-Package-_registerModule-spec-specification"> - <language>Python 3.2</language> + <language>Python3.2</language> <body><include src="code/Package/_registerModule.py" /></body> </specification> </ownedRule> @@ -504,7 +504,7 @@ </ownedComment> <ownedRule xmi:type="cmof:Constraint" xmi:id="Core-Constructs-Package-_construct-spec" name="spec" constrainedElement="Core-Constructs-Package-_construct" namespace="Core-Constructs-Package-_construct"> <specification xmi:type="cmof:OpaqueExpression" xmi:id="Core-Constructs-Package-_construct-spec-specification"> - <language>Python 3.2</language> + <language>Python3.2</language> <body><include src="code/Package/_construct.py" /></body> </specification> </ownedRule> @@ -535,7 +535,7 @@ </ownedComment> <ownedRule xmi:type="cmof:Constraint" xmi:id="Core-Constructs-Class-_new-spec" name="spec" constrainedElement="Core-Constructs-Class-_new" namespace="Core-Constructs-Class-_new"> <specification xmi:type="cmof:OpaqueExpression" xmi:id="Core-Constructs-Class-_new-spec-specification"> - <language>Python 3.2</language> + <language>Python3.2</language> <body><include src="code/Class/_new.py" /></body> </specification> </ownedRule> @@ -551,7 +551,7 @@ </ownedComment> <ownedRule xmi:type="cmof:Constraint" xmi:id="Core-Constructs-Class-_merge-spec" name="spec" constrainedElement="Core-Constructs-Class-_merge" namespace="Core-Constructs-Class-_merge"> <specification xmi:type="cmof:OpaqueExpression" xmi:id="Core-Constructs-Class-_merge-spec-specification"> - <language>Python 3.2</language> + <language>Python3.2</language> <body><include src="code/Class/_merge.py" /></body> </specification> </ownedRule> @@ -567,7 +567,7 @@ </ownedComment> <ownedRule xmi:type="cmof:Constraint" xmi:id="Core-Constructs-Class-_specify-spec" name="spec" constrainedElement="Core-Constructs-Class-_specify" namespace="Core-Constructs-Class-_specify"> <specification xmi:type="cmof:OpaqueExpression" xmi:id="Core-Constructs-Class-_specify-spec-specification"> - <language>Python 3.2</language> + <language>Python3.2</language> <body><include src="code/Class/_specify.py" /></body> </specification> </ownedRule> @@ -603,7 +603,7 @@ </ownedComment> <ownedRule xmi:type="cmof:Constraint" xmi:id="Core-Constructs-Class-_construct-spec" name="spec" constrainedElement="Core-Constructs-Class-_construct" namespace="Core-Constructs-Class-_construct"> <specification xmi:type="cmof:OpaqueExpression" xmi:id="Core-Constructs-Class-_construct-spec-specification"> - <language>Python 3.2</language> + <language>Python3.2</language> <body><include src="code/Class/_construct.py" /></body> </specification> </ownedRule> @@ -634,7 +634,7 @@ </ownedComment> <ownedRule xmi:type="cmof:Constraint" xmi:id="Core-Constructs-Property-_new-spec" name="spec" constrainedElement="Core-Constructs-Property-_new" namespace="Core-Constructs-Property-_new"> <specification xmi:type="cmof:OpaqueExpression" xmi:id="Core-Constructs-Property-_new-spec-specification"> - <language>Python 3.2</language> + <language>Python3.2</language> <body><include src="code/Property/_new.py" /></body> </specification> </ownedRule> @@ -650,7 +650,7 @@ </ownedComment> <ownedRule xmi:type="cmof:Constraint" xmi:id="Core-Constructs-Property-_specify-spec" name="spec" constrainedElement="Core-Constructs-Property-_specify" namespace="Core-Constructs-Property-_specify"> <specification xmi:type="cmof:OpaqueExpression" xmi:id="Core-Constructs-Property-_specify-spec-specification"> - <language>Python 3.2</language> + <language>Python3.2</language> <body><include src="code/Property/_specify.py" /></body> </specification> </ownedRule> @@ -686,7 +686,7 @@ </ownedComment> <ownedRule xmi:type="cmof:Constraint" xmi:id="Core-Constructs-Property-_construct-spec" name="spec" constrainedElement="Core-Constructs-Property-_construct" namespace="Core-Constructs-Property-_construct"> <specification xmi:type="cmof:OpaqueExpression" xmi:id="Core-Constructs-Property-_construct-spec-specification"> - <language>Python 3.2</language> + <language>Python3.2</language> <body><include src="code/Property/_construct.py" /></body> </specification> </ownedRule> @@ -715,7 +715,7 @@ <target href="Core-Constructs-Classifier-parents-spec" /> <addition href="Core-Constructs-Classifier-parents-spec-_specification" /> <specification xmi:type="cmof:OpaqueExpression" xmi:id="Core-Constructs-Classifier-parents-spec-_specification"> - <language>Python 3.2</language> + <language>Python3.2</language> <body><include src="code/Classifier/parents.py" /></body> </specification> </difference> @@ -729,7 +729,7 @@ </ownedComment> <ownedRule xmi:type="cmof:Constraint" xmi:id="Core-Constructs-Classifier-_specify-spec" name="spec" constrainedElement="Core-Constructs-Classifier-_specify" namespace="Core-Constructs-Classifier-_specify"> <specification xmi:type="cmof:OpaqueExpression" xmi:id="Core-Constructs-Classifier-_specify-spec-specification"> - <language>Python 3.2</language> + <language>Python3.2</language> <body><include src="code/Classifier/_specify.py" /></body> </specification> </ownedRule> @@ -765,7 +765,7 @@ </ownedComment> <ownedRule xmi:type="cmof:Constraint" xmi:id="Core-Constructs-Operation-_specify-spec" name="spec" constrainedElement="Core-Constructs-Operation-_specify" namespace="Core-Constructs-Operation-_specify"> <specification xmi:type="cmof:OpaqueExpression" xmi:id="Core-Constructs-Operation-_specify-spec-specification"> - <language>Python 3.2</language> + <language>Python3.2</language> <body><include src="code/Operation/_specify.py" /></body> </specification> </ownedRule> @@ -801,7 +801,7 @@ </ownedComment> <ownedRule xmi:type="cmof:Constraint" xmi:id="Core-Constructs-Operation-_construct-spec" name="spec" constrainedElement="Core-Constructs-Operation-_construct" namespace="Core-Constructs-Operation-_construct"> <specification xmi:type="cmof:OpaqueExpression" xmi:id="Core-Constructs-Operation-_construct-spec-specification"> - <language>Python 3.2</language> + <language>Python3.2</language> <body><include src="code/Operation/_construct.py" /></body> </specification> </ownedRule> @@ -832,7 +832,7 @@ </ownedComment> <ownedRule xmi:type="cmof:Constraint" xmi:id="Core-Constructs-Parameter-_specify-spec" name="spec" constrainedElement="Core-Constructs-Parameter-_specify" namespace="Core-Constructs-Parameter-_specify"> <specification xmi:type="cmof:OpaqueExpression" xmi:id="Core-Constructs-Parameter-_specify-spec-specification"> - <language>Python 3.2</language> + <language>Python3.2</language> <body><include src="code/Parameter/_specify.py" /></body> </specification> </ownedRule> @@ -868,7 +868,7 @@ </ownedComment> <ownedRule xmi:type="cmof:Constraint" xmi:id="Core-Constructs-Parameter-_construct-spec" name="spec" constrainedElement="Core-Constructs-Parameter-_construct" namespace="Core-Constructs-Parameter-_construct"> <specification xmi:type="cmof:OpaqueExpression" xmi:id="Core-Constructs-Parameter-_construct-spec-specification"> - <language>Python 3.2</language> + <language>Python3.2</language> <body><include src="code/Parameter/_construct.py" /></body> </specification> </ownedRule> @@ -899,7 +899,7 @@ </ownedComment> <ownedRule xmi:type="cmof:Constraint" xmi:id="Core-Constructs-Constraint-_specify-spec" name="spec" constrainedElement="Core-Constructs-Constraint-_specify" namespace="Core-Constructs-Constraint-_specify"> <specification xmi:type="cmof:OpaqueExpression" xmi:id="Core-Constructs-Constraint-_specify-spec-specification"> - <language>Python 3.2</language> + <language>Python3.2</language> <body><include src="code/Constraint/_specify.py" /></body> </specification> </ownedRule> @@ -935,7 +935,7 @@ </ownedComment> <ownedRule xmi:type="cmof:Constraint" xmi:id="Core-Constructs-Constraint-_construct-spec" name="spec" constrainedElement="Core-Constructs-Constraint-_construct" namespace="Core-Constructs-Constraint-_construct"> <specification xmi:type="cmof:OpaqueExpression" xmi:id="Core-Constructs-Constraint-_construct-spec-specification"> - <language>Python 3.2</language> + <language>Python3.2</language> <body><include src="code/Constraint/_construct.py" /></body> </specification> </ownedRule> @@ -966,7 +966,7 @@ </ownedComment> <ownedRule xmi:type="cmof:Constraint" xmi:id="Core-Constructs-OpaqueExpression-_specify-spec" name="spec" constrainedElement="Core-Constructs-OpaqueExpression-_specify" namespace="Core-Constructs-OpaqueExpression-_specify"> <specification xmi:type="cmof:OpaqueExpression" xmi:id="Core-Constructs-OpaqueExpression-_specify-spec-specification"> - <language>Python 3.2</language> + <language>Python3.2</language> <body><include src="code/OpaqueExpression/_specify.py" /></body> </specification> </ownedRule> @@ -1002,7 +1002,7 @@ </ownedComment> <ownedRule xmi:type="cmof:Constraint" xmi:id="Core-Constructs-OpaqueExpression-_construct-spec" name="spec" constrainedElement="Core-Constructs-OpaqueExpression-_construct" namespace="Core-Constructs-OpaqueExpression-_construct"> <specification xmi:type="cmof:OpaqueExpression" xmi:id="Core-Constructs-OpaqueExpression-_construct-spec-specification"> - <language>Python 3.2</language> + <language>Python3.2</language> <body><include src="code/OpaqueExpression/_construct.py" /></body> </specification> </ownedRule> @@ -1064,7 +1064,7 @@ </ownedParameter> <ownedRule xmi:type="cmof:Constraint" xmi:id="Core-Constructs-Generator-construct_M2-spec" name="spec" constrainedElement="Core-Constructs-Generator-construct_M2" namespace="Core-Constructs-Generator-construct_M2"> <specification xmi:type="cmof:OpaqueExpression" xmi:id="Core-Constructs-Generator-construct_M2-spec-specification"> - <language>Python 3.2</language> + <language>Python3.2</language> <body><include src="code/Generator/construct_M2.py" /></body> </specification> </ownedRule> Modified: branches/77/src/AeonicXME/testdata/testM3_generateM2_small.cmof =================================================================== --- branches/77/src/AeonicXME/testdata/testM3_generateM2_small.cmof 2012-01-19 12:49:43 UTC (rev 1282) +++ branches/77/src/AeonicXME/testdata/testM3_generateM2_small.cmof 2012-01-19 14:05:41 UTC (rev 1283) @@ -11,7 +11,7 @@ <body>Comment of SP1-C2-_ownedRule.0</body> </ownedComment> <specification xmi:type="cmof:OpaqueExpression" xmi:id="SP1-C2-_ownedRule.0-_spec"> - <language>Python 3.2</language> + <language>Python3.2</language> <body>return True</body> </specification> </ownedRule> Modified: branches/77/src/AeonicXME/testdata/testM3_reportM2.cmof =================================================================== --- branches/77/src/AeonicXME/testdata/testM3_reportM2.cmof 2012-01-19 12:49:43 UTC (rev 1282) +++ branches/77/src/AeonicXME/testdata/testM3_reportM2.cmof 2012-01-19 14:05:41 UTC (rev 1283) @@ -34,7 +34,7 @@ <ownedOperation xmi:type="cmof:Operation" xmi:id="Test-Class-G-Operation" name="method" bodyCondition="Test-Class-G-Operation-Constraint"> <ownedRule xmi:type="cmof:Constraint" xmi:id="Test-Class-G-Operation-Constraint"> <specification xmi:type="cmof:OpaqueExpression" xmi:id="Test-Class-G-Spec"> - <language>Python 3.2</language> + <language>Python3.2</language> <body>return 42</body> </specification> </ownedRule> Modified: branches/77/src/AeonicXME/testdata/testM4_M3properties.cmof =================================================================== --- branches/77/src/AeonicXME/testdata/testM4_M3properties.cmof 2012-01-19 12:49:43 UTC (rev 1282) +++ branches/77/src/AeonicXME/testdata/testM4_M3properties.cmof 2012-01-19 14:05:41 UTC (rev 1283) @@ -30,7 +30,7 @@ <ownedOperation xmi:type="cmof:Operation" xmi:id="Test-Class-G-X-Operation" name="X" bodyCondition="Test-Class-G-X-Operation-Constraint"> <ownedRule xmi:type="cmof:Constraint" xmi:id="Test-Class-G-X-Operation-Constraint"> <specification xmi:type="cmof:OpaqueExpression" xmi:id="Test-Class-G-X-Spec"> - <language>Python 3.2</language> + <language>Python3.2</language> <body>return 42</body> </specification> </ownedRule> Modified: branches/77/src/AeonicXME/testdata/testM4_constructM3.cmof =================================================================== --- branches/77/src/AeonicXME/testdata/testM4_constructM3.cmof 2012-01-19 12:49:43 UTC (rev 1282) +++ branches/77/src/AeonicXME/testdata/testM4_constructM3.cmof 2012-01-19 14:05:41 UTC (rev 1283) @@ -14,26 +14,26 @@ <!-- Test Constraint on the member --> <ownedRule xmi:type="cmof:Constraint" xmi:id="SP1-C1-test_constraint" name="test_constraint" constrainedElement="SP1-C1" namespace="SP1-C1"> <specification xmi:type="cmof:OpaqueExpression" xmi:id="SP1-C1-test_constraint-_spec"> - <language>Python 3.2</language> + <language>Python3.2</language> <body>return not self.constraint_fail</body> </specification> </ownedRule> <ownedOperation xmi:type="cmof:Operation" xmi:id="SP1-C1-failing_condition" name="failing_condition" class="SP1-C1" isQuery="true" bodyCondition="SP1-C1-failing_condition-python" precondition="SP1-C1-failing_condition-python-pre" postcondition="SP1-C1-failing_condition-python-post"> <ownedRule xmi:type="cmof:Constraint" xmi:id="SP1-C1-failing_condition-python" name="python" constrainedElement="SP1-C1-failing_condition" namespace="SP1-C1-failing_condition"> <specification xmi:type="cmof:OpaqueExpression" xmi:id="SP1-C1-failing_condition-python-_spec"> - <language>Python 3.2</language> + <language>Python3.2</language> <body>return True</body> </specification> </ownedRule> <ownedRule xmi:type="cmof:Constraint" xmi:id="SP1-C1-failing_condition-python-pre" name="python" constrainedElement="SP1-C1-failing_condition" namespace="SP1-C1-failing_condition"> <specification xmi:type="cmof:OpaqueExpression" xmi:id="SP1-C1-failing_condition-python-pre-_spec"> - <language>Python 3.2</language> + <language>Python3.2</language> <body>return self['pre']</body> </specification> </ownedRule> <ownedRule xmi:type="cmof:Constraint" xmi:id="SP1-C1-failing_condition-python-post" name="python" constrainedElement="SP1-C1-failing_condition" namespace="SP1-C1-failing_condition"> <specification xmi:type="cmof:OpaqueExpression" xmi:id="SP1-C1-failing_condition-python-post-_spec"> - <language>Python 3.2</language> + <language>Python3.2</language> <body>return self['post']</body> </specification> </ownedRule> @@ -46,7 +46,7 @@ </ownedComment> <ownedRule xmi:type="cmof:Constraint" xmi:id="SP1-C1-Test-param_tests-python" name="python" constrainedElement="SP1-C1-Test-param_tests" namespace="SP1-C1-Test-param_tests"> <specification xmi:type="cmof:OpaqueExpression" xmi:id="SP1-C1-Test-param_tests-python-_spec"> - <language>Python 3.2</language> + <language>Python3.2</language> <body>return kwargs.get('x') or (args[0] if args else b or a)</body> </specification> </ownedRule> @@ -72,7 +72,7 @@ <body>Comment of SP1-C2-_ownedRule.0</body> </ownedComment> <specification xmi:type="cmof:OpaqueExpression" xmi:id="SP1-C2-_ownedRule.0-_spec"> - <language>Python 3.2</language> + <language>Python3.2</language> <body>return True</body> </specification> </ownedRule> @@ -91,7 +91,7 @@ <body>Comment of SP1-C3-_ownedRule.0</body> </ownedComment> <specification xmi:type="cmof:OpaqueExpression" xmi:id="SP1-C3-_ownedRule.0-_spec"> - <language>Python 3.2</language> + <language>Python3.2</language> <body>return True</body> </specification> </ownedRule> @@ -112,7 +112,7 @@ <body>Comment of SP2-C1-_ownedRule.0</body> </ownedComment> <specification xmi:type="cmof:OpaqueExpression" xmi:id="SP2-C1-_ownedRule.0-_spec"> - <language>Python 3.2</language> + <language>Python3.2</language> <body>return True</body> </specification> </ownedRule> @@ -131,7 +131,7 @@ <body>Comment of SP2-C2-_ownedRule.0</body> </ownedComment> <specification xmi:type="cmof:OpaqueExpression" xmi:id="SP2-C2-_ownedRule.0-_spec"> - <language>Python 3.2</language> + <language>Python3.2</language> <body>return True</body> </specification> </ownedRule> @@ -154,7 +154,7 @@ <body>Comment of SP3-C1-_ownedRule.0</body> </ownedComment> <specification xmi:type="cmof:OpaqueExpression" xmi:id="SP3-C1-_ownedRule.0-_spec"> - <language>Python 3.2</language> + <language>Python3.2</language> <body>return True</body> </specification> </ownedRule> @@ -173,7 +173,7 @@ <body>Comment of SP3-C2-_ownedRule.0</body> </ownedComment> <specification xmi:type="cmof:OpaqueExpression" xmi:id="SP3-C2-_ownedRule.0-_spec"> - <language>Python 3.2</language> + <language>Python3.2</language> <body>return True</body> </specification> </ownedRule> @@ -194,7 +194,7 @@ <body>Comment of SP4-C1-_ownedRule.0</body> </ownedComment> <specification xmi:type="cmof:OpaqueExpression" xmi:id="SP4-C1-_ownedRule.0-_spec"> - <language>Python 3.2</language> + <language>Python3.2</language> <body>return True</body> </specification> </ownedRule> @@ -213,7 +213,7 @@ <body>Comment of SP4-C2-_ownedRule.0</body> </ownedComment> <specification xmi:type="cmof:OpaqueExpression" xmi:id="SP4-C2-_ownedRule.0-_spec"> - <language>Python 3.2</language> + <language>Python3.2</language> <body>return True</body> </specification> </ownedRule> Modified: branches/77/src/AeonicXME/testdata/testM4_patchM3.cmof =================================================================== --- branches/77/src/AeonicXME/testdata/testM4_patchM3.cmof 2012-01-19 12:49:43 UTC (rev 1282) +++ branches/77/src/AeonicXME/testdata/testM4_patchM3.cmof 2012-01-19 14:05:41 UTC (rev 1283) @@ -15,7 +15,7 @@ <body>Comment of SP3-C1-_ownedRule.0</body> </ownedComment> <specification xmi:type="cmof:OpaqueExpression" xmi:id="SP3-C1-_ownedRule.0-_spec"> - <language>Python 3.2</language> + <language>Python3.2</language> <body>return True</body> </specification> </ownedRule> @@ -34,7 +34,7 @@ <body>Comment of SP3-C2-_ownedRule.0</body> </ownedComment> <specification xmi:type="cmof:OpaqueExpression" xmi:id="SP3-C2-_ownedRule.0-_spec"> - <language>Python 3.2</language> + <language>Python3.2</language> <body>return True</body> </specification> </ownedRule> @@ -55,7 +55,7 @@ <body>Comment of SP4-C1-_ownedRule.0</body> </ownedComment> <specification xmi:type="cmof:OpaqueExpression" xmi:id="SP4-C1-_ownedRule.0-_spec"> - <language>Python 3.2</language> + <language>Python3.2</language> <body>return True</body> </specification> </ownedRule> @@ -74,7 +74,7 @@ <body>Comment of SP4-C2-_ownedRule.0</body> </ownedComment> <specification xmi:type="cmof:OpaqueExpression" xmi:id="SP4-C2-_ownedRule.0-_spec"> - <language>Python 3.2</language> + <language>Python3.2</language> <body>return True</body> </specification> </ownedRule> @@ -97,7 +97,7 @@ <body>Comment of SP5-C1-_ownedRule.0</body> </ownedComment> <specification xmi:type="cmof:OpaqueExpression" xmi:id="SP5-C1-_ownedRule.0-_spec"> - <language>Python 3.2</language> + <language>Python3.2</language> <body>return True</body> </specification> </ownedRule> @@ -116,7 +116,7 @@ <body>Comment of SP5-C2-_ownedRule.0</body> </ownedComment> <specification xmi:type="cmof:OpaqueExpression" xmi:id="SP5-C2-_ownedRule.0-_spec"> - <language>Python 3.2</language> + <language>Python3.2</language> <body>return True</body> </specification> </ownedRule> @@ -176,26 +176,26 @@ <!-- Test Constraint on the member --> <ownedRule xmi:type="cmof:Constraint" xmi:id="SP1-C1-test_constraint" name="test_constraint" constrainedElement="SP1-C1" namespace="SP1-C1"> <specification xmi:type="cmof:OpaqueExpression" xmi:id="SP1-C1-test_constraint-_spec"> - <language>Python 3.2</language> + <language>Python3.2</language> <body>return not self.constraint_fail</body> </specification> </ownedRule> <ownedOperation xmi:type="cmof:Operation" xmi:id="SP1-C1-failing_condition" name="failing_condition" class="SP1-C1" isQuery="true" bodyCondition="SP1-C1-failing_condition-python" precondition="SP1-C1-failing_condition-python-pre" postcondition="SP1-C1-failing_condition-python-post"> <ownedRule xmi:type="cmof:Constraint" xmi:id="SP1-C1-failing_condition-python" name="python" constrainedElement="SP1-C1-failing_condition" namespace="SP1-C1-failing_condition"> <specification xmi:type="cmof:OpaqueExpression" xmi:id="SP1-C1-failing_condition-python-_spec"> - <language>Python 3.2</language> + <language>Python3.2</language> <body>return True</body> </specification> </ownedRule> <ownedRule xmi:type="cmof:Constraint" xmi:id="SP1-C1-failing_condition-python-pre" name="python" constrainedElement="SP1-C1-failing_condition" namespace="SP1-C1-failing_condition"> <specification xmi:type="cmof:OpaqueExpression" xmi:id="SP1-C1-failing_condition-python-pre-_spec"> - <language>Python 3.2</language> + <language>Python3.2</language> <body>return self['pre']</body> </specification> </ownedRule> <ownedRule xmi:type="cmof:Constraint" xmi:id="SP1-C1-failing_condition-python-post" name="python" constrainedElement="SP1-C1-failing_condition" namespace="SP1-C1-failing_condition"> <specification xmi:type="cmof:OpaqueExpression" xmi:id="SP1-C1-failing_condition-python-post-_spec"> - <language>Python 3.2</language> + <language>Python3.2</language> <body>return self['post']</body> </specification> </ownedRule> @@ -208,7 +208,7 @@ </ownedComment> <ownedRule xmi:type="cmof:Constraint" xmi:id="SP1-C1-Test-param_tests-python" name="python" constrainedElement="SP1-C1-Test-param_tests" namespace="SP1-C1-Test-param_tests"> <specification xmi:type="cmof:OpaqueExpression" xmi:id="SP1-C1-Test-param_tests-python-_spec"> - <language>Python 3.2</language> + <language>Python3.2</language> <body>return kwargs.get('x') or (args[0] if args else b or a)</body> </specification> </ownedRule> @@ -234,7 +234,7 @@ <body>Comment of SP1-C2-_ownedRule.0</body> </ownedComment> <specification xmi:type="cmof:OpaqueExpression" xmi:id="SP1-C2-_ownedRule.0-_spec"> - <language>Python 3.2</language> + <language>Python3.2</language> <body>return True</body> </specification> </ownedRule> @@ -253,7 +253,7 @@ <body>Comment of SP1-C3-_ownedRule.0</body> </ownedComment> <specification xmi:type="cmof:OpaqueExpression" xmi:id="SP1-C3-_ownedRule.0-_spec"> - <language>Python 3.2</language> + <language>Python3.2</language> <body>return True</body> </specification> </ownedRule> @@ -274,7 +274,7 @@ <body>Comment of SP2-C1-_ownedRule.0</body> </ownedComment> <specification xmi:type="cmof:OpaqueExpression" xmi:id="SP2-C1-_ownedRule.0-_spec"> - <language>Python 3.2</language> + <language>Python3.2</language> <body>return True</body> </specification> </ownedRule> @@ -293,7 +293,7 @@ <body>Comment of SP2-C2-_ownedRule.0</body> </ownedComment> <specification xmi:type="cmof:OpaqueExpression" xmi:id="SP2-C2-_ownedRule.0-_spec"> - <language>Python 3.2</language> + <language>Python3.2</language> <body>return True</body> </specification> </ownedRule> Modified: branches/77/src/AeonicXME/testdata/testM4_reportM3.cmof =================================================================== --- branches/77/src/AeonicXME/testdata/testM4_reportM3.cmof 2012-01-19 12:49:43 UTC (rev 1282) +++ branches/77/src/AeonicXME/testdata/testM4_reportM3.cmof 2012-01-19 14:05:41 UTC (rev 1283) @@ -36,7 +36,7 @@ <ownedOperation xmi:type="cmof:Operation" xmi:id="Test-Class-G-Operation" name="method" bodyCondition="Test-Class-G-Operation-Constraint"> <ownedRule xmi:type="cmof:Constraint" xmi:id="Test-Class-G-Operation-Constraint"> <specification xmi:type="cmof:OpaqueExpression" xmi:id="Test-Class-G-Spec"> - <language>Python 3.2</language> + <language>Python3.2</language> <body>return 42</body> </specification> </ownedRule> Modified: branches/77/src/AeonicXME/tests/testM4_constructM3.py =================================================================== --- branches/77/src/AeonicXME/tests/testM4_constructM3.py 2012-01-19 12:49:43 UTC (rev 1282) +++ branches/77/src/AeonicXME/tests/testM4_constructM3.py 2012-01-19 14:05:41 UTC (rev 1283) @@ -259,7 +259,7 @@ \t+Test::G <cmof:Class> \t\t+Test::G::method <cmof:Operation> \t\t\t+ <cmof:Constraint> -\t\t\t\t$ !Python 3.2 +\t\t\t\t$ !Python3.2 \t\t\t\t$ return 42 \t+Test::ConcreteClass <cmof:Class>""" self.assertEqual(report, self.rev.export_M3_as_textual_report()) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ah...@us...> - 2012-01-19 12:49:49
|
Revision: 1282 http://aeonic.svn.sourceforge.net/aeonic/?rev=1282&view=rev Author: ahatzis Date: 2012-01-19 12:49:43 +0000 (Thu, 19 Jan 2012) Log Message: ----------- branching from trunk for ticket #77 Added Paths: ----------- branches/77/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ah...@us...> - 2012-01-19 12:10:19
|
Revision: 1281 http://aeonic.svn.sourceforge.net/aeonic/?rev=1281&view=rev Author: ahatzis Date: 2012-01-19 12:10:09 +0000 (Thu, 19 Jan 2012) Log Message: ----------- remove branch of #73 Removed Paths: ------------- branches/73/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ah...@us...> - 2012-01-19 12:09:33
|
Revision: 1280 http://aeonic.svn.sourceforge.net/aeonic/?rev=1280&view=rev Author: ahatzis Date: 2012-01-19 12:09:24 +0000 (Thu, 19 Jan 2012) Log Message: ----------- merging branch with implementation of ticket #73 and bug-fixes back to trunk Modified Paths: -------------- trunk/doc/pydoc/AeonicXME.constructions.html trunk/doc/pydoc/AeonicXME.properties.html trunk/src/AeonicXME/specs/m3/code/Class/_construct.py trunk/src/AeonicXME/specs/m3/code/Element/_specify.py trunk/src/AeonicXME/specs/m3/code/Operation/_construct.py trunk/src/AeonicXME/specs/m3/code/Package/_construct.py trunk/src/AeonicXME/specs/m3/code/Package/_registerModule.py trunk/src/AeonicXME/testdata/testM3_generateM2.cmof trunk/src/AeonicXME/testdata/testpatchM2.cmof trunk/src/AeonicXME/tests/testM3_generateM2.py trunk/src/AeonicXME/utils/xmiExchanger.py Modified: trunk/doc/pydoc/AeonicXME.constructions.html =================================================================== --- trunk/doc/pydoc/AeonicXME.constructions.html 2012-01-19 10:20:19 UTC (rev 1279) +++ trunk/doc/pydoc/AeonicXME.constructions.html 2012-01-19 12:09:24 UTC (rev 1280) @@ -139,7 +139,8 @@ </dd> </dl> </dd> -<dt><font face="helvetica, arial"><a href="AeonicXME.constructions.html#Revision">Revision</a> +<dt><font face="helvetica, arial"><a href="AeonicXME.constructions.html#Layer">Layer</a> +</font></dt><dt><font face="helvetica, arial"><a href="AeonicXME.constructions.html#Revision">Revision</a> </font></dt></dl> </dd> </dl> @@ -164,9 +165,9 @@ </dl> <hr> Methods defined here:<br> -<dl><dt><a name="AddUpdater-__init__"><strong>__init__</strong></a>(self, rev<font color="#909090">=None</font>)</dt></dl> +<dl><dt><a name="AddUpdater-__init__"><strong>__init__</strong></a>(self, rev<font color="#909090">=None</font>, layer<font color="#909090">=None</font>)</dt></dl> -<dl><dt><a name="AddUpdater-apply"><strong>apply</strong></a>(self, rev<font color="#909090">=None</font>)</dt><dd><tt>Apply an 'add' update to the target model.</tt></dd></dl> +<dl><dt><a name="AddUpdater-apply"><strong>apply</strong></a>(self, rev<font color="#909090">=None</font>, layer<font color="#909090">=None</font>)</dt><dd><tt>Apply an 'add' update to the target model.</tt></dd></dl> <hr> Data descriptors inherited from <a href="AeonicXME.constructions.html#Constructor">Constructor</a>:<br> @@ -205,24 +206,24 @@ </dl> <hr> Methods defined here:<br> -<dl><dt><a name="AssociationConstructor-__init__"><strong>__init__</strong></a>(self, rev<font color="#909090">=None</font>)</dt></dl> +<dl><dt><a name="AssociationConstructor-__init__"><strong>__init__</strong></a>(self, rev<font color="#909090">=None</font>, layer<font color="#909090">=None</font>)</dt></dl> -<dl><dt><a name="AssociationConstructor-construct"><strong>construct</strong></a>(self, rev)</dt><dd><tt>Returns an instance of Association, a Python class defined for<br> +<dl><dt><a name="AssociationConstructor-construct"><strong>construct</strong></a>(self, rev<font color="#909090">=None</font>, layer<font color="#909090">=None</font>)</dt><dd><tt>Returns an instance of Association, a Python class defined for<br> processing association-based properties.</tt></dd></dl> <hr> Methods inherited from <a href="AeonicXME.constructions.html#ElementConstructor">ElementConstructor</a>:<br> -<dl><dt><a name="AssociationConstructor-add"><strong>add</strong></a>(self, rev<font color="#909090">=None</font>, additionID<font color="#909090">=None</font>, position<font color="#909090">=None</font>)</dt><dd><tt>Add this constructor element to the model at the given position of self.<br> +<dl><dt><a name="AssociationConstructor-add"><strong>add</strong></a>(self, rev<font color="#909090">=None</font>, layer<font color="#909090">=None</font>, additionID<font color="#909090">=None</font>, position<font color="#909090">=None</font>)</dt><dd><tt>Add this constructor element to the model at the given position of self.<br> Where position=1 puts the element to the first position and position=-1<br> is behind the last element. (According the MOF 2.0 /XMI 2.1.1 Mapping <br> Specification, Section "XMI encoding", this corresponds to XPointer <br> numbering.</tt></dd></dl> -<dl><dt><a name="AssociationConstructor-deep_delete"><strong>deep_delete</strong></a>(self, rev<font color="#909090">=None</font>)</dt><dd><tt>Cascading delete this <a href="#Constructor">Constructor</a> from the model.</tt></dd></dl> +<dl><dt><a name="AssociationConstructor-deep_delete"><strong>deep_delete</strong></a>(self, rev<font color="#909090">=None</font>, layer<font color="#909090">=None</font>)</dt><dd><tt>Cascading delete this <a href="#Constructor">Constructor</a> from the model.</tt></dd></dl> -<dl><dt><a name="AssociationConstructor-delete"><strong>delete</strong></a>(self, rev<font color="#909090">=None</font>)</dt><dd><tt>Delete this <a href="#Constructor">Constructor</a> from the model.</tt></dd></dl> +<dl><dt><a name="AssociationConstructor-delete"><strong>delete</strong></a>(self, rev<font color="#909090">=None</font>, layer<font color="#909090">=None</font>)</dt><dd><tt>Delete this <a href="#Constructor">Constructor</a> from the model.</tt></dd></dl> -<dl><dt><a name="AssociationConstructor-replace"><strong>replace</strong></a>(self, rev<font color="#909090">=None</font>, replacementID<font color="#909090">=None</font>, position<font color="#909090">=None</font>)</dt><dd><tt>Replace the target's constructor in the model with this constructor<br> +<dl><dt><a name="AssociationConstructor-replace"><strong>replace</strong></a>(self, rev<font color="#909090">=None</font>, layer<font color="#909090">=None</font>, replacementID<font color="#909090">=None</font>, position<font color="#909090">=None</font>)</dt><dd><tt>Replace the target's constructor in the model with this constructor<br> and add its containing.<br> <br> The new element's contained elements are appended at the first position. <br> @@ -260,24 +261,24 @@ </dl> <hr> Methods defined here:<br> -<dl><dt><a name="ClassConstructor-__init__"><strong>__init__</strong></a>(self, rev<font color="#909090">=None</font>)</dt></dl> +<dl><dt><a name="ClassConstructor-__init__"><strong>__init__</strong></a>(self, rev<font color="#909090">=None</font>, layer<font color="#909090">=None</font>)</dt></dl> -<dl><dt><a name="ClassConstructor-construct"><strong>construct</strong></a>(self, rev<font color="#909090">=None</font>)</dt><dd><tt>Constructs and returns a Python class based on the specification <br> +<dl><dt><a name="ClassConstructor-construct"><strong>construct</strong></a>(self, rev<font color="#909090">=None</font>, layer<font color="#909090">=None</font>)</dt><dd><tt>Constructs and returns a Python class based on the specification <br> stored in this constructor.</tt></dd></dl> <hr> Methods inherited from <a href="AeonicXME.constructions.html#ElementConstructor">ElementConstructor</a>:<br> -<dl><dt><a name="ClassConstructor-add"><strong>add</strong></a>(self, rev<font color="#909090">=None</font>, additionID<font color="#909090">=None</font>, position<font color="#909090">=None</font>)</dt><dd><tt>Add this constructor element to the model at the given position of self.<br> +<dl><dt><a name="ClassConstructor-add"><strong>add</strong></a>(self, rev<font color="#909090">=None</font>, layer<font color="#909090">=None</font>, additionID<font color="#909090">=None</font>, position<font color="#909090">=None</font>)</dt><dd><tt>Add this constructor element to the model at the given position of self.<br> Where position=1 puts the element to the first position and position=-1<br> is behind the last element. (According the MOF 2.0 /XMI 2.1.1 Mapping <br> Specification, Section "XMI encoding", this corresponds to XPointer <br> numbering.</tt></dd></dl> -<dl><dt><a name="ClassConstructor-deep_delete"><strong>deep_delete</strong></a>(self, rev<font color="#909090">=None</font>)</dt><dd><tt>Cascading delete this <a href="#Constructor">Constructor</a> from the model.</tt></dd></dl> +<dl><dt><a name="ClassConstructor-deep_delete"><strong>deep_delete</strong></a>(self, rev<font color="#909090">=None</font>, layer<font color="#909090">=None</font>)</dt><dd><tt>Cascading delete this <a href="#Constructor">Constructor</a> from the model.</tt></dd></dl> -<dl><dt><a name="ClassConstructor-delete"><strong>delete</strong></a>(self, rev<font color="#909090">=None</font>)</dt><dd><tt>Delete this <a href="#Constructor">Constructor</a> from the model.</tt></dd></dl> +<dl><dt><a name="ClassConstructor-delete"><strong>delete</strong></a>(self, rev<font color="#909090">=None</font>, layer<font color="#909090">=None</font>)</dt><dd><tt>Delete this <a href="#Constructor">Constructor</a> from the model.</tt></dd></dl> -<dl><dt><a name="ClassConstructor-replace"><strong>replace</strong></a>(self, rev<font color="#909090">=None</font>, replacementID<font color="#909090">=None</font>, position<font color="#909090">=None</font>)</dt><dd><tt>Replace the target's constructor in the model with this constructor<br> +<dl><dt><a name="ClassConstructor-replace"><strong>replace</strong></a>(self, rev<font color="#909090">=None</font>, layer<font color="#909090">=None</font>, replacementID<font color="#909090">=None</font>, position<font color="#909090">=None</font>)</dt><dd><tt>Replace the target's constructor in the model with this constructor<br> and add its containing.<br> <br> The new element's contained elements are appended at the first position. <br> @@ -317,21 +318,21 @@ </dl> <hr> Methods defined here:<br> -<dl><dt><a name="ClassifierConstructor-__init__"><strong>__init__</strong></a>(self, rev<font color="#909090">=None</font>)</dt></dl> +<dl><dt><a name="ClassifierConstructor-__init__"><strong>__init__</strong></a>(self, rev<font color="#909090">=None</font>, layer<font color="#909090">=None</font>)</dt></dl> <hr> Methods inherited from <a href="AeonicXME.constructions.html#ElementConstructor">ElementConstructor</a>:<br> -<dl><dt><a name="ClassifierConstructor-add"><strong>add</strong></a>(self, rev<font color="#909090">=None</font>, additionID<font color="#909090">=None</font>, position<font color="#909090">=None</font>)</dt><dd><tt>Add this constructor element to the model at the given position of self.<br> +<dl><dt><a name="ClassifierConstructor-add"><strong>add</strong></a>(self, rev<font color="#909090">=None</font>, layer<font color="#909090">=None</font>, additionID<font color="#909090">=None</font>, position<font color="#909090">=None</font>)</dt><dd><tt>Add this constructor element to the model at the given position of self.<br> Where position=1 puts the element to the first position and position=-1<br> is behind the last element. (According the MOF 2.0 /XMI 2.1.1 Mapping <br> Specification, Section "XMI encoding", this corresponds to XPointer <br> numbering.</tt></dd></dl> -<dl><dt><a name="ClassifierConstructor-deep_delete"><strong>deep_delete</strong></a>(self, rev<font color="#909090">=None</font>)</dt><dd><tt>Cascading delete this <a href="#Constructor">Constructor</a> from the model.</tt></dd></dl> +<dl><dt><a name="ClassifierConstructor-deep_delete"><strong>deep_delete</strong></a>(self, rev<font color="#909090">=None</font>, layer<font color="#909090">=None</font>)</dt><dd><tt>Cascading delete this <a href="#Constructor">Constructor</a> from the model.</tt></dd></dl> -<dl><dt><a name="ClassifierConstructor-delete"><strong>delete</strong></a>(self, rev<font color="#909090">=None</font>)</dt><dd><tt>Delete this <a href="#Constructor">Constructor</a> from the model.</tt></dd></dl> +<dl><dt><a name="ClassifierConstructor-delete"><strong>delete</strong></a>(self, rev<font color="#909090">=None</font>, layer<font color="#909090">=None</font>)</dt><dd><tt>Delete this <a href="#Constructor">Constructor</a> from the model.</tt></dd></dl> -<dl><dt><a name="ClassifierConstructor-replace"><strong>replace</strong></a>(self, rev<font color="#909090">=None</font>, replacementID<font color="#909090">=None</font>, position<font color="#909090">=None</font>)</dt><dd><tt>Replace the target's constructor in the model with this constructor<br> +<dl><dt><a name="ClassifierConstructor-replace"><strong>replace</strong></a>(self, rev<font color="#909090">=None</font>, layer<font color="#909090">=None</font>, replacementID<font color="#909090">=None</font>, position<font color="#909090">=None</font>)</dt><dd><tt>Replace the target's constructor in the model with this constructor<br> and add its containing.<br> <br> The new element's contained elements are appended at the first position. <br> @@ -366,26 +367,26 @@ </dl> <hr> Methods defined here:<br> -<dl><dt><a name="CommentConstructor-__init__"><strong>__init__</strong></a>(self, rev<font color="#909090">=None</font>)</dt></dl> +<dl><dt><a name="CommentConstructor-__init__"><strong>__init__</strong></a>(self, rev<font color="#909090">=None</font>, layer<font color="#909090">=None</font>)</dt></dl> -<dl><dt><a name="CommentConstructor-construct"><strong>construct</strong></a>(self, rev<font color="#909090">=None</font>)</dt><dd><tt>Return a string that can be used by the constructor of the <br> +<dl><dt><a name="CommentConstructor-construct"><strong>construct</strong></a>(self, rev<font color="#909090">=None</font>, layer<font color="#909090">=None</font>)</dt><dd><tt>Return a string that can be used by the constructor of the <br> owningElement of this comment.</tt></dd></dl> <dl><dt><a name="CommentConstructor-wrap_doc"><strong>wrap_doc</strong></a>(self, text<font color="#909090">=''</font>)</dt><dd><tt>Wrap and return the text to the max width defined for doc-strings.</tt></dd></dl> <hr> Methods inherited from <a href="AeonicXME.constructions.html#ElementConstructor">ElementConstructor</a>:<br> -<dl><dt><a name="CommentConstructor-add"><strong>add</strong></a>(self, rev<font color="#909090">=None</font>, additionID<font color="#909090">=None</font>, position<font color="#909090">=None</font>)</dt><dd><tt>Add this constructor element to the model at the given position of self.<br> +<dl><dt><a name="CommentConstructor-add"><strong>add</strong></a>(self, rev<font color="#909090">=None</font>, layer<font color="#909090">=None</font>, additionID<font color="#909090">=None</font>, position<font color="#909090">=None</font>)</dt><dd><tt>Add this constructor element to the model at the given position of self.<br> Where position=1 puts the element to the first position and position=-1<br> is behind the last element. (According the MOF 2.0 /XMI 2.1.1 Mapping <br> Specification, Section "XMI encoding", this corresponds to XPointer <br> numbering.</tt></dd></dl> -<dl><dt><a name="CommentConstructor-deep_delete"><strong>deep_delete</strong></a>(self, rev<font color="#909090">=None</font>)</dt><dd><tt>Cascading delete this <a href="#Constructor">Constructor</a> from the model.</tt></dd></dl> +<dl><dt><a name="CommentConstructor-deep_delete"><strong>deep_delete</strong></a>(self, rev<font color="#909090">=None</font>, layer<font color="#909090">=None</font>)</dt><dd><tt>Cascading delete this <a href="#Constructor">Constructor</a> from the model.</tt></dd></dl> -<dl><dt><a name="CommentConstructor-delete"><strong>delete</strong></a>(self, rev<font color="#909090">=None</font>)</dt><dd><tt>Delete this <a href="#Constructor">Constructor</a> from the model.</tt></dd></dl> +<dl><dt><a name="CommentConstructor-delete"><strong>delete</strong></a>(self, rev<font color="#909090">=None</font>, layer<font color="#909090">=None</font>)</dt><dd><tt>Delete this <a href="#Constructor">Constructor</a> from the model.</tt></dd></dl> -<dl><dt><a name="CommentConstructor-replace"><strong>replace</strong></a>(self, rev<font color="#909090">=None</font>, replacementID<font color="#909090">=None</font>, position<font color="#909090">=None</font>)</dt><dd><tt>Replace the target's constructor in the model with this constructor<br> +<dl><dt><a name="CommentConstructor-replace"><strong>replace</strong></a>(self, rev<font color="#909090">=None</font>, layer<font color="#909090">=None</font>, replacementID<font color="#909090">=None</font>, position<font color="#909090">=None</font>)</dt><dd><tt>Replace the target's constructor in the model with this constructor<br> and add its containing.<br> <br> The new element's contained elements are appended at the first position. <br> @@ -425,28 +426,28 @@ </dl> <hr> Methods defined here:<br> -<dl><dt><a name="ConstraintConstructor-__init__"><strong>__init__</strong></a>(self, rev<font color="#909090">=None</font>)</dt></dl> +<dl><dt><a name="ConstraintConstructor-__init__"><strong>__init__</strong></a>(self, rev<font color="#909090">=None</font>, layer<font color="#909090">=None</font>)</dt></dl> -<dl><dt><a name="ConstraintConstructor-construct"><strong>construct</strong></a>(self, rev<font color="#909090">=None</font>, conditionType<font color="#909090">='body'</font>)</dt><dd><tt>Compile and return a Python function.</tt></dd></dl> +<dl><dt><a name="ConstraintConstructor-construct"><strong>construct</strong></a>(self, rev<font color="#909090">=None</font>, layer<font color="#909090">=None</font>, conditionType<font color="#909090">='body'</font>)</dt><dd><tt>Compile and return a Python function.</tt></dd></dl> -<dl><dt><a name="ConstraintConstructor-is_python"><strong>is_python</strong></a>(self, rev<font color="#909090">=None</font>)</dt><dd><tt>Returns True if the specification is valid Python 3.x code, because<br> +<dl><dt><a name="ConstraintConstructor-is_python"><strong>is_python</strong></a>(self, rev<font color="#909090">=None</font>, layer<font color="#909090">=None</font>)</dt><dd><tt>Returns True if the specification is valid Python 3.x code, because<br> only such specifications can be used in Python functions directly<br> executed by the Python interpreter. Specifications of any other<br> language, e.g. OCL, are ignored for the purpose of Aeonic XME.</tt></dd></dl> <hr> Methods inherited from <a href="AeonicXME.constructions.html#ElementConstructor">ElementConstructor</a>:<br> -<dl><dt><a name="ConstraintConstructor-add"><strong>add</strong></a>(self, rev<font color="#909090">=None</font>, additionID<font color="#909090">=None</font>, position<font color="#909090">=None</font>)</dt><dd><tt>Add this constructor element to the model at the given position of self.<br> +<dl><dt><a name="ConstraintConstructor-add"><strong>add</strong></a>(self, rev<font color="#909090">=None</font>, layer<font color="#909090">=None</font>, additionID<font color="#909090">=None</font>, position<font color="#909090">=None</font>)</dt><dd><tt>Add this constructor element to the model at the given position of self.<br> Where position=1 puts the element to the first position and position=-1<br> is behind the last element. (According the MOF 2.0 /XMI 2.1.1 Mapping <br> Specification, Section "XMI encoding", this corresponds to XPointer <br> numbering.</tt></dd></dl> -<dl><dt><a name="ConstraintConstructor-deep_delete"><strong>deep_delete</strong></a>(self, rev<font color="#909090">=None</font>)</dt><dd><tt>Cascading delete this <a href="#Constructor">Constructor</a> from the model.</tt></dd></dl> +<dl><dt><a name="ConstraintConstructor-deep_delete"><strong>deep_delete</strong></a>(self, rev<font color="#909090">=None</font>, layer<font color="#909090">=None</font>)</dt><dd><tt>Cascading delete this <a href="#Constructor">Constructor</a> from the model.</tt></dd></dl> -<dl><dt><a name="ConstraintConstructor-delete"><strong>delete</strong></a>(self, rev<font color="#909090">=None</font>)</dt><dd><tt>Delete this <a href="#Constructor">Constructor</a> from the model.</tt></dd></dl> +<dl><dt><a name="ConstraintConstructor-delete"><strong>delete</strong></a>(self, rev<font color="#909090">=None</font>, layer<font color="#909090">=None</font>)</dt><dd><tt>Delete this <a href="#Constructor">Constructor</a> from the model.</tt></dd></dl> -<dl><dt><a name="ConstraintConstructor-replace"><strong>replace</strong></a>(self, rev<font color="#909090">=None</font>, replacementID<font color="#909090">=None</font>, position<font color="#909090">=None</font>)</dt><dd><tt>Replace the target's constructor in the model with this constructor<br> +<dl><dt><a name="ConstraintConstructor-replace"><strong>replace</strong></a>(self, rev<font color="#909090">=None</font>, layer<font color="#909090">=None</font>, replacementID<font color="#909090">=None</font>, position<font color="#909090">=None</font>)</dt><dd><tt>Replace the target's constructor in the model with this constructor<br> and add its containing.<br> <br> The new element's contained elements are appended at the first position. <br> @@ -561,7 +562,7 @@ ordered properties doesn't render the implementation incompatible to MOF)<br> </tt></td></tr> <tr><td> </td> <td width="100%">Methods defined here:<br> -<dl><dt><a name="Constructor-__init__"><strong>__init__</strong></a>(self, rev<font color="#909090">=None</font>)</dt><dd><tt>Called by <a href="#Constructor-__init__">__init__</a>() of specializing constructor classes.<br> +<dl><dt><a name="Constructor-__init__"><strong>__init__</strong></a>(self, rev<font color="#909090">=None</font>, layer<font color="#909090">=None</font>)</dt><dd><tt>Called by <a href="#Constructor-__init__">__init__</a>() of specializing constructor classes.<br> Only initialize property dictionaries, and set default values to the<br> properties needed for this constructor.<br> <br> @@ -596,21 +597,21 @@ </dl> <hr> Methods inherited from <a href="AeonicXME.constructions.html#ClassifierConstructor">ClassifierConstructor</a>:<br> -<dl><dt><a name="DataTypeConstructor-__init__"><strong>__init__</strong></a>(self, rev<font color="#909090">=None</font>)</dt></dl> +<dl><dt><a name="DataTypeConstructor-__init__"><strong>__init__</strong></a>(self, rev<font color="#909090">=None</font>, layer<font color="#909090">=None</font>)</dt></dl> <hr> Methods inherited from <a href="AeonicXME.constructions.html#ElementConstructor">ElementConstructor</a>:<br> -<dl><dt><a name="DataTypeConstructor-add"><strong>add</strong></a>(self, rev<font color="#909090">=None</font>, additionID<font color="#909090">=None</font>, position<font color="#909090">=None</font>)</dt><dd><tt>Add this constructor element to the model at the given position of self.<br> +<dl><dt><a name="DataTypeConstructor-add"><strong>add</strong></a>(self, rev<font color="#909090">=None</font>, layer<font color="#909090">=None</font>, additionID<font color="#909090">=None</font>, position<font color="#909090">=None</font>)</dt><dd><tt>Add this constructor element to the model at the given position of self.<br> Where position=1 puts the element to the first position and position=-1<br> is behind the last element. (According the MOF 2.0 /XMI 2.1.1 Mapping <br> Specification, Section "XMI encoding", this corresponds to XPointer <br> numbering.</tt></dd></dl> -<dl><dt><a name="DataTypeConstructor-deep_delete"><strong>deep_delete</strong></a>(self, rev<font color="#909090">=None</font>)</dt><dd><tt>Cascading delete this <a href="#Constructor">Constructor</a> from the model.</tt></dd></dl> +<dl><dt><a name="DataTypeConstructor-deep_delete"><strong>deep_delete</strong></a>(self, rev<font color="#909090">=None</font>, layer<font color="#909090">=None</font>)</dt><dd><tt>Cascading delete this <a href="#Constructor">Constructor</a> from the model.</tt></dd></dl> -<dl><dt><a name="DataTypeConstructor-delete"><strong>delete</strong></a>(self, rev<font color="#909090">=None</font>)</dt><dd><tt>Delete this <a href="#Constructor">Constructor</a> from the model.</tt></dd></dl> +<dl><dt><a name="DataTypeConstructor-delete"><strong>delete</strong></a>(self, rev<font color="#909090">=None</font>, layer<font color="#909090">=None</font>)</dt><dd><tt>Delete this <a href="#Constructor">Constructor</a> from the model.</tt></dd></dl> -<dl><dt><a name="DataTypeConstructor-replace"><strong>replace</strong></a>(self, rev<font color="#909090">=None</font>, replacementID<font color="#909090">=None</font>, position<font color="#909090">=None</font>)</dt><dd><tt>Replace the target's constructor in the model with this constructor<br> +<dl><dt><a name="DataTypeConstructor-replace"><strong>replace</strong></a>(self, rev<font color="#909090">=None</font>, layer<font color="#909090">=None</font>, replacementID<font color="#909090">=None</font>, position<font color="#909090">=None</font>)</dt><dd><tt>Replace the target's constructor in the model with this constructor<br> and add its containing.<br> <br> The new element's contained elements are appended at the first position. <br> @@ -642,9 +643,9 @@ </dl> <hr> Methods defined here:<br> -<dl><dt><a name="DeleteUpdater-__init__"><strong>__init__</strong></a>(self, rev<font color="#909090">=None</font>)</dt></dl> +<dl><dt><a name="DeleteUpdater-__init__"><strong>__init__</strong></a>(self, rev<font color="#909090">=None</font>, layer<font color="#909090">=None</font>)</dt></dl> -<dl><dt><a name="DeleteUpdater-apply"><strong>apply</strong></a>(self, rev<font color="#909090">=None</font>)</dt><dd><tt>Apply a 'delete' update to the target model.</tt></dd></dl> +<dl><dt><a name="DeleteUpdater-apply"><strong>apply</strong></a>(self, rev<font color="#909090">=None</font>, layer<font color="#909090">=None</font>)</dt><dd><tt>Apply a 'delete' update to the target model.</tt></dd></dl> <hr> Data descriptors inherited from <a href="AeonicXME.constructions.html#Constructor">Constructor</a>:<br> @@ -689,9 +690,9 @@ </dl> <hr> Methods defined here:<br> -<dl><dt><a name="Difference-__init__"><strong>__init__</strong></a>(self, rev<font color="#909090">=None</font>)</dt></dl> +<dl><dt><a name="Difference-__init__"><strong>__init__</strong></a>(self, rev<font color="#909090">=None</font>, layer<font color="#909090">=None</font>)</dt></dl> -<dl><dt><a name="Difference-apply"><strong>apply</strong></a>(self, rev<font color="#909090">=None</font>)</dt><dd><tt>Apply the differences first that are contained in this difference,<br> +<dl><dt><a name="Difference-apply"><strong>apply</strong></a>(self, rev<font color="#909090">=None</font>, layer<font color="#909090">=None</font>)</dt><dd><tt>Apply the differences first that are contained in this difference,<br> then apply this difference itself using the redefined method of the<br> specialized difference.</tt></dd></dl> @@ -719,19 +720,19 @@ </dl> <hr> Methods defined here:<br> -<dl><dt><a name="ElementConstructor-__init__"><strong>__init__</strong></a>(self, rev<font color="#909090">=None</font>)</dt></dl> +<dl><dt><a name="ElementConstructor-__init__"><strong>__init__</strong></a>(self, rev<font color="#909090">=None</font>, layer<font color="#909090">=None</font>)</dt></dl> -<dl><dt><a name="ElementConstructor-add"><strong>add</strong></a>(self, rev<font color="#909090">=None</font>, additionID<font color="#909090">=None</font>, position<font color="#909090">=None</font>)</dt><dd><tt>Add this constructor element to the model at the given position of self.<br> +<dl><dt><a name="ElementConstructor-add"><strong>add</strong></a>(self, rev<font color="#909090">=None</font>, layer<font color="#909090">=None</font>, additionID<font color="#909090">=None</font>, position<font color="#909090">=None</font>)</dt><dd><tt>Add this constructor element to the model at the given position of self.<br> Where position=1 puts the element to the first position and position=-1<br> is behind the last element. (According the MOF 2.0 /XMI 2.1.1 Mapping <br> Specification, Section "XMI encoding", this corresponds to XPointer <br> numbering.</tt></dd></dl> -<dl><dt><a name="ElementConstructor-deep_delete"><strong>deep_delete</strong></a>(self, rev<font color="#909090">=None</font>)</dt><dd><tt>Cascading delete this <a href="#Constructor">Constructor</a> from the model.</tt></dd></dl> +<dl><dt><a name="ElementConstructor-deep_delete"><strong>deep_delete</strong></a>(self, rev<font color="#909090">=None</font>, layer<font color="#909090">=None</font>)</dt><dd><tt>Cascading delete this <a href="#Constructor">Constructor</a> from the model.</tt></dd></dl> -<dl><dt><a name="ElementConstructor-delete"><strong>delete</strong></a>(self, rev<font color="#909090">=None</font>)</dt><dd><tt>Delete this <a href="#Constructor">Constructor</a> from the model.</tt></dd></dl> +<dl><dt><a name="ElementConstructor-delete"><strong>delete</strong></a>(self, rev<font color="#909090">=None</font>, layer<font color="#909090">=None</font>)</dt><dd><tt>Delete this <a href="#Constructor">Constructor</a> from the model.</tt></dd></dl> -<dl><dt><a name="ElementConstructor-replace"><strong>replace</strong></a>(self, rev<font color="#909090">=None</font>, replacementID<font color="#909090">=None</font>, position<font color="#909090">=None</font>)</dt><dd><tt>Replace the target's constructor in the model with this constructor<br> +<dl><dt><a name="ElementConstructor-replace"><strong>replace</strong></a>(self, rev<font color="#909090">=None</font>, layer<font color="#909090">=None</font>, replacementID<font color="#909090">=None</font>, position<font color="#909090">=None</font>)</dt><dd><tt>Replace the target's constructor in the model with this constructor<br> and add its containing.<br> <br> The new element's contained elements are appended at the first position. <br> @@ -765,21 +766,21 @@ </dl> <hr> Methods defined here:<br> -<dl><dt><a name="EnumerationConstructor-__init__"><strong>__init__</strong></a>(self, rev<font color="#909090">=None</font>)</dt></dl> +<dl><dt><a name="EnumerationConstructor-__init__"><strong>__init__</strong></a>(self, rev<font color="#909090">=None</font>, layer<font color="#909090">=None</font>)</dt></dl> <hr> Methods inherited from <a href="AeonicXME.constructions.html#ElementConstructor">ElementConstructor</a>:<br> -<dl><dt><a name="EnumerationConstructor-add"><strong>add</strong></a>(self, rev<font color="#909090">=None</font>, additionID<font color="#909090">=None</font>, position<font color="#909090">=None</font>)</dt><dd><tt>Add this constructor element to the model at the given position of self.<br> +<dl><dt><a name="EnumerationConstructor-add"><strong>add</strong></a>(self, rev<font color="#909090">=None</font>, layer<font color="#909090">=None</font>, additionID<font color="#909090">=None</font>, position<font color="#909090">=None</font>)</dt><dd><tt>Add this constructor element to the model at the given position of self.<br> Where position=1 puts the element to the first position and position=-1<br> is behind the last element. (According the MOF 2.0 /XMI 2.1.1 Mapping <br> Specification, Section "XMI encoding", this corresponds to XPointer <br> numbering.</tt></dd></dl> -<dl><dt><a name="EnumerationConstructor-deep_delete"><strong>deep_delete</strong></a>(self, rev<font color="#909090">=None</font>)</dt><dd><tt>Cascading delete this <a href="#Constructor">Constructor</a> from the model.</tt></dd></dl> +<dl><dt><a name="EnumerationConstructor-deep_delete"><strong>deep_delete</strong></a>(self, rev<font color="#909090">=None</font>, layer<font color="#909090">=None</font>)</dt><dd><tt>Cascading delete this <a href="#Constructor">Constructor</a> from the model.</tt></dd></dl> -<dl><dt><a name="EnumerationConstructor-delete"><strong>delete</strong></a>(self, rev<font color="#909090">=None</font>)</dt><dd><tt>Delete this <a href="#Constructor">Constructor</a> from the model.</tt></dd></dl> +<dl><dt><a name="EnumerationConstructor-delete"><strong>delete</strong></a>(self, rev<font color="#909090">=None</font>, layer<font color="#909090">=None</font>)</dt><dd><tt>Delete this <a href="#Constructor">Constructor</a> from the model.</tt></dd></dl> -<dl><dt><a name="EnumerationConstructor-replace"><strong>replace</strong></a>(self, rev<font color="#909090">=None</font>, replacementID<font color="#909090">=None</font>, position<font color="#909090">=None</font>)</dt><dd><tt>Replace the target's constructor in the model with this constructor<br> +<dl><dt><a name="EnumerationConstructor-replace"><strong>replace</strong></a>(self, rev<font color="#909090">=None</font>, layer<font color="#909090">=None</font>, replacementID<font color="#909090">=None</font>, position<font color="#909090">=None</font>)</dt><dd><tt>Replace the target's constructor in the model with this constructor<br> and add its containing.<br> <br> The new element's contained elements are appended at the first position. <br> @@ -815,21 +816,21 @@ </dl> <hr> Methods defined here:<br> -<dl><dt><a name="EnumerationLiteralConstructor-__init__"><strong>__init__</strong></a>(self, rev<font color="#909090">=None</font>)</dt></dl> +<dl><dt><a name="EnumerationLiteralConstructor-__init__"><strong>__init__</strong></a>(self, rev<font color="#909090">=None</font>, layer<font color="#909090">=None</font>)</dt></dl> <hr> Methods inherited from <a href="AeonicXME.constructions.html#ElementConstructor">ElementConstructor</a>:<br> -<dl><dt><a name="EnumerationLiteralConstructor-add"><strong>add</strong></a>(self, rev<font color="#909090">=None</font>, additionID<font color="#909090">=None</font>, position<font color="#909090">=None</font>)</dt><dd><tt>Add this constructor element to the model at the given position of self.<br> +<dl><dt><a name="EnumerationLiteralConstructor-add"><strong>add</strong></a>(self, rev<font color="#909090">=None</font>, layer<font color="#909090">=None</font>, additionID<font color="#909090">=None</font>, position<font color="#909090">=None</font>)</dt><dd><tt>Add this constructor element to the model at the given position of self.<br> Where position=1 puts the element to the first position and position=-1<br> is behind the last element. (According the MOF 2.0 /XMI 2.1.1 Mapping <br> Specification, Section "XMI encoding", this corresponds to XPointer <br> numbering.</tt></dd></dl> -<dl><dt><a name="EnumerationLiteralConstructor-deep_delete"><strong>deep_delete</strong></a>(self, rev<font color="#909090">=None</font>)</dt><dd><tt>Cascading delete this <a href="#Constructor">Constructor</a> from the model.</tt></dd></dl> +<dl><dt><a name="EnumerationLiteralConstructor-deep_delete"><strong>deep_delete</strong></a>(self, rev<font color="#909090">=None</font>, layer<font color="#909090">=None</font>)</dt><dd><tt>Cascading delete this <a href="#Constructor">Constructor</a> from the model.</tt></dd></dl> -<dl><dt><a name="EnumerationLiteralConstructor-delete"><strong>delete</strong></a>(self, rev<font color="#909090">=None</font>)</dt><dd><tt>Delete this <a href="#Constructor">Constructor</a> from the model.</tt></dd></dl> +<dl><dt><a name="EnumerationLiteralConstructor-delete"><strong>delete</strong></a>(self, rev<font color="#909090">=None</font>, layer<font color="#909090">=None</font>)</dt><dd><tt>Delete this <a href="#Constructor">Constructor</a> from the model.</tt></dd></dl> -<dl><dt><a name="EnumerationLiteralConstructor-replace"><strong>replace</strong></a>(self, rev<font color="#909090">=None</font>, replacementID<font color="#909090">=None</font>, position<font color="#909090">=None</font>)</dt><dd><tt>Replace the target's constructor in the model with this constructor<br> +<dl><dt><a name="EnumerationLiteralConstructor-replace"><strong>replace</strong></a>(self, rev<font color="#909090">=None</font>, layer<font color="#909090">=None</font>, replacementID<font color="#909090">=None</font>, position<font color="#909090">=None</font>)</dt><dd><tt>Replace the target's constructor in the model with this constructor<br> and add its containing.<br> <br> The new element's contained elements are appended at the first position. <br> @@ -865,21 +866,21 @@ </dl> <hr> Methods defined here:<br> -<dl><dt><a name="FeatureConstructor-__init__"><strong>__init__</strong></a>(self, rev<font color="#909090">=None</font>)</dt></dl> +<dl><dt><a name="FeatureConstructor-__init__"><strong>__init__</strong></a>(self, rev<font color="#909090">=None</font>, layer<font color="#909090">=None</font>)</dt></dl> <hr> Methods inherited from <a href="AeonicXME.constructions.html#ElementConstructor">ElementConstructor</a>:<br> -<dl><dt><a name="FeatureConstructor-add"><strong>add</strong></a>(self, rev<font color="#909090">=None</font>, additionID<font color="#909090">=None</font>, position<font color="#909090">=None</font>)</dt><dd><tt>Add this constructor element to the model at the given position of self.<br> +<dl><dt><a name="FeatureConstructor-add"><strong>add</strong></a>(self, rev<font color="#909090">=None</font>, layer<font color="#909090">=None</font>, additionID<font color="#909090">=None</font>, position<font color="#909090">=None</font>)</dt><dd><tt>Add this constructor element to the model at the given position of self.<br> Where position=1 puts the element to the first position and position=-1<br> is behind the last element. (According the MOF 2.0 /XMI 2.1.1 Mapping <br> Specification, Section "XMI encoding", this corresponds to XPointer <br> numbering.</tt></dd></dl> -<dl><dt><a name="FeatureConstructor-deep_delete"><strong>deep_delete</strong></a>(self, rev<font color="#909090">=None</font>)</dt><dd><tt>Cascading delete this <a href="#Constructor">Constructor</a> from the model.</tt></dd></dl> +<dl><dt><a name="FeatureConstructor-deep_delete"><strong>deep_delete</strong></a>(self, rev<font color="#909090">=None</font>, layer<font color="#909090">=None</font>)</dt><dd><tt>Cascading delete this <a href="#Constructor">Constructor</a> from the model.</tt></dd></dl> -<dl><dt><a name="FeatureConstructor-delete"><strong>delete</strong></a>(self, rev<font color="#909090">=None</font>)</dt><dd><tt>Delete this <a href="#Constructor">Constructor</a> from the model.</tt></dd></dl> +<dl><dt><a name="FeatureConstructor-delete"><strong>delete</strong></a>(self, rev<font color="#909090">=None</font>, layer<font color="#909090">=None</font>)</dt><dd><tt>Delete this <a href="#Constructor">Constructor</a> from the model.</tt></dd></dl> -<dl><dt><a name="FeatureConstructor-replace"><strong>replace</strong></a>(self, rev<font color="#909090">=None</font>, replacementID<font color="#909090">=None</font>, position<font color="#909090">=None</font>)</dt><dd><tt>Replace the target's constructor in the model with this constructor<br> +<dl><dt><a name="FeatureConstructor-replace"><strong>replace</strong></a>(self, rev<font color="#909090">=None</font>, layer<font color="#909090">=None</font>, replacementID<font color="#909090">=None</font>, position<font color="#909090">=None</font>)</dt><dd><tt>Replace the target's constructor in the model with this constructor<br> and add its containing.<br> <br> The new element's contained elements are appended at the first position. <br> @@ -897,6 +898,40 @@ <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> <tr bgcolor="#ffc8d8"> <td colspan=3 valign=bottom> <br> +<font color="#000000" face="helvetica, arial"><a name="Layer">class <strong>Layer</strong></a>(<a href="builtins.html#object">builtins.object</a>)</font></td></tr> + +<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> +<td colspan=2><tt>Abstract class to represent a layer in the engine, and specialized<br> +for the M3 <a href="#Layer">Layer</a> or M2 <a href="#Layer">Layer</a>.<br> </tt></td></tr> +<tr><td> </td> +<td width="100%">Methods defined here:<br> +<dl><dt><a name="Layer-__init__"><strong>__init__</strong></a>(self, name<font color="#909090">='unnamed'</font>)</dt></dl> + +<dl><dt><a name="Layer-export_as_textual_report"><strong>export_as_textual_report</strong></a>(self, rev<font color="#909090">=None</font>)</dt><dd><tt>Returns a string that contains the report of this layer in the<br> +revision, notation is based on the textual notation shown in the UML 2.3<br> +specifications.</tt></dd></dl> + +<dl><dt><a name="Layer-get_constructor_by_ID"><strong>get_constructor_by_ID</strong></a>(self, xmeID<font color="#909090">=None</font>)</dt><dd><tt>Returns any <a href="#ElementConstructor">ElementConstructor</a> instance by the given XME:ID.</tt></dd></dl> + +<dl><dt><a name="Layer-get_difference_by_ID"><strong>get_difference_by_ID</strong></a>(self, xmeID<font color="#909090">=None</font>)</dt><dd><tt>Returns any <a href="#Difference">Difference</a> instance by the given XME:ID.</tt></dd></dl> + +<dl><dt><a name="Layer-register_constructor"><strong>register_constructor</strong></a>(self, constructor<font color="#909090">=None</font>, xmeID<font color="#909090">=None</font>, xmiType<font color="#909090">=None</font>)</dt><dd><tt>Register a new instance of <a href="#ElementConstructor">ElementConstructor</a> or a subclass to this <br> +layer.</tt></dd></dl> + +<dl><dt><a name="Layer-register_difference"><strong>register_difference</strong></a>(self, diff<font color="#909090">=None</font>, xmeID<font color="#909090">=None</font>, xmiType<font color="#909090">=None</font>)</dt><dd><tt>Register a new instance of any <a href="#Difference">Difference</a> subclass to this layer.</tt></dd></dl> + +<hr> +Data descriptors defined here:<br> +<dl><dt><strong>__dict__</strong></dt> +<dd><tt>dictionary for instance variables (if defined)</tt></dd> +</dl> +<dl><dt><strong>__weakref__</strong></dt> +<dd><tt>list of weak references to the object (if defined)</tt></dd> +</dl> +</td></tr></table> <p> +<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> +<tr bgcolor="#ffc8d8"> +<td colspan=3 valign=bottom> <br> <font color="#000000" face="helvetica, arial"><a name="MultiplicityElementConstructor">class <strong>MultiplicityElementConstructor</strong></a>(<a href="AeonicXME.constructions.html#ElementConstructor">ElementConstructor</a>)</font></td></tr> <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> @@ -919,21 +954,21 @@ </dl> <hr> Methods defined here:<br> -<dl><dt><a name="MultiplicityElementConstructor-__init__"><strong>__init__</strong></a>(self, rev<font color="#909090">=None</font>)</dt></dl> +<dl><dt><a name="MultiplicityElementConstructor-__init__"><strong>__init__</strong></a>(self, rev<font color="#909090">=None</font>, layer<font color="#909090">=None</font>)</dt></dl> <hr> Methods inherited from <a href="AeonicXME.constructions.html#ElementConstructor">ElementConstructor</a>:<br> -<dl><dt><a name="MultiplicityElementConstructor-add"><strong>add</strong></a>(self, rev<font color="#909090">=None</font>, additionID<font color="#909090">=None</font>, position<font color="#909090">=None</font>)</dt><dd><tt>Add this constructor element to the model at the given position of self.<br> +<dl><dt><a name="MultiplicityElementConstructor-add"><strong>add</strong></a>(self, rev<font color="#909090">=None</font>, layer<font color="#909090">=None</font>, additionID<font color="#909090">=None</font>, position<font color="#909090">=None</font>)</dt><dd><tt>Add this constructor element to the model at the given position of self.<br> Where position=1 puts the element to the first position and position=-1<br> is behind the last element. (According the MOF 2.0 /XMI 2.1.1 Mapping <br> Specification, Section "XMI encoding", this corresponds to XPointer <br> numbering.</tt></dd></dl> -<dl><dt><a name="MultiplicityElementConstructor-deep_delete"><strong>deep_delete</strong></a>(self, rev<font color="#909090">=None</font>)</dt><dd><tt>Cascading delete this <a href="#Constructor">Constructor</a> from the model.</tt></dd></dl> +<dl><dt><a name="MultiplicityElementConstructor-deep_delete"><strong>deep_delete</strong></a>(self, rev<font color="#909090">=None</font>, layer<font color="#909090">=None</font>)</dt><dd><tt>Cascading delete this <a href="#Constructor">Constructor</a> from the model.</tt></dd></dl> -<dl><dt><a name="MultiplicityElementConstructor-delete"><strong>delete</strong></a>(self, rev<font color="#909090">=None</font>)</dt><dd><tt>Delete this <a href="#Constructor">Constructor</a> from the model.</tt></dd></dl> +<dl><dt><a name="MultiplicityElementConstructor-delete"><strong>delete</strong></a>(self, rev<font color="#909090">=None</font>, layer<font color="#909090">=None</font>)</dt><dd><tt>Delete this <a href="#Constructor">Constructor</a> from the model.</tt></dd></dl> -<dl><dt><a name="MultiplicityElementConstructor-replace"><strong>replace</strong></a>(self, rev<font color="#909090">=None</font>, replacementID<font color="#909090">=None</font>, position<font color="#909090">=None</font>)</dt><dd><tt>Replace the target's constructor in the model with this constructor<br> +<dl><dt><a name="MultiplicityElementConstructor-replace"><strong>replace</strong></a>(self, rev<font color="#909090">=None</font>, layer<font color="#909090">=None</font>, replacementID<font color="#909090">=None</font>, position<font color="#909090">=None</font>)</dt><dd><tt>Replace the target's constructor in the model with this constructor<br> and add its containing.<br> <br> The new element's contained elements are appended at the first position. <br> @@ -971,21 +1006,21 @@ </dl> <hr> Methods defined here:<br> -<dl><dt><a name="NamedElementConstructor-__init__"><strong>__init__</strong></a>(self, rev<font color="#909090">=None</font>)</dt></dl> +<dl><dt><a name="NamedElementConstructor-__init__"><strong>__init__</strong></a>(self, rev<font color="#909090">=None</font>, layer<font color="#909090">=None</font>)</dt></dl> <hr> Methods inherited from <a href="AeonicXME.constructions.html#ElementConstructor">ElementConstructor</a>:<br> -<dl><dt><a name="NamedElementConstructor-add"><strong>add</strong></a>(self, rev<font color="#909090">=None</font>, additionID<font color="#909090">=None</font>, position<font color="#909090">=None</font>)</dt><dd><tt>Add this constructor element to the model at the given position of self.<br> +<dl><dt><a name="NamedElementConstructor-add"><strong>add</strong></a>(self, rev<font color="#909090">=None</font>, layer<font color="#909090">=None</font>, additionID<font color="#909090">=None</font>, position<font color="#909090">=None</font>)</dt><dd><tt>Add this constructor element to the model at the given position of self.<br> Where position=1 puts the element to the first position and position=-1<br> is behind the last element. (According the MOF 2.0 /XMI 2.1.1 Mapping <br> Specification, Section "XMI encoding", this corresponds to XPointer <br> numbering.</tt></dd></dl> -<dl><dt><a name="NamedElementConstructor-deep_delete"><strong>deep_delete</strong></a>(self, rev<font color="#909090">=None</font>)</dt><dd><tt>Cascading delete this <a href="#Constructor">Constructor</a> from the model.</tt></dd></dl> +<dl><dt><a name="NamedElementConstructor-deep_delete"><strong>deep_delete</strong></a>(self, rev<font color="#909090">=None</font>, layer<font color="#909090">=None</font>)</dt><dd><tt>Cascading delete this <a href="#Constructor">Constructor</a> from the model.</tt></dd></dl> -<dl><dt><a name="NamedElementConstructor-delete"><strong>delete</strong></a>(self, rev<font color="#909090">=None</font>)</dt><dd><tt>Delete this <a href="#Constructor">Constructor</a> from the model.</tt></dd></dl> +<dl><dt><a name="NamedElementConstructor-delete"><strong>delete</strong></a>(self, rev<font color="#909090">=None</font>, layer<font color="#909090">=None</font>)</dt><dd><tt>Delete this <a href="#Constructor">Constructor</a> from the model.</tt></dd></dl> -<dl><dt><a name="NamedElementConstructor-replace"><strong>replace</strong></a>(self, rev<font color="#909090">=None</font>, replacementID<font color="#909090">=None</font>, position<font color="#909090">=None</font>)</dt><dd><tt>Replace the target's constructor in the model with this constructor<br> +<dl><dt><a name="NamedElementConstructor-replace"><strong>replace</strong></a>(self, rev<font color="#909090">=None</font>, layer<font color="#909090">=None</font>, replacementID<font color="#909090">=None</font>, position<font color="#909090">=None</font>)</dt><dd><tt>Replace the target's constructor in the model with this constructor<br> and add its containing.<br> <br> The new element's contained elements are appended at the first position. <br> @@ -1017,21 +1052,21 @@ </dl> <hr> Methods defined here:<br> -<dl><dt><a name="NamespaceConstructor-__init__"><strong>__init__</strong></a>(self, rev<font color="#909090">=None</font>)</dt></dl> +<dl><dt><a name="NamespaceConstructor-__init__"><strong>__init__</strong></a>(self, rev<font color="#909090">=None</font>, layer<font color="#909090">=None</font>)</dt></dl> <hr> Methods inherited from <a href="AeonicXME.constructions.html#ElementConstructor">ElementConstructor</a>:<br> -<dl><dt><a name="NamespaceConstructor-add"><strong>add</strong></a>(self, rev<font color="#909090">=None</font>, additionID<font color="#909090">=None</font>, position<font color="#909090">=None</font>)</dt><dd><tt>Add this constructor element to the model at the given position of self.<br> +<dl><dt><a name="NamespaceConstructor-add"><strong>add</strong></a>(self, rev<font color="#909090">=None</font>, layer<font color="#909090">=None</font>, additionID<font color="#909090">=None</font>, position<font color="#909090">=None</font>)</dt><dd><tt>Add this constructor element to the model at the given position of self.<br> Where position=1 puts the element to the first position and position=-1<br> is behind the last element. (According the MOF 2.0 /XMI 2.1.1 Mapping <br> Specification, Section "XMI encoding", this corresponds to XPointer <br> numbering.</tt></dd></dl> -<dl><dt><a name="NamespaceConstructor-deep_delete"><strong>deep_delete</strong></a>(self, rev<font color="#909090">=None</font>)</dt><dd><tt>Cascading delete this <a href="#Constructor">Constructor</a> from the model.</tt></dd></dl> +<dl><dt><a name="NamespaceConstructor-deep_delete"><strong>deep_delete</strong></a>(self, rev<font color="#909090">=None</font>, layer<font color="#909090">=None</font>)</dt><dd><tt>Cascading delete this <a href="#Constructor">Constructor</a> from the model.</tt></dd></dl> -<dl><dt><a name="NamespaceConstructor-delete"><strong>delete</strong></a>(self, rev<font color="#909090">=None</font>)</dt><dd><tt>Delete this <a href="#Constructor">Constructor</a> from the model.</tt></dd></dl> +<dl><dt><a name="NamespaceConstructor-delete"><strong>delete</strong></a>(self, rev<font color="#909090">=None</font>, layer<font color="#909090">=None</font>)</dt><dd><tt>Delete this <a href="#Constructor">Constructor</a> from the model.</tt></dd></dl> -<dl><dt><a name="NamespaceConstructor-replace"><strong>replace</strong></a>(self, rev<font color="#909090">=None</font>, replacementID<font color="#909090">=None</font>, position<font color="#909090">=None</font>)</dt><dd><tt>Replace the target's constructor in the model with this constructor<br> +<dl><dt><a name="NamespaceConstructor-replace"><strong>replace</strong></a>(self, rev<font color="#909090">=None</font>, layer<font color="#909090">=None</font>, replacementID<font color="#909090">=None</font>, position<font color="#909090">=None</font>)</dt><dd><tt>Replace the target's constructor in the model with this constructor<br> and add its containing.<br> <br> The new element's contained elements are appended at the first position. <br> @@ -1072,26 +1107,26 @@ </dl> <hr> Methods defined here:<br> -<dl><dt><a name="OpaqueExpressionConstructor-__init__"><strong>__init__</strong></a>(self, rev<font color="#909090">=None</font>)</dt></dl> +<dl><dt><a name="OpaqueExpressionConstructor-__init__"><strong>__init__</strong></a>(self, rev<font color="#909090">=None</font>, layer<font color="#909090">=None</font>)</dt></dl> -<dl><dt><a name="OpaqueExpressionConstructor-const... [truncated message content] |
From: <ah...@us...> - 2012-01-19 10:20:30
|
Revision: 1279 http://aeonic.svn.sourceforge.net/aeonic/?rev=1279&view=rev Author: ahatzis Date: 2012-01-19 10:20:19 +0000 (Thu, 19 Jan 2012) Log Message: ----------- implementing #73: * changed python path to methods that implement the bodyCondition of an operation in M2 * added parameters to signatures of methods that implement the bodyCondition of an operation in M2 * added test for method parameters * fixed test-names in `tests/testM3_generateM2.py` * supported language of opaque-expressions in M2 models changed from `Python 3.2` to `Python3.2` Modified Paths: -------------- branches/73/src/AeonicXME/specs/m3/code/Class/_construct.py branches/73/src/AeonicXME/specs/m3/code/Operation/_construct.py branches/73/src/AeonicXME/testdata/testM3_generateM2.cmof branches/73/src/AeonicXME/testdata/testpatchM2.cmof branches/73/src/AeonicXME/tests/testM3_generateM2.py Modified: branches/73/src/AeonicXME/specs/m3/code/Class/_construct.py =================================================================== --- branches/73/src/AeonicXME/specs/m3/code/Class/_construct.py 2012-01-12 16:45:41 UTC (rev 1278) +++ branches/73/src/AeonicXME/specs/m3/code/Class/_construct.py 2012-01-19 10:20:19 UTC (rev 1279) @@ -34,7 +34,7 @@ o = layer.get_constructor_by_ID(xmeID=cref) operations += o._construct(rev=rev, layer=layer, indent=indent+1) if o.bodyCondition.get(): - operalias += "\n" + ((indent+1) * "\t") + o.name.get() + " = " + o.xmeID.get() + operalias += "\n" + ((indent+1) * "\t") + o.name.get() + " = " + o.xmeID.get() + ".__call__" if operalias: operalias = "\n# operation aliases:" + operalias Modified: branches/73/src/AeonicXME/specs/m3/code/Operation/_construct.py =================================================================== --- branches/73/src/AeonicXME/specs/m3/code/Operation/_construct.py 2012-01-12 16:45:41 UTC (rev 1278) +++ branches/73/src/AeonicXME/specs/m3/code/Operation/_construct.py 2012-01-19 10:20:19 UTC (rev 1279) @@ -14,9 +14,16 @@ # Construct parameters owned by the UML metaclass parameters = "" +sigparams = ["self"] for cref in self.ownedParameter: p = layer.get_constructor_by_ID(xmeID=cref) parameters += p._construct(rev=rev, layer=layer, indent=indent+1) + if p.direction.get() in [rev.xmiID_to_xmeID(xmiID="in"), rev.xmiID_to_xmeID(xmiID="inout")] and p.name.get(): + if p.upper.get() > 1: + param = p.name.get() + " = []" + else: + param = p.name.get() + " = None" + sigparams.append(param) # Construct constraints owned by the UML metaclass constraints = "" @@ -24,9 +31,17 @@ c = layer.get_constructor_by_ID(xmeID=cref) constraints += c._construct(rev=rev, layer=layer, indent=indent+1) -# Construct bodyCondition: +# Construct bodyCondition as Python method: if self.bodyCondition: - body = """\n\n\t\tdef __call__(self): return True""" + bodyConstructor = layer.get_constructor_by_ID(self.bodyCondition.get()) + specConstructor = layer.get_constructor_by_ID(bodyConstructor.specification.get()) + body = """\n\n\t\tdef __call__(""" + ", ".join(sigparams) + """): + """ + lines = [] + for line in specConstructor.body[0].split('\n'): + lines.append(((indent+1) * "\t") + line) + body += "\n".join(lines) + source = tplClass % { "classdeco" : classdeco, "classname" : classname, "classbase" : classbase, "classdoc" : classdoc, "metaprops" : self._src_metaprops(rev=rev, layer=layer, indent=indent+1), "parameters" : parameters, "constraints" : constraints, "body" : body } Operation._log.debug(source) Modified: branches/73/src/AeonicXME/testdata/testM3_generateM2.cmof =================================================================== --- branches/73/src/AeonicXME/testdata/testM3_generateM2.cmof 2012-01-12 16:45:41 UTC (rev 1278) +++ branches/73/src/AeonicXME/testdata/testM3_generateM2.cmof 2012-01-19 10:20:19 UTC (rev 1279) @@ -15,26 +15,26 @@ <!-- Test Constraint on the member --> <ownedRule xmi:type="cmof:Constraint" xmi:id="SP1-C1-test_constraint" name="test_constraint" constrainedElement="SP1-C1" namespace="SP1-C1"> <specification xmi:type="cmof:OpaqueExpression" xmi:id="SP1-C1-test_constraint-_spec"> - <language>Python 3.2</language> + <language>Python3.2</language> <body>return not self.constraint_fail</body> </specification> </ownedRule> <ownedOperation xmi:type="cmof:Operation" xmi:id="SP1-C1-failing_condition" name="failing_condition" class="SP1-C1" isQuery="true" bodyCondition="SP1-C1-failing_condition-python" precondition="SP1-C1-failing_condition-python-pre" postcondition="SP1-C1-failing_condition-python-post"> <ownedRule xmi:type="cmof:Constraint" xmi:id="SP1-C1-failing_condition-python" name="python" constrainedElement="SP1-C1-failing_condition" namespace="SP1-C1-failing_condition"> <specification xmi:type="cmof:OpaqueExpression" xmi:id="SP1-C1-failing_condition-python-_spec"> - <language>Python 3.2</language> + <language>Python3.2</language> <body>return True</body> </specification> </ownedRule> <ownedRule xmi:type="cmof:Constraint" xmi:id="SP1-C1-failing_condition-python-pre" name="python" constrainedElement="SP1-C1-failing_condition" namespace="SP1-C1-failing_condition"> <specification xmi:type="cmof:OpaqueExpression" xmi:id="SP1-C1-failing_condition-python-pre-_spec"> - <language>Python 3.2</language> + <language>Python3.2</language> <body>return self['pre']</body> </specification> </ownedRule> <ownedRule xmi:type="cmof:Constraint" xmi:id="SP1-C1-failing_condition-python-post" name="python" constrainedElement="SP1-C1-failing_condition" namespace="SP1-C1-failing_condition"> <specification xmi:type="cmof:OpaqueExpression" xmi:id="SP1-C1-failing_condition-python-post-_spec"> - <language>Python 3.2</language> + <language>Python3.2</language> <body>return self['post']</body> </specification> </ownedRule> @@ -47,15 +47,14 @@ </ownedComment> <ownedRule xmi:type="cmof:Constraint" xmi:id="SP1-C1-Test-param_tests-python" name="python" constrainedElement="SP1-C1-Test-param_tests" namespace="SP1-C1-Test-param_tests"> <specification xmi:type="cmof:OpaqueExpression" xmi:id="SP1-C1-Test-param_tests-python-_spec"> - <language>Python 3.2</language> - <body>return kwargs.get('x') or (args[0] if args else b or a)</body> + <language>Python3.2</language> + <body>return b or (c[0] if len(c)>0 else a)</body> </specification> </ownedRule> <ownedParameter xmi:type="cmof:Parameter" xmi:id="SP1-C1-Test-param_tests.0" type="Integer" upper="1" lower="1" direction="return"/> <ownedParameter xmi:type="cmof:Parameter" xmi:id="SP1-C1-Test-param_tests.a" name="a" type="Integer"/> - <ownedParameter xmi:type="cmof:Parameter" xmi:id="SP1-C1-Test-param_tests.b" name="b" type="Integer" upper="1" lower="0" default="0"/> - <ownedParameter xmi:type="cmof:Parameter" xmi:id="SP1-C1-Test-param_tests.args" name="args" type="args" upper="*" lower="0"/> - <ownedParameter xmi:type="cmof:Parameter" xmi:id="SP1-C1-Test-param_tests.kwargs" name="kwargs" type="kwargs" upper="*" lower="0"/> + <ownedParameter xmi:type="cmof:Parameter" xmi:id="SP1-C1-Test-param_tests.b" name="b" type="Integer" lower="0"/> + <ownedParameter xmi:type="cmof:Parameter" xmi:id="SP1-C1-Test-param_tests.c" name="c" type="Integer" upper="*" lower="0"/> </ownedOperation> <ownedAttribute xmi:type="cmof:Property" xmi:id="SP1-C1-Prop1" name="PropertySP1C1Prop1" type="SP1-C2"> @@ -73,7 +72,7 @@ <body>Comment of SP1-C2-_ownedRule.0</body> </ownedComment> <specification xmi:type="cmof:OpaqueExpression" xmi:id="SP1-C2-_ownedRule.0-_spec"> - <language>Python 3.2</language> + <language>Python3.2</language> <body>return True</body> </specification> </ownedRule> @@ -92,7 +91,7 @@ <body>Comment of SP1-C3-_ownedRule.0</body> </ownedComment> <specification xmi:type="cmof:OpaqueExpression" xmi:id="SP1-C3-_ownedRule.0-_spec"> - <language>Python 3.2</language> + <language>Python3.2</language> <body>return True</body> </specification> </ownedRule> @@ -113,7 +112,7 @@ <body>Comment of SP2-C1-_ownedRule.0</body> </ownedComment> <specification xmi:type="cmof:OpaqueExpression" xmi:id="SP2-C1-_ownedRule.0-_spec"> - <language>Python 3.2</language> + <language>Python3.2</language> <body>return True</body> </specification> </ownedRule> @@ -132,7 +131,7 @@ <body>Comment of SP2-C2-_ownedRule.0</body> </ownedComment> <specification xmi:type="cmof:OpaqueExpression" xmi:id="SP2-C2-_ownedRule.0-_spec"> - <language>Python 3.2</language> + <language>Python3.2</language> <body>return True</body> </specification> </ownedRule> @@ -155,7 +154,7 @@ <body>Comment of SP3-C1-_ownedRule.0</body> </ownedComment> <specification xmi:type="cmof:OpaqueExpression" xmi:id="SP3-C1-_ownedRule.0-_spec"> - <language>Python 3.2</language> + <language>Python3.2</language> <body>return True</body> </specification> </ownedRule> @@ -174,7 +173,7 @@ <body>Comment of SP3-C2-_ownedRule.0</body> </ownedComment> <specification xmi:type="cmof:OpaqueExpression" xmi:id="SP3-C2-_ownedRule.0-_spec"> - <language>Python 3.2</language> + <language>Python3.2</language> <body>return True</body> </specification> </ownedRule> @@ -195,7 +194,7 @@ <body>Comment of SP4-C1-_ownedRule.0</body> </ownedComment> <specification xmi:type="cmof:OpaqueExpression" xmi:id="SP4-C1-_ownedRule.0-_spec"> - <language>Python 3.2</language> + <language>Python3.2</language> <body>return True</body> </specification> </ownedRule> @@ -214,7 +213,7 @@ <body>Comment of SP4-C2-_ownedRule.0</body> </ownedComment> <specification xmi:type="cmof:OpaqueExpression" xmi:id="SP4-C2-_ownedRule.0-_spec"> - <language>Python 3.2</language> + <language>Python3.2</language> <body>return True</body> </specification> </ownedRule> Modified: branches/73/src/AeonicXME/testdata/testpatchM2.cmof =================================================================== --- branches/73/src/AeonicXME/testdata/testpatchM2.cmof 2012-01-12 16:45:41 UTC (rev 1278) +++ branches/73/src/AeonicXME/testdata/testpatchM2.cmof 2012-01-19 10:20:19 UTC (rev 1279) @@ -21,7 +21,7 @@ <body>This is a test constraint</body> </ownedComment> <specification xmi:type="cmof:OpaqueExpression" xmi:id="Classes-Kernel-Test-foo-_python"> - <language>Python 3.2</language> + <language>Python3.2</language> <body>return True</body> </specification> </ownedRule> @@ -32,7 +32,7 @@ </ownedComment> <ownedRule xmi:type="cmof:Constraint" xmi:id="Classes-Kernel-Test-param_tests-python" name="python" constrainedElement="Classes-Kernel-Test-param_tests" namespace="Classes-Kernel-Test-param_tests"> <specification xmi:type="cmof:OpaqueExpression" xmi:id="Classes-Kernel-Test-param_tests-python-_specification"> - <language>Python 3.2</language> + <language>Python3.2</language> <body>return kwargs.get('x') or (args[0] if args else b or a)</body> </specification> </ownedRule> @@ -46,19 +46,19 @@ <ownedOperation xmi:type="cmof:Operation" xmi:id="Classes-Kernel-Test-failing_condition" name="failing_condition" class="Classes-Kernel-Test" isQuery="true" bodyCondition="Classes-Kernel-Test-failing_condition-python" precondition="Classes-Kernel-Test-failing_condition-python-pre" postcondition="Classes-Kernel-Test-failing_condition-python-post"> <ownedRule xmi:type="cmof:Constraint" xmi:id="Classes-Kernel-Test-failing_condition-python" name="python" constrainedElement="Classes-Kernel-Test-failing_condition" namespace="Classes-Kernel-Test-failing_condition"> <specification xmi:type="cmof:OpaqueExpression" xmi:id="Classes-Kernel-Test-failing_condition-python-_specification"> - <language>Python 3.2</language> + <language>Python3.2</language> <body>return True</body> </specification> </ownedRule> <ownedRule xmi:type="cmof:Constraint" xmi:id="Classes-Kernel-Test-failing_condition-python-pre" name="python" constrainedElement="Classes-Kernel-Test-failing_condition" namespace="Classes-Kernel-Test-failing_condition"> <specification xmi:type="cmof:OpaqueExpression" xmi:id="Classes-Kernel-Test-failing_condition-python-pre-_specification"> - <language>Python 3.2</language> + <language>Python3.2</language> <body>return self['pre']</body> </specification> </ownedRule> <ownedRule xmi:type="cmof:Constraint" xmi:id="Classes-Kernel-Test-failing_condition-python-post" name="python" constrainedElement="Classes-Kernel-Test-failing_condition" namespace="Classes-Kernel-Test-failing_condition"> <specification xmi:type="cmof:OpaqueExpression" xmi:id="Classes-Kernel-Test-failing_condition-python-post-_specification"> - <language>Python 3.2</language> + <language>Python3.2</language> <body>return self['post']</body> </specification> </ownedRule> @@ -68,7 +68,7 @@ <ownedRule xmi:type="cmof:Constraint" xmi:id="Classes-Kernel-Test-test_constraint" name="test_constraint" constrainedElement="Classes-Kernel-Test" namespace="Classes-Kernel-Test"> <specification xmi:type="cmof:OpaqueExpression" xmi:id="Core-Constructs-Test-test_constraint-_specification"> - <language>Python 3.2</language> + <language>Python3.2</language> <body>return not self.constraint_fail</body> </specification> </ownedRule> Modified: branches/73/src/AeonicXME/tests/testM3_generateM2.py =================================================================== --- branches/73/src/AeonicXME/tests/testM3_generateM2.py 2012-01-12 16:45:41 UTC (rev 1278) +++ branches/73/src/AeonicXME/tests/testM3_generateM2.py 2012-01-19 10:20:19 UTC (rev 1279) @@ -83,7 +83,7 @@ from XME.M3.Core import PrimitiveTypes -class Test_M3Classes(unittest.TestCase): +class Test_M2Classes(unittest.TestCase): """M3 produces classes in M2 correctly.""" @classmethod def setUpClass(cls): @@ -115,8 +115,55 @@ from TestApp.M2.Unit.OtherPackage.SubPackage4 import ClassSP4C1 from TestApp.M2.Unit.OtherPackage.SubPackage4 import ClassSP4C2 +# TODO: include tests if pre- and post-condition features are implemented for M2 layer +#class Test_M2Constraints(unittest.TestCase): +# """M3 produces constraints in M2 correctly.""" +# +# @classmethod +# def setUpClass(cls): +# cls.rev = constructions.construct_revision(m3PatchID="XME-M3_patch", m2URI="testdata/testM3_generateM2.cmof", m2ID="_0") +# cls.exampleMCL = cls.rev.m2.mclass[cls.rev.xmiID_to_xmeID(xmiID="SP1-C1")] +# +# @classmethod +# def tearDownClass(cls): +# cls.rev = None +# cls.exampleMCL = None +# +# def test_M2_pre_fails(self): +# from AeonicXME.utils import errors +# M = self.exampleMCL.failing_condition +# +# self.assertRaises(errors.ConstraintViolated, M, {'pre': False}) +# +# def test_M2_post_fails(self): +# from AeonicXME.utils import errors +# M = self.exampleMCL.failing_condition +# +# self.assertRaises(errors.ConstraintViolated, M, {'pre': True, 'post': False}) +# +# def test_M2_conditions_pass(self): +# from AeonicXME.utils import errors +# M = self.exampleMCL.failing_condition +# +# M({'pre': True, 'post': True}) +# +# def test_M2_class_constraint(self): +# from AeonicXME.utils import errors +# C = self.exampleMCL +# M = C.failing_condition +# +# C.constraint_fail = True +# self.assertRaises(errors.ConstraintViolated, C) +# +# def test_M2_import_class(self): +# from AeonicXME.utils import errors +# from TestApp.M3.Unit.Package.SubPackage1 import ClassSP1C1 +# +# def test_M2_import_module(self): +# from TestApp.M3.Unit.Package import SubPackage1 -class Test_M3Operations(unittest.TestCase): + +class Test_M2Operations(unittest.TestCase): """M3 produces operations in M2 correctly.""" @classmethod @@ -129,23 +176,35 @@ cls.rev = None cls.exampleMCL = None - def test_M3_operation_member_accessible_pythonname(self): + def test_M2_operation_member_accessible_pythonname(self): """Operation in M2 can be accessed as member using its Python name""" self.assertTrue(hasattr(self.exampleMCL, self.rev.xmiID_to_xmeID("SP1-C1-Test-param_tests"))) - def test_M3_operation_member_accessible_alias(self): + def test_M2_operation_member_accessible_alias(self): """Operation in M2 can be accessed as member using its UML name as alias""" self.assertTrue(hasattr(self.exampleMCL, "param_tests")) - def test_M3_operation_member_callable_pythonname(self): + def test_M2_operation_member_callable_pythonname(self): """Operation in M2 can be called using its Python path""" - self.assertTrue(self.exampleMCL.SP1_C1_Test_param_tests_rev1(self.exampleMCL)) + self.assertEqual(None, self.exampleMCL.SP1_C1_Test_param_tests_rev1.__call__(self.exampleMCL)) - def test_M3_operation_member_callable_alias(self): - """Operation in M2 can be called using is UML name as alias""" - self.assertTrue(self.exampleMCL.param_tests(self.exampleMCL)) + def test_M2_operation_member_callable_alias(self): + """Operation in M2 can be called using its UML name as alias""" + self.assertEqual(None, self.exampleMCL.param_tests(self.exampleMCL)) +# TODO: include test when ticket #54 is implemented +# def test_M2_foo_method_docstring(self): +# self.assertEqual("This is a test method.", self.exampleMCL.param_tests.__doc__) + def test_M2_method_parameters(self): + """Operation in M2 can have parameters with no value, single value, or multiple values.""" + testMethod = self.exampleMCL.param_tests + self.assertEqual(1, testMethod(self.exampleMCL, a=1)) + self.assertEqual(2, testMethod(self.exampleMCL, a=1, b=2)) + self.assertEqual(2, testMethod(self.exampleMCL, a=1, b=2, c=[4])) + self.assertEqual(4, testMethod(self.exampleMCL, a=1, c=[4])) + + class TestPatchableM2_Ticket39(unittest.TestCase): """Test case for testing features of ticket #39 """ @classmethod This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ah...@us...> - 2012-01-12 16:45:47
|
Revision: 1278 http://aeonic.svn.sourceforge.net/aeonic/?rev=1278&view=rev Author: ahatzis Date: 2012-01-12 16:45:41 +0000 (Thu, 12 Jan 2012) Log Message: ----------- fixed bug, where unlimited naturals were implemented as `"float('inf')"` string rather than `float('inf')` Modified Paths: -------------- branches/73/src/AeonicXME/specs/m3/code/Element/_specify.py Modified: branches/73/src/AeonicXME/specs/m3/code/Element/_specify.py =================================================================== --- branches/73/src/AeonicXME/specs/m3/code/Element/_specify.py 2012-01-12 15:05:58 UTC (rev 1277) +++ branches/73/src/AeonicXME/specs/m3/code/Element/_specify.py 2012-01-12 16:45:41 UTC (rev 1278) @@ -217,7 +217,7 @@ cvalue = int(value) elif typeID == idUnlimited: if value == "*": - cvalue = 'float("inf")' # TODO: replace by 'UnlimitedNatural()' when primtiive-types are in namespace + cvalue = float("inf") # TODO: replace by 'UnlimitedNatural()' when primtiive-types are in namespace else: cvalue = int(value) elif typeID == idString: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ah...@us...> - 2012-01-12 15:06:08
|
Revision: 1277 http://aeonic.svn.sourceforge.net/aeonic/?rev=1277&view=rev Author: ahatzis Date: 2012-01-12 15:05:58 +0000 (Thu, 12 Jan 2012) Log Message: ----------- Implementing #73, operations now can be accessed and called/executed by either Python path or UML name. However, parameters and constraints (especially body-conditions) are not supported yet when operation is called/executed. Added new test-case for operations in M2. Modified Paths: -------------- branches/73/src/AeonicXME/specs/m3/code/Class/_construct.py branches/73/src/AeonicXME/specs/m3/code/Operation/_construct.py branches/73/src/AeonicXME/tests/testM3_generateM2.py Modified: branches/73/src/AeonicXME/specs/m3/code/Class/_construct.py =================================================================== --- branches/73/src/AeonicXME/specs/m3/code/Class/_construct.py 2012-01-12 14:57:54 UTC (rev 1276) +++ branches/73/src/AeonicXME/specs/m3/code/Class/_construct.py 2012-01-12 15:05:58 UTC (rev 1277) @@ -3,7 +3,7 @@ classname = self.xmeID.get() Class._log.debug(_("Compiling Class instance with XME:ID = {0!s}".format(classname))) classdeco = "MofClass._new" -tplClass = """\n\n\n@%(classdeco)s\nclass %(classname)s(%(classbase)s):\n%(classdoc)s\n\tfrom XME.M3.Core.Constructs import Property as MofProperty\n\tfrom XME.M3.Core.Constructs import Operation as MofOperation\n%(metaprops)s%(attributes)s%(operations)s""" +tplClass = """\n\n\n@%(classdeco)s\nclass %(classname)s(%(classbase)s):\n%(classdoc)s\n\tfrom XME.M3.Core.Constructs import Property as MofProperty\n\tfrom XME.M3.Core.Constructs import Operation as MofOperation\n%(metaprops)s%(attributes)s%(operations)s%(operalias)s""" parents = [] #if xmi.has_attribute("superClass"): # TODO: eventually this one can be done by MofClass._new decorating the UML meta-class @@ -29,11 +29,16 @@ # # Construct operations that are owned by the the UML metaclass operations = "" +operalias = "" for cref in self.ownedOperation: o = layer.get_constructor_by_ID(xmeID=cref) operations += o._construct(rev=rev, layer=layer, indent=indent+1) + if o.bodyCondition.get(): + operalias += "\n" + ((indent+1) * "\t") + o.name.get() + " = " + o.xmeID.get() +if operalias: + operalias = "\n# operation aliases:" + operalias -source = tplClass % { "classdeco" : classdeco, "classname" : classname, "classbase" : classbase, "classdoc" : classdoc, "metaprops" : self._src_metaprops(rev=rev, layer=layer, indent=indent+1), "attributes" : attributes, "operations" : operations } +source = tplClass % { "classdeco" : classdeco, "classname" : classname, "classbase" : classbase, "classdoc" : classdoc, "metaprops" : self._src_metaprops(rev=rev, layer=layer, indent=indent+1), "attributes" : attributes, "operations" : operations, "operalias" : operalias } Class._log.debug(source) Modified: branches/73/src/AeonicXME/specs/m3/code/Operation/_construct.py =================================================================== --- branches/73/src/AeonicXME/specs/m3/code/Operation/_construct.py 2012-01-12 14:57:54 UTC (rev 1276) +++ branches/73/src/AeonicXME/specs/m3/code/Operation/_construct.py 2012-01-12 15:05:58 UTC (rev 1277) @@ -3,7 +3,7 @@ classname = self.xmeID.get() Operation._log.debug(_("Compiling Operation instance with XME:ID = {0!s}".format(classname))) classdeco = "MofOperation._new" -tplClass = """\n\n\n\t@%(classdeco)s\n\tclass %(classname)s(%(classbase)s):\n\t\t%(classdoc)s\n\t\tfrom XME.M3.Core.Constructs import Parameter as MofParameter\n\t\tfrom XME.M3.Core.Constructs import Constraint as MofConstraint\n%(metaprops)s%(parameters)s%(constraints)s""" +tplClass = """\n\n\n\t@%(classdeco)s\n\tclass %(classname)s(%(classbase)s):\n\t\t%(classdoc)s\n\t\tfrom XME.M3.Core.Constructs import Parameter as MofParameter\n\t\tfrom XME.M3.Core.Constructs import Constraint as MofConstraint\n%(metaprops)s\n%(body)s%(parameters)s%(constraints)s""" # No generalizations between operations classbase = "type" @@ -24,7 +24,10 @@ c = layer.get_constructor_by_ID(xmeID=cref) constraints += c._construct(rev=rev, layer=layer, indent=indent+1) -source = tplClass % { "classdeco" : classdeco, "classname" : classname, "classbase" : classbase, "classdoc" : classdoc, "metaprops" : self._src_metaprops(rev=rev, layer=layer, indent=indent+1), "parameters" : parameters, "constraints" : constraints } +# Construct bodyCondition: +if self.bodyCondition: + body = """\n\n\t\tdef __call__(self): return True""" +source = tplClass % { "classdeco" : classdeco, "classname" : classname, "classbase" : classbase, "classdoc" : classdoc, "metaprops" : self._src_metaprops(rev=rev, layer=layer, indent=indent+1), "parameters" : parameters, "constraints" : constraints, "body" : body } Operation._log.debug(source) Modified: branches/73/src/AeonicXME/tests/testM3_generateM2.py =================================================================== --- branches/73/src/AeonicXME/tests/testM3_generateM2.py 2012-01-12 14:57:54 UTC (rev 1276) +++ branches/73/src/AeonicXME/tests/testM3_generateM2.py 2012-01-12 15:05:58 UTC (rev 1277) @@ -116,6 +116,36 @@ from TestApp.M2.Unit.OtherPackage.SubPackage4 import ClassSP4C2 +class Test_M3Operations(unittest.TestCase): + """M3 produces operations in M2 correctly.""" + + @classmethod + def setUpClass(cls): + cls.rev = constructions.construct_revision(m3PatchID="XME-M3_patch", m2URI="testdata/testM3_generateM2.cmof", m2ID="_0") + cls.exampleMCL = cls.rev.m2.mclass[cls.rev.xmiID_to_xmeID(xmiID="SP1-C1")] + + @classmethod + def tearDownClass(cls): + cls.rev = None + cls.exampleMCL = None + + def test_M3_operation_member_accessible_pythonname(self): + """Operation in M2 can be accessed as member using its Python name""" + self.assertTrue(hasattr(self.exampleMCL, self.rev.xmiID_to_xmeID("SP1-C1-Test-param_tests"))) + + def test_M3_operation_member_accessible_alias(self): + """Operation in M2 can be accessed as member using its UML name as alias""" + self.assertTrue(hasattr(self.exampleMCL, "param_tests")) + + def test_M3_operation_member_callable_pythonname(self): + """Operation in M2 can be called using its Python path""" + self.assertTrue(self.exampleMCL.SP1_C1_Test_param_tests_rev1(self.exampleMCL)) + + def test_M3_operation_member_callable_alias(self): + """Operation in M2 can be called using is UML name as alias""" + self.assertTrue(self.exampleMCL.param_tests(self.exampleMCL)) + + class TestPatchableM2_Ticket39(unittest.TestCase): """Test case for testing features of ticket #39 """ @classmethod This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ah...@us...> - 2012-01-12 14:58:00
|
Revision: 1276 http://aeonic.svn.sourceforge.net/aeonic/?rev=1276&view=rev Author: ahatzis Date: 2012-01-12 14:57:54 +0000 (Thu, 12 Jan 2012) Log Message: ----------- trivial change: added generated comments to the M2 source code that is produced Modified Paths: -------------- branches/73/src/AeonicXME/specs/m3/code/Package/_construct.py Modified: branches/73/src/AeonicXME/specs/m3/code/Package/_construct.py =================================================================== --- branches/73/src/AeonicXME/specs/m3/code/Package/_construct.py 2012-01-11 15:38:41 UTC (rev 1275) +++ branches/73/src/AeonicXME/specs/m3/code/Package/_construct.py 2012-01-12 14:57:54 UTC (rev 1276) @@ -9,7 +9,8 @@ c = layer.get_constructor_by_ID(xmeID=cref) source += c._construct(rev=rev, layer=layer, indent=0) aliasEntries.append(c.name.get() + " = " + c.xmeID.get()) - +if len(aliasEntries) > 0: + aliasEntries.insert(0, "\n# class aliases of this package:") if source != "": source = "\n\nfrom XME.M3.Core.Constructs import Class as MofClass" + source + "\n\n" source += "\n".join(aliasEntries) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ah...@us...> - 2012-01-11 15:38:52
|
Revision: 1275 http://aeonic.svn.sourceforge.net/aeonic/?rev=1275&view=rev Author: ahatzis Date: 2012-01-11 15:38:41 +0000 (Wed, 11 Jan 2012) Log Message: ----------- bug-fix for Constraint::bodyCondition which subsets the non-derived Namespace::ownedRule Modified Paths: -------------- branches/73/src/AeonicXME/specs/m3/code/Element/_specify.py Modified: branches/73/src/AeonicXME/specs/m3/code/Element/_specify.py =================================================================== --- branches/73/src/AeonicXME/specs/m3/code/Element/_specify.py 2012-01-02 15:28:50 UTC (rev 1274) +++ branches/73/src/AeonicXME/specs/m3/code/Element/_specify.py 2012-01-11 15:38:41 UTC (rev 1275) @@ -237,7 +237,17 @@ if memberValue._metaProperty["association"]: # association-based meta-property if memberValue._metaProperty["isComposite"]: # search for owned-element style: - if memberName in xmi.childElement: + if xmi.has_attribute(memberName) and xmi.get_attribute(memberName) is not None: + # for example, Operation::bodyCondition is stored as an attribute of the operation's XMI element, + # while it is just a reference towards the Operation::ownedRule that is already created or created later in the process + # it is very likely this is a result by the fact that Operation::bodyCondition subsets Operation::ownedRule, + # Operation::ownedRule is NOT a derived (union) property though, which is different from most of the subsetted properties + refs = xmi.get_attribute(memberName).split(" ") + for ref in refs: + _spec_relatedElement(self, rev=rev, layer=layer, propValue=propValue, prop=memberValue, xmeID=rev.xmiID_to_xmeID(xmiID=ref), ownerID=self.xmeID.get()) + # yes, related-element, although a reference to an owned-element, is intentional, + # because the element was already created as instance in Operation::ownedRule + elif memberName in xmi.childElement: for child in xmi.childElement[memberName]: if child.has_attribute("xmi:type") and child.get_attribute("xmi:type") in supported_constructor:# and child.get_attribute("xmi:type") in prop._metaProperty["type"]: _spec_ownedElement(self, rev=rev, layer=layer, propValue=propValue, prop=memberValue, constructor=supported_constructor[child.get_attribute("xmi:type")], xmi=child, owner=self.xmeID.get()) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ah...@us...> - 2012-01-02 15:28:56
|
Revision: 1274 http://aeonic.svn.sourceforge.net/aeonic/?rev=1274&view=rev Author: ahatzis Date: 2012-01-02 15:28:50 +0000 (Mon, 02 Jan 2012) Log Message: ----------- minor bug-fix Modified Paths: -------------- branches/73/src/AeonicXME/utils/xmiExchanger.py Modified: branches/73/src/AeonicXME/utils/xmiExchanger.py =================================================================== --- branches/73/src/AeonicXME/utils/xmiExchanger.py 2011-12-31 18:01:06 UTC (rev 1273) +++ branches/73/src/AeonicXME/utils/xmiExchanger.py 2012-01-02 15:28:50 UTC (rev 1274) @@ -125,6 +125,7 @@ checksum = hashlib.md5(open(self.effuri).read().encode('utf8')).hexdigest() with open(checksum_path, 'w') as cf: cf.write(checksum) + cf.close() def _cachePath(self): """Used for the copy of the file in the local cache.""" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ah...@us...> - 2011-12-31 18:01:13
|
Revision: 1273 http://aeonic.svn.sourceforge.net/aeonic/?rev=1273&view=rev Author: ahatzis Date: 2011-12-31 18:01:06 +0000 (Sat, 31 Dec 2011) Log Message: ----------- fixed bug to import metaclasses from packages in compiled M2 using their names instead their Python names (XME-IDs); also added a test-case for this fix Modified Paths: -------------- branches/73/src/AeonicXME/specs/m3/code/Package/_construct.py branches/73/src/AeonicXME/specs/m3/code/Package/_registerModule.py branches/73/src/AeonicXME/tests/testM3_generateM2.py Modified: branches/73/src/AeonicXME/specs/m3/code/Package/_construct.py =================================================================== --- branches/73/src/AeonicXME/specs/m3/code/Package/_construct.py 2011-12-27 13:16:21 UTC (rev 1272) +++ branches/73/src/AeonicXME/specs/m3/code/Package/_construct.py 2011-12-31 18:01:06 UTC (rev 1273) @@ -1,20 +1,27 @@ from XME.M3.Core.Constructs import Class, Package Package._log.debug(_("Compiling Package instance with XME:ID = {0!s}".format(self.xmeID.get()))) source = "" +aliasEntries = [] # Compile all owned classes: for cref in layer.constructorsByType["cmof:Class"]: if cref in self.ownedMember: c = layer.get_constructor_by_ID(xmeID=cref) source += c._construct(rev=rev, layer=layer, indent=0) + aliasEntries.append(c.name.get() + " = " + c.xmeID.get()) + if source != "": - source = "\n\nfrom XME.M3.Core.Constructs import Class as MofClass" + source + source = "\n\nfrom XME.M3.Core.Constructs import Class as MofClass" + source + "\n\n" + source += "\n".join(aliasEntries) + #print("\n", 100*"=", "\n", self.xmeID.get(), " \n", 100*"-", "\n", source, "\n", 100*"=") import tempfile, os from AeonicXME import DEBUG if DEBUG: tempdir = os.path.join(tempfile.gettempdir(), "aeonic", "code") - if not os.path.exists(tempdir): + if not os.path.exists(os.path.join(tempfile.gettempdir(), "aeonic")): + os.mkdir(os.path.join(tempfile.gettempdir(), "aeonic")) + if not os.path.exists(os.path.join(tempfile.gettempdir(), "aeonic", "code")): os.mkdir(tempdir) fd, fn = tempfile.mkstemp(dir=tempdir) f = os.fdopen(fd, "wb") @@ -23,16 +30,19 @@ fn = f.name # Compile the package as python module: -code_object = compile(source, fn, "exec") +code_object = compile(source, fn, 'exec') +encoded = source.encode('utf-8') +f.write(encoded) +f.flush() f.close() + scope_local = {} scope_global = {} +module = self._registerModule(rev=rev, layer=layer) exec(code_object, scope_global, scope_local) - for cref in self.ownedMember: c = layer.get_constructor_by_ID(xmeID=cref) if isinstance(c, Class): layer.mclass[c.xmeID.get()] = scope_local[c.xmeID.get()] - -self._registerModule(rev=rev, layer=layer) \ No newline at end of file + setattr(module, c.name.get(), scope_local[c.xmeID.get()]) \ No newline at end of file Modified: branches/73/src/AeonicXME/specs/m3/code/Package/_registerModule.py =================================================================== --- branches/73/src/AeonicXME/specs/m3/code/Package/_registerModule.py 2011-12-27 13:16:21 UTC (rev 1272) +++ branches/73/src/AeonicXME/specs/m3/code/Package/_registerModule.py 2011-12-31 18:01:06 UTC (rev 1273) @@ -14,4 +14,6 @@ rev.modules[name] = module if last_module is not None: setattr(last_module, name.split('.')[-1], module) - last_module = rev.modules[name] \ No newline at end of file + last_module = rev.modules[name] + +return last_module \ No newline at end of file Modified: branches/73/src/AeonicXME/tests/testM3_generateM2.py =================================================================== --- branches/73/src/AeonicXME/tests/testM3_generateM2.py 2011-12-27 13:16:21 UTC (rev 1272) +++ branches/73/src/AeonicXME/tests/testM3_generateM2.py 2011-12-31 18:01:06 UTC (rev 1273) @@ -83,6 +83,39 @@ from XME.M3.Core import PrimitiveTypes +class Test_M3Classes(unittest.TestCase): + """M3 produces classes in M2 correctly.""" + @classmethod + def setUpClass(cls): + cls.rev = constructions.construct_revision(m3PatchID="XME-M3_patch", m2URI="testdata/testM3_generateM2.cmof", m2ID="_0") + + @classmethod + def tearDownClass(cls): + cls.rev = None + + def test_Class_count_9(self): + """Number of classes in compiled M2 the same as in the model file""" + self.assertEqual(len(self.rev.m2.mclass), 9, msg="Number of created meta-meta classes in M2 is {0!s}, but expected 9.".format(len(self.rev.m3.mclass))) + + def test_Class_ClassSP1C1_registered(self): + """Class has been registered in M2""" + + self.assertTrue(self.rev.xmiID_to_xmeID("SP1-C1") in self.rev.m2.mclass, msg="ClassSP1C1 has not been registered with the XME:ID 'SP1-C1'. Something went totally wrong") + + def test_Class_imports(self): + """All classes in M2 can be accessed in Python""" + + from TestApp.M2.Unit.Package.SubPackage1 import ClassSP1C1 + from TestApp.M2.Unit.Package.SubPackage1 import ClassSP1C2 + from TestApp.M2.Unit.Package.SubPackage1 import ClassSP1C3 + from TestApp.M2.Unit.Package.SubPackage2 import ClassSP2C1 + from TestApp.M2.Unit.Package.SubPackage2 import ClassSP2C2 + from TestApp.M2.Unit.OtherPackage.SubPackage3 import ClassSP3C1 + from TestApp.M2.Unit.OtherPackage.SubPackage3 import ClassSP3C2 + from TestApp.M2.Unit.OtherPackage.SubPackage4 import ClassSP4C1 + from TestApp.M2.Unit.OtherPackage.SubPackage4 import ClassSP4C2 + + class TestPatchableM2_Ticket39(unittest.TestCase): """Test case for testing features of ticket #39 """ @classmethod This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ah...@us...> - 2011-12-27 13:16:27
|
Revision: 1272 http://aeonic.svn.sourceforge.net/aeonic/?rev=1272&view=rev Author: ahatzis Date: 2011-12-27 13:16:21 +0000 (Tue, 27 Dec 2011) Log Message: ----------- branching for second part of #73 Added Paths: ----------- branches/73/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ah...@us...> - 2011-12-26 16:25:16
|
Revision: 1271 http://aeonic.svn.sourceforge.net/aeonic/?rev=1271&view=rev Author: ahatzis Date: 2011-12-26 16:25:10 +0000 (Mon, 26 Dec 2011) Log Message: ----------- remove #73, first part is implemented Removed Paths: ------------- 73/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ah...@us...> - 2011-12-26 16:24:10
|
Revision: 1270 http://aeonic.svn.sourceforge.net/aeonic/?rev=1270&view=rev Author: ahatzis Date: 2011-12-26 16:24:01 +0000 (Mon, 26 Dec 2011) Log Message: ----------- merging back first part of #73 operations now have constraints and opaque-expressions; however, the produced source code of M2 can be parsed by the Python interpreter and all tests run OK, but the operations can not be executed yet Modified Paths: -------------- trunk/src/AeonicXME/constructions.py trunk/src/AeonicXME/specs/m3/code/Class/_construct.py trunk/src/AeonicXME/specs/m3/code/Class/_specify.py trunk/src/AeonicXME/specs/m3/code/Classifier/_specify.py trunk/src/AeonicXME/specs/m3/code/Element/_specify.py trunk/src/AeonicXME/specs/m3/code/Element/_src_metaprops.py trunk/src/AeonicXME/specs/m3/code/Generator/construct_M2.py trunk/src/AeonicXME/specs/m3/code/MultiplicityElement/_specify.py trunk/src/AeonicXME/specs/m3/code/NamedElement/_specify.py trunk/src/AeonicXME/specs/m3/code/Operation/_construct.py trunk/src/AeonicXME/specs/m3/code/Operation/_specify.py trunk/src/AeonicXME/specs/m3/code/Package/_construct.py trunk/src/AeonicXME/specs/m3/code/Package/_registerModule.py trunk/src/AeonicXME/specs/m3/code/Package/_specify.py trunk/src/AeonicXME/specs/m3/code/Parameter/_construct.py trunk/src/AeonicXME/specs/m3/code/Parameter/_specify.py trunk/src/AeonicXME/specs/m3/code/Property/_construct.py trunk/src/AeonicXME/specs/m3/m3patch.cmof Added Paths: ----------- trunk/src/AeonicXME/specs/m3/code/Comment/ trunk/src/AeonicXME/specs/m3/code/Comment/_specify.py trunk/src/AeonicXME/specs/m3/code/Constraint/ trunk/src/AeonicXME/specs/m3/code/Constraint/_construct.py trunk/src/AeonicXME/specs/m3/code/Constraint/_specify.py trunk/src/AeonicXME/specs/m3/code/OpaqueExpression/ trunk/src/AeonicXME/specs/m3/code/OpaqueExpression/_construct.py trunk/src/AeonicXME/specs/m3/code/OpaqueExpression/_specify.py trunk/src/AeonicXME/specs/m3/code/PackageableElement/ trunk/src/AeonicXME/specs/m3/code/PackageableElement/_specify.py trunk/src/AeonicXME/specs/m3/code/Property/_specify.py trunk/src/AeonicXME/specs/m3/code/Type/ trunk/src/AeonicXME/specs/m3/code/Type/_specify.py trunk/src/AeonicXME/specs/m3/code/ValueSpecification/ trunk/src/AeonicXME/specs/m3/code/ValueSpecification/_specify.py Removed Paths: ------------- trunk/src/AeonicXME/specs/m3/code/Comment/_specify.py trunk/src/AeonicXME/specs/m3/code/Constraint/_construct.py trunk/src/AeonicXME/specs/m3/code/Constraint/_specify.py trunk/src/AeonicXME/specs/m3/code/OpaqueExpression/_construct.py trunk/src/AeonicXME/specs/m3/code/OpaqueExpression/_specify.py trunk/src/AeonicXME/specs/m3/code/PackageableElement/_specify.py trunk/src/AeonicXME/specs/m3/code/Property/_specifiy.py trunk/src/AeonicXME/specs/m3/code/Type/_specify.py trunk/src/AeonicXME/specs/m3/code/ValueSpecification/_specify.py Property Changed: ---------------- trunk/ trunk/src/AeonicXME/properties.py Property changes on: trunk ___________________________________________________________________ Modified: svn:mergeinfo - /61-fixing_53:987-988 /branches/10-py_inclusion:745-750 /branches/11-constraints:747-767 /branches/11-constraints_prep:734-735 /branches/13-mof-properties:813-827 /branches/14-MOF_statistics:738-739 /branches/15-content_report_MOF:993-1026 /branches/18_mofpatch:770-810 /branches/20-cache-cmof:774-777 /branches/21-packages-as-modules:777-782 /branches/22-add-classes-to-modules:783-802 /branches/23_construct-accepts-IDs:797-798 /branches/28-derived-properties:832-840 /branches/29_split_PropertyConstructor:836-837 /branches/3-methods:705-717 /branches/30-derived-union:938-942 /branches/31-associations:830-934 /branches/35-multi-prop:844-887 /branches/36_revision_ref_in_MOF:848-849 /branches/37-log-level-destinations:953-956 /branches/38_generate_M2classes:854-863 /branches/39-patchable_M2:1002-1007 /branches/52_generate_M2classes_with_operations:866-870 /branches/53_generate_M2classes_with_attributes:874-948 /branches/55-split-tests:892-900 /branches/56-func-files-newlines:890-898 /branches/57_incomplete_metaprops:906-919 /branches/58-primitive-types:969-976 /branches/60-logger-configs:979-983 /branches/62-primitive-refactor:994-999 /branches/63-cache-checksum:1014-1023 /branches/66-constructions-terminology:1030-1149 /branches/70-ReviewM2Generation:1152-1157 /branches/72-packages_in_M2:1190-1235 /branches/75-enumerations_in_M2:1188 /branches/8-release_0.8:742-760 /branches/80-renaming:1160-1161 /branches/81-fixM3patch:1166-1183 /branches/86:1237-1240 /branches/87:1242-1246 /branches/89:1253-1254 /branches/9-cleanup:723-729 /branches/90:1262-1263 + /61-fixing_53:987-988 /73:1248-1269 /branches/10-py_inclusion:745-750 /branches/11-constraints:747-767 /branches/11-constraints_prep:734-735 /branches/13-mof-properties:813-827 /branches/14-MOF_statistics:738-739 /branches/15-content_report_MOF:993-1026 /branches/18_mofpatch:770-810 /branches/20-cache-cmof:774-777 /branches/21-packages-as-modules:777-782 /branches/22-add-classes-to-modules:783-802 /branches/23_construct-accepts-IDs:797-798 /branches/28-derived-properties:832-840 /branches/29_split_PropertyConstructor:836-837 /branches/3-methods:705-717 /branches/30-derived-union:938-942 /branches/31-associations:830-934 /branches/35-multi-prop:844-887 /branches/36_revision_ref_in_MOF:848-849 /branches/37-log-level-destinations:953-956 /branches/38_generate_M2classes:854-863 /branches/39-patchable_M2:1002-1007 /branches/52_generate_M2classes_with_operations:866-870 /branches/53_generate_M2classes_with_attributes:874-948 /branches/55-split-tests:892-900 /branches/56-func-files-newlines:890-898 /branches/57_incomplete_metaprops:906-919 /branches/58-primitive-types:969-976 /branches/60-logger-configs:979-983 /branches/62-primitive-refactor:994-999 /branches/63-cache-checksum:1014-1023 /branches/66-constructions-terminology:1030-1149 /branches/70-ReviewM2Generation:1152-1157 /branches/72-packages_in_M2:1190-1235 /branches/75-enumerations_in_M2:1188 /branches/8-release_0.8:742-760 /branches/80-renaming:1160-1161 /branches/81-fixM3patch:1166-1183 /branches/86:1237-1240 /branches/87:1242-1246 /branches/89:1253-1254 /branches/9-cleanup:723-729 /branches/90:1262-1263 Modified: trunk/src/AeonicXME/constructions.py =================================================================== --- trunk/src/AeonicXME/constructions.py 2011-12-26 16:13:27 UTC (rev 1269) +++ trunk/src/AeonicXME/constructions.py 2011-12-26 16:24:01 UTC (rev 1270) @@ -1990,7 +1990,9 @@ if DEBUG: tempdir = os.path.join(tempfile.gettempdir(), "aeonic", "code") - if not os.path.exists(tempdir): + if not os.path.exists(os.path.join(tempfile.gettempdir(), "aeonic")): + os.mkdir(os.path.join(tempfile.gettempdir(), "aeonic")) + if not os.path.exists(os.path.join(tempfile.gettempdir(), "aeonic", "code")): os.mkdir(tempdir) fd, fn = tempfile.mkstemp(dir=tempdir) f = os.fdopen(fd, "wb") @@ -2455,7 +2457,6 @@ "cmof:PackageImport" : PackageImportConstructor, "cmof:Parameter" : ParameterConstructor, "cmof:Property" : PropertyConstructor, - "cmof:Classifier": ClassifierConstructor, "cmof:DataType": DataTypeConstructor, "cmof:PrimitiveType": PrimitiveTypeConstructor, "xmi:Add" : AddUpdater, Property changes on: trunk/src/AeonicXME/properties.py ___________________________________________________________________ Modified: svn:mergeinfo - /61-fixing_53/src/AeonicXME/properties.py:987-988 /branches/15-content_report_MOF/src/AeonicXME/properties.py:993-1026 /branches/30-derived-union/src/AeonicXME/properties.py:938-942 /branches/31-associations/src/AeonicXME/properties.py:830-934 /branches/37-log-level-destinations/src/AeonicXME/properties.py:953-956 /branches/39-patchable_M2/src/AeonicXME/properties.py:1002-1007 /branches/53_generate_M2classes_with_attributes/src/AeonicXME/properties.py:874-948 /branches/58-primitive-types/src/AeonicXME/properties.py:969-976 /branches/60-logger-configs/src/AeonicXME/properties.py:979-983 /branches/62-primitive-refactor/src/AeonicXME/properties.py:994-999 /branches/63-cache-checksum/src/AeonicXME/properties.py:1014-1023 /branches/66-constructions-terminology/src/AeonicXME/properties.py:1030-1149 /branches/70-ReviewM2Generation/src/AeonicXME/properties.py:1152-1157 /branches/72-packages_in_M2/src/AeonicXME/properties.py:1190-1235 /branches/75-enumerations_in_M2/src/AeonicXME/properties.py:1188 /branches/80-renaming/src/AeonicXME/properties.py:1160-1161 /branches/81-fixM3patch/src/AeonicXME/properties.py:1166-1183 /branches/86/src/AeonicXME/properties.py:1237-1240 /branches/87/src/AeonicXME/properties.py:1242-1246 /branches/89/src/AeonicXME/properties.py:1253-1254 /branches/90/src/AeonicXME/properties.py:1262-1263 + /61-fixing_53/src/AeonicXME/properties.py:987-988 /73/src/AeonicXME/properties.py:1248-1269 /branches/15-content_report_MOF/src/AeonicXME/properties.py:993-1026 /branches/30-derived-union/src/AeonicXME/properties.py:938-942 /branches/31-associations/src/AeonicXME/properties.py:830-934 /branches/37-log-level-destinations/src/AeonicXME/properties.py:953-956 /branches/39-patchable_M2/src/AeonicXME/properties.py:1002-1007 /branches/53_generate_M2classes_with_attributes/src/AeonicXME/properties.py:874-948 /branches/58-primitive-types/src/AeonicXME/properties.py:969-976 /branches/60-logger-configs/src/AeonicXME/properties.py:979-983 /branches/62-primitive-refactor/src/AeonicXME/properties.py:994-999 /branches/63-cache-checksum/src/AeonicXME/properties.py:1014-1023 /branches/66-constructions-terminology/src/AeonicXME/properties.py:1030-1149 /branches/70-ReviewM2Generation/src/AeonicXME/properties.py:1152-1157 /branches/72-packages_in_M2/src/AeonicXME/properties.py:1190-1235 /branches/75-enumerations_in_M2/src/AeonicXME/properties.py:1188 /branches/80-renaming/src/AeonicXME/properties.py:1160-1161 /branches/81-fixM3patch/src/AeonicXME/properties.py:1166-1183 /branches/86/src/AeonicXME/properties.py:1237-1240 /branches/87/src/AeonicXME/properties.py:1242-1246 /branches/89/src/AeonicXME/properties.py:1253-1254 /branches/90/src/AeonicXME/properties.py:1262-1263 Modified: trunk/src/AeonicXME/specs/m3/code/Class/_construct.py =================================================================== --- trunk/src/AeonicXME/specs/m3/code/Class/_construct.py 2011-12-26 16:13:27 UTC (rev 1269) +++ trunk/src/AeonicXME/specs/m3/code/Class/_construct.py 2011-12-26 16:24:01 UTC (rev 1270) @@ -3,7 +3,7 @@ classname = self.xmeID.get() Class._log.debug(_("Compiling Class instance with XME:ID = {0!s}".format(classname))) classdeco = "MofClass._new" -tplClass = """\nfrom XME.M3.Core.Constructs import Class as MofClass\n\n@%(classdeco)s\nclass %(classname)s(%(classbase)s):\n%(classdoc)s\n\tfrom XME.M3.Core.Constructs import Property as MofProperty\n%(metaprops)s\n%(attributes)s\n%(operations)s""" +tplClass = """\n\n\n@%(classdeco)s\nclass %(classname)s(%(classbase)s):\n%(classdoc)s\n\tfrom XME.M3.Core.Constructs import Property as MofProperty\n\tfrom XME.M3.Core.Constructs import Operation as MofOperation\n%(metaprops)s%(attributes)s%(operations)s""" parents = [] #if xmi.has_attribute("superClass"): # TODO: eventually this one can be done by MofClass._new decorating the UML meta-class @@ -25,18 +25,16 @@ attributes = "" for cref in self.ownedAttribute: a = layer.get_constructor_by_ID(xmeID=cref) - attributes += a._construct(rev=rev, layer=layer, indent=2) + attributes += a._construct(rev=rev, layer=layer, indent=indent+1) # # Construct operations that are owned by the the UML metaclass operations = "" -#for a in self.ownedOperation: -# print("operation = ", a) +for cref in self.ownedOperation: + o = layer.get_constructor_by_ID(xmeID=cref) + operations += o._construct(rev=rev, layer=layer, indent=indent+1) -# Construct an example operation: -operations += '\n\n\t' + "def __new__(mcl, cname, cbases, cdict):\n\t\treturn mcl" % {} +source = tplClass % { "classdeco" : classdeco, "classname" : classname, "classbase" : classbase, "classdoc" : classdoc, "metaprops" : self._src_metaprops(rev=rev, layer=layer, indent=indent+1), "attributes" : attributes, "operations" : operations } -source = tplClass % { "classdeco" : classdeco, "classname" : classname, "classbase" : classbase, "classdoc" : classdoc, "metaprops" : self._src_metaprops(rev=rev, layer=layer, indent=1), "attributes" : attributes, "operations" : operations } - Class._log.debug(source) return source \ No newline at end of file Modified: trunk/src/AeonicXME/specs/m3/code/Class/_specify.py =================================================================== --- trunk/src/AeonicXME/specs/m3/code/Class/_specify.py 2011-12-26 16:13:27 UTC (rev 1269) +++ trunk/src/AeonicXME/specs/m3/code/Class/_specify.py 2011-12-26 16:24:01 UTC (rev 1270) @@ -1,3 +1,4 @@ -from XME.M3.Core.Constructs import Classifier +from XME.M3.Core.Constructs import Element, Classifier self._log.debug(_("Specifying Class instance with XMI:ID = {0!s}".format(xmi.get_attribute("xmi:id")))) +Element._specify(self, rev=rev, layer=layer, xmi=xmi, owner=owner) return Classifier._specify(self, rev=rev, layer=layer, xmi=xmi, owner=owner) \ No newline at end of file Modified: trunk/src/AeonicXME/specs/m3/code/Classifier/_specify.py =================================================================== --- trunk/src/AeonicXME/specs/m3/code/Classifier/_specify.py 2011-12-26 16:13:27 UTC (rev 1269) +++ trunk/src/AeonicXME/specs/m3/code/Classifier/_specify.py 2011-12-26 16:24:01 UTC (rev 1270) @@ -1,3 +1,3 @@ -from XME.M3.Core.Constructs import Namespace -self._log.debug(_("Specifying Classifier instance with XMI:ID = {0!s}".format(xmi.get_attribute("xmi:id")))) -return Namespace._specify(self, rev=rev, layer=layer, xmi=xmi, owner=owner) \ No newline at end of file +from XME.M3.Core.Constructs import Namespace, Type +Namespace._specify(self, rev=rev, layer=layer, xmi=xmi, owner=owner) # FIXME: super() calls broken? +return Type._specify(self, rev=rev, layer=layer, xmi=xmi, owner=owner) # FIXME: super() calls broken? Deleted: trunk/src/AeonicXME/specs/m3/code/Comment/_specify.py =================================================================== --- 73/src/AeonicXME/specs/m3/code/Comment/_specify.py 2011-12-26 16:13:27 UTC (rev 1269) +++ trunk/src/AeonicXME/specs/m3/code/Comment/_specify.py 2011-12-26 16:24:01 UTC (rev 1270) @@ -1,3 +0,0 @@ -from XME.M3.Core.Constructs import Element -self._log.debug(_("Specifying Comment instance with XMI:ID = {0!s}".format(xmi.get_attribute("xmi:id")))) -return Element._specify(self, rev=rev, layer=layer, xmi=xmi, owner=owner) \ No newline at end of file Copied: trunk/src/AeonicXME/specs/m3/code/Comment/_specify.py (from rev 1269, 73/src/AeonicXME/specs/m3/code/Comment/_specify.py) =================================================================== --- trunk/src/AeonicXME/specs/m3/code/Comment/_specify.py (rev 0) +++ trunk/src/AeonicXME/specs/m3/code/Comment/_specify.py 2011-12-26 16:24:01 UTC (rev 1270) @@ -0,0 +1,3 @@ +from XME.M3.Core.Constructs import Element +self._log.debug(_("Specifying Comment instance with XMI:ID = {0!s}".format(xmi.get_attribute("xmi:id")))) +return Element._specify(self, rev=rev, layer=layer, xmi=xmi, owner=owner) \ No newline at end of file Deleted: trunk/src/AeonicXME/specs/m3/code/Constraint/_construct.py =================================================================== --- 73/src/AeonicXME/specs/m3/code/Constraint/_construct.py 2011-12-26 16:13:27 UTC (rev 1269) +++ trunk/src/AeonicXME/specs/m3/code/Constraint/_construct.py 2011-12-26 16:24:01 UTC (rev 1270) @@ -1,25 +0,0 @@ -from XME.M3.Core.Constructs import Constraint - -classname = self.xmeID.get() -Constraint._log.debug(_("Compiling Constraint instance with XME:ID = {0!s}".format(classname))) -classdeco = "MofConstraint._new" -tplClass = """\n\n\n\t\t@%(classdeco)s\n\t\tclass %(classname)s(%(classbase)s):\n\t\t\t%(classdoc)s\n\t\t\tfrom XME.M3.Core.Constructs import OpaqueExpression as MofOpaqueExpression\n%(metaprops)s%(specification)s""" - -# No generalizations between parameters -classbase = "type" - -# Documentation -# Construct an example docstring -classdoc = '"""test doc"""' - -# Construct specification owned by the UML metaclass -specification = "" -if self.specification.get(): - s = layer.get_constructor_by_ID(xmeID=self.specification.get()) - specification += s._construct(rev=rev, layer=layer, indent=indent+1) - -source = tplClass % { "classdeco" : classdeco, "classname" : classname, "classbase" : classbase, "classdoc" : classdoc, "metaprops" : self._src_metaprops(rev=rev, layer=layer, indent=indent+1), "specification" : specification } - -Constraint._log.debug(source) - -return source \ No newline at end of file Copied: trunk/src/AeonicXME/specs/m3/code/Constraint/_construct.py (from rev 1269, 73/src/AeonicXME/specs/m3/code/Constraint/_construct.py) =================================================================== --- trunk/src/AeonicXME/specs/m3/code/Constraint/_construct.py (rev 0) +++ trunk/src/AeonicXME/specs/m3/code/Constraint/_construct.py 2011-12-26 16:24:01 UTC (rev 1270) @@ -0,0 +1,25 @@ +from XME.M3.Core.Constructs import Constraint + +classname = self.xmeID.get() +Constraint._log.debug(_("Compiling Constraint instance with XME:ID = {0!s}".format(classname))) +classdeco = "MofConstraint._new" +tplClass = """\n\n\n\t\t@%(classdeco)s\n\t\tclass %(classname)s(%(classbase)s):\n\t\t\t%(classdoc)s\n\t\t\tfrom XME.M3.Core.Constructs import OpaqueExpression as MofOpaqueExpression\n%(metaprops)s%(specification)s""" + +# No generalizations between parameters +classbase = "type" + +# Documentation +# Construct an example docstring +classdoc = '"""test doc"""' + +# Construct specification owned by the UML metaclass +specification = "" +if self.specification.get(): + s = layer.get_constructor_by_ID(xmeID=self.specification.get()) + specification += s._construct(rev=rev, layer=layer, indent=indent+1) + +source = tplClass % { "classdeco" : classdeco, "classname" : classname, "classbase" : classbase, "classdoc" : classdoc, "metaprops" : self._src_metaprops(rev=rev, layer=layer, indent=indent+1), "specification" : specification } + +Constraint._log.debug(source) + +return source \ No newline at end of file Deleted: trunk/src/AeonicXME/specs/m3/code/Constraint/_specify.py =================================================================== --- 73/src/AeonicXME/specs/m3/code/Constraint/_specify.py 2011-12-26 16:13:27 UTC (rev 1269) +++ trunk/src/AeonicXME/specs/m3/code/Constraint/_specify.py 2011-12-26 16:24:01 UTC (rev 1270) @@ -1,4 +0,0 @@ -from XME.M3.Core.Constructs import Element, NamedElement -self._log.debug(_("Specifying Constraint instance with XMI:ID = {0!s}".format(xmi.get_attribute("xmi:id")))) -Element._specify(self, rev=rev, layer=layer, xmi=xmi, owner=owner) -return NamedElement._specify(self, rev=rev, layer=layer, xmi=xmi, owner=owner) Copied: trunk/src/AeonicXME/specs/m3/code/Constraint/_specify.py (from rev 1269, 73/src/AeonicXME/specs/m3/code/Constraint/_specify.py) =================================================================== --- trunk/src/AeonicXME/specs/m3/code/Constraint/_specify.py (rev 0) +++ trunk/src/AeonicXME/specs/m3/code/Constraint/_specify.py 2011-12-26 16:24:01 UTC (rev 1270) @@ -0,0 +1,4 @@ +from XME.M3.Core.Constructs import Element, NamedElement +self._log.debug(_("Specifying Constraint instance with XMI:ID = {0!s}".format(xmi.get_attribute("xmi:id")))) +Element._specify(self, rev=rev, layer=layer, xmi=xmi, owner=owner) +return NamedElement._specify(self, rev=rev, layer=layer, xmi=xmi, owner=owner) Modified: trunk/src/AeonicXME/specs/m3/code/Element/_specify.py =================================================================== --- trunk/src/AeonicXME/specs/m3/code/Element/_specify.py 2011-12-26 16:13:27 UTC (rev 1269) +++ trunk/src/AeonicXME/specs/m3/code/Element/_specify.py 2011-12-26 16:24:01 UTC (rev 1270) @@ -1,23 +1,25 @@ from AeonicXME.constructions import Property as PropertyDescriptor -from XME.M3.Core.Constructs import Element, Class, Package, Property, Operation, Parameter #, Association, Comment, Constraint, Enumeration, EnumerationLiteral, OpaqueExpression, PackageImport, Classifier, DataType, PrimitiveType, +from XME.M3.Core.Constructs import Element, Class, Package, Property, Operation, Parameter, Constraint, OpaqueExpression, ValueSpecification, TypedElement, PackageableElement, Association, Comment, Enumeration, EnumerationLiteral, PackageImport, DataType, PrimitiveType +if self.xmeID.get(): + return self.xmeID.get() + # dictionary of type names (from XMI) as key and the corresponding constructor class as value (non-abstract only) supported_constructor = { # "cmof:Association" : Association, "cmof:Class" : Class, -# "cmof:Comment" : Comment, -# "cmof:Constraint" : Constraint, -# "cmof:Enumeration" : Enumeration, -# "cmof:EnumerationLiteral" : EnumerationLiteral, -# "cmof:OpaqueExpression" : OpaqueExpression, + "cmof:Comment" : Comment, + "cmof:Constraint" : Constraint, + "cmof:Enumeration" : Enumeration, + "cmof:EnumerationLiteral" : EnumerationLiteral, + "cmof:OpaqueExpression" : OpaqueExpression, "cmof:Operation" : Operation, "cmof:Package" : Package, -# "cmof:PackageImport" : PackageImport, + "cmof:PackageImport" : PackageImport, "cmof:Parameter" : Parameter, "cmof:Property" : Property, -# "cmof:Classifier": Classifier, -# "cmof:DataType": DataType, -# "cmof:PrimitiveType": PrimitiveType, + "cmof:DataType": DataType, + "cmof:PrimitiveType": PrimitiveType, # "xmi:Add" : AddUpdater, # "xmi:Delete" : DeleteUpdater, # "xmi:Replace" : ReplaceUpdater, @@ -56,11 +58,8 @@ else: Element._log.error("In M2 layer found instance with no XMI:ID, incomplete XMI = {0!s}").format(xmi.to_XML(collapsed=True)) # TODO: tolerate or raise error? -self._log.debug(_("Specifying instance with XMI:ID = {0!s}".format(self.xmeID.get()))) +#self._log.debug(_("Specifying instance with XME:ID = {0!s}".format(self.xmeID.get()))) -if owner: - self.owner.set(owner) - if xmi.has_attribute("xmi:type"): mclassID = rev.m3.mclassAlias[xmi.get_attribute("xmi:type")[5:]] else: @@ -259,7 +258,7 @@ if xmi.has_attribute(memberName) and xmi.get_attribute(memberName) is not None: _spec_ownedAttribute(self, rev=rev, layer=layer, propValue=propValue, prop=memberValue, value=xmi.get_attribute(memberName)) elif memberName in xmi.childElement: - for child in xmi.childElement[property]: + for child in xmi.childElement[memberName]: _spec_ownedAttribute(self, rev=rev, layer=layer, propValue=propValue, prop=memberValue, value=child.text) elif memberValue._metaProperty["default"] is not None: _spec_ownedAttribute(self, rev=rev, layer=layer, propValue=propValue, prop=memberValue, value=memberValue._metaProperty["default"]) Modified: trunk/src/AeonicXME/specs/m3/code/Element/_src_metaprops.py =================================================================== --- trunk/src/AeonicXME/specs/m3/code/Element/_src_metaprops.py 2011-12-26 16:13:27 UTC (rev 1269) +++ trunk/src/AeonicXME/specs/m3/code/Element/_src_metaprops.py 2011-12-26 16:24:01 UTC (rev 1270) @@ -47,7 +47,7 @@ cvalue = str(value) elif typeID == idString: if value is not None: - cvalue = '"' + value + '"' + cvalue = '"""' + value + '"""' # allow multi-line strings, e.g. in OpaqueExpression::body else: if value is not None: cvalue = '"' + value + '"' # treat XME:ID as string Modified: trunk/src/AeonicXME/specs/m3/code/Generator/construct_M2.py =================================================================== --- trunk/src/AeonicXME/specs/m3/code/Generator/construct_M2.py 2011-12-26 16:13:27 UTC (rev 1269) +++ trunk/src/AeonicXME/specs/m3/code/Generator/construct_M2.py 2011-12-26 16:24:01 UTC (rev 1270) @@ -79,7 +79,7 @@ _sort_class_constructors(layer) for cref in layer.constructorsByType["cmof:Package"]: constructor = layer.get_constructor_by_ID(xmeID=cref) - constructor._construct(rev=rev, layer=layer) + constructor._construct(rev=rev, layer=layer, indent=0) # return # for cref in layer.constructorsByType["cmof:Class"]: # constructor = layer.get_constructor_by_ID(xmeID=cref) @@ -90,7 +90,7 @@ crefs += layer.constructorsByType.get("cmof:PrimitiveType", []) for cref in crefs: constructor = layer.get_constructor_by_ID(xmeID=cref) - constructor._construct(rev=rev, layer=layer) + constructor._construct(rev=rev, layer=layer, indent=0) Generator._log.info(_("{0!s} constructed successfully.").format(layer.name)) Modified: trunk/src/AeonicXME/specs/m3/code/MultiplicityElement/_specify.py =================================================================== --- trunk/src/AeonicXME/specs/m3/code/MultiplicityElement/_specify.py 2011-12-26 16:13:27 UTC (rev 1269) +++ trunk/src/AeonicXME/specs/m3/code/MultiplicityElement/_specify.py 2011-12-26 16:24:01 UTC (rev 1270) @@ -1,2 +1,2 @@ from XME.M3.Core.Constructs import Element -return Element._specify(self, rev=rev, layer=layer, xmi=xmi, owner=owner) \ No newline at end of file +return self.xmeID.get() \ No newline at end of file Modified: trunk/src/AeonicXME/specs/m3/code/NamedElement/_specify.py =================================================================== --- trunk/src/AeonicXME/specs/m3/code/NamedElement/_specify.py 2011-12-26 16:13:27 UTC (rev 1269) +++ trunk/src/AeonicXME/specs/m3/code/NamedElement/_specify.py 2011-12-26 16:24:01 UTC (rev 1270) @@ -1,2 +1,2 @@ from XME.M3.Core.Constructs import Element -return Element._specify(self, rev=rev, layer=layer, xmi=xmi, owner=owner) \ No newline at end of file +return self.xmeID.get() \ No newline at end of file Deleted: trunk/src/AeonicXME/specs/m3/code/OpaqueExpression/_construct.py =================================================================== --- 73/src/AeonicXME/specs/m3/code/OpaqueExpression/_construct.py 2011-12-26 16:13:27 UTC (rev 1269) +++ trunk/src/AeonicXME/specs/m3/code/OpaqueExpression/_construct.py 2011-12-26 16:24:01 UTC (rev 1270) @@ -1,23 +0,0 @@ -from XME.M3.Core.Constructs import OpaqueExpression - -classname = self.xmeID.get() -OpaqueExpression._log.debug(_("Compiling OpaqueExpression instance with XME:ID = {0!s}".format(classname))) -classdeco = "MofOpaqueExpression._new" -tplClass = """\n\n\t\t\t@%(classdeco)s\n\t\t\tclass %(classname)s(%(classbase)s):\n\t\t\t\t%(classdoc)s\n%(metaprops)s""" - -# No generalizations between parameters -classbase = "type" - -# Documentation -# Construct an example docstring -classdoc = '"""test doc"""' - -# Construct body: -if not self.language[0].startswith('Python3.'): - self.body[0] = 'raise OpaqueExpression._errors.NotImplementedError(raiser=self, name="{0!s}")'.format(self.owner.get()) - -source = tplClass % { "classdeco" : classdeco, "classname" : classname, "classbase" : classbase, "classdoc" : classdoc, "metaprops" : self._src_metaprops(rev=rev, layer=layer, indent=indent+1) } - -OpaqueExpression._log.debug(source) - -return source \ No newline at end of file Copied: trunk/src/AeonicXME/specs/m3/code/OpaqueExpression/_construct.py (from rev 1269, 73/src/AeonicXME/specs/m3/code/OpaqueExpression/_construct.py) =================================================================== --- trunk/src/AeonicXME/specs/m3/code/OpaqueExpression/_construct.py (rev 0) +++ trunk/src/AeonicXME/specs/m3/code/OpaqueExpression/_construct.py 2011-12-26 16:24:01 UTC (rev 1270) @@ -0,0 +1,23 @@ +from XME.M3.Core.Constructs import OpaqueExpression + +classname = self.xmeID.get() +OpaqueExpression._log.debug(_("Compiling OpaqueExpression instance with XME:ID = {0!s}".format(classname))) +classdeco = "MofOpaqueExpression._new" +tplClass = """\n\n\t\t\t@%(classdeco)s\n\t\t\tclass %(classname)s(%(classbase)s):\n\t\t\t\t%(classdoc)s\n%(metaprops)s""" + +# No generalizations between parameters +classbase = "type" + +# Documentation +# Construct an example docstring +classdoc = '"""test doc"""' + +# Construct body: +if not self.language[0].startswith('Python3.'): + self.body[0] = 'raise OpaqueExpression._errors.NotImplementedError(raiser=self, name="{0!s}")'.format(self.owner.get()) + +source = tplClass % { "classdeco" : classdeco, "classname" : classname, "classbase" : classbase, "classdoc" : classdoc, "metaprops" : self._src_metaprops(rev=rev, layer=layer, indent=indent+1) } + +OpaqueExpression._log.debug(source) + +return source \ No newline at end of file Deleted: trunk/src/AeonicXME/specs/m3/code/OpaqueExpression/_specify.py =================================================================== --- 73/src/AeonicXME/specs/m3/code/OpaqueExpression/_specify.py 2011-12-26 16:13:27 UTC (rev 1269) +++ trunk/src/AeonicXME/specs/m3/code/OpaqueExpression/_specify.py 2011-12-26 16:24:01 UTC (rev 1270) @@ -1,4 +0,0 @@ -from XME.M3.Core.Constructs import Element, ValueSpecification -self._log.debug(_("Specifying OpaqueExpression instance with XMI:ID = {0!s}".format(xmi.get_attribute("xmi:id")))) -Element._specify(self, rev=rev, layer=layer, xmi=xmi, owner=owner) -return ValueSpecification._specify(self, rev=rev, layer=layer, xmi=xmi, owner=owner) \ No newline at end of file Copied: trunk/src/AeonicXME/specs/m3/code/OpaqueExpression/_specify.py (from rev 1269, 73/src/AeonicXME/specs/m3/code/OpaqueExpression/_specify.py) =================================================================== --- trunk/src/AeonicXME/specs/m3/code/OpaqueExpression/_specify.py (rev 0) +++ trunk/src/AeonicXME/specs/m3/code/OpaqueExpression/_specify.py 2011-12-26 16:24:01 UTC (rev 1270) @@ -0,0 +1,4 @@ +from XME.M3.Core.Constructs import Element, ValueSpecification +self._log.debug(_("Specifying OpaqueExpression instance with XMI:ID = {0!s}".format(xmi.get_attribute("xmi:id")))) +Element._specify(self, rev=rev, layer=layer, xmi=xmi, owner=owner) +return ValueSpecification._specify(self, rev=rev, layer=layer, xmi=xmi, owner=owner) \ No newline at end of file Modified: trunk/src/AeonicXME/specs/m3/code/Operation/_construct.py =================================================================== --- trunk/src/AeonicXME/specs/m3/code/Operation/_construct.py 2011-12-26 16:13:27 UTC (rev 1269) +++ trunk/src/AeonicXME/specs/m3/code/Operation/_construct.py 2011-12-26 16:24:01 UTC (rev 1270) @@ -1,33 +1,48 @@ -def parameter_specify(xmi): - if xmi.has_attribute("direction") == "return": - return None - else: - return xmi.get_attribute("name") +from XME.M3.Core.Constructs import Operation -tplOper = '\t' + "def %(name)s(%(parameters)s):\n%(body)s" -params = [] -if "ownedParameter" in xmi.childElement: - for child in xmi.childElement["ownedParameter"]: - if child.get_attribute("xmi:type") in ["cmof:Parameter"]: - param = parameter_specify(child) - if param: - params.append(param) -if params == 0: - parameters = "" -else: - parameters = ", ".join(params) +classname = self.xmeID.get() +Operation._log.debug(_("Compiling Operation instance with XME:ID = {0!s}".format(classname))) +classdeco = "MofOperation._new" +tplClass = """\n\n\n\t@%(classdeco)s\n\tclass %(classname)s(%(classbase)s):\n\t\t%(classdoc)s\n\t\tfrom XME.M3.Core.Constructs import Parameter as MofParameter\n\t\tfrom XME.M3.Core.Constructs import Constraint as MofConstraint\n%(metaprops)s%(parameters)s%(constraints)s""" -lines = [] -for child in xmi.childElement["ownedRule"]: - if child.get_attribute("xmi:type") in ["cmof:Constraint"]: - for spec in child.childElement["specification"]: - if spec.get_attribute("xmi:type") in ["cmof:OpaqueExpression"]: - for lang in spec.childElement["language"]: - if lang.text.startswith('Python 3.'): - # Inject the Python code as defined in the body of the OpaqueExpression: - for line in spec.childElement["body"][0].text.split('\n'): - lines.append("\t\t" + line) - else: - lines.append("\t\traise NotImplementedError") -body = "\n".join(lines) -return tplOper % { "name" : Class._rev.xmiID_to_xmeID(xmiID=xmi.get_attribute("xmi:id")), "parameters" : parameters, "body" : body } \ No newline at end of file +# No generalizations between operations +classbase = "type" + +# Documentation +# Construct an example docstring +classdoc = '"""test doc"""' + +# Construct parameters owned by the UML metaclass +parameters = "" +for cref in self.ownedParameter: + p = layer.get_constructor_by_ID(xmeID=cref) + parameters += p._construct(rev=rev, layer=layer, indent=indent+1) + +# Construct constraints owned by the UML metaclass +constraints = "" +for cref in self.ownedRule: + c = layer.get_constructor_by_ID(xmeID=cref) + constraints += c._construct(rev=rev, layer=layer, indent=indent+1) + +source = tplClass % { "classdeco" : classdeco, "classname" : classname, "classbase" : classbase, "classdoc" : classdoc, "metaprops" : self._src_metaprops(rev=rev, layer=layer, indent=indent+1), "parameters" : parameters, "constraints" : constraints } + +Operation._log.debug(source) + +return source + + +#tplOper = '\t' + "def %(name)s(%(parameters)s):\n%(body)s" +#lines = [] +#for child self.ownedRule: +# if child.get_attribute("xmi:type") in ["cmof:Constraint"]: +# for spec in child.childElement["specification"]: +# if spec.get_attribute("xmi:type") in ["cmof:OpaqueExpression"]: +# for lang in spec.childElement["language"]: +# if lang.text.startswith('Python 3.'): +# # Inject the Python code as defined in the body of the OpaqueExpression: +# for line in spec.childElement["body"][0].text.split('\n'): +# lines.append("\t\t" + line) +# else: +# lines.append("\t\traise NotImplementedError") +#body = "\n".join(lines) +#return tplOper % { "name" : Class._rev.xmiID_to_xmeID(xmiID=xmi.get_attribute("xmi:id")), "parameters" : parameters, "body" : body } \ No newline at end of file Modified: trunk/src/AeonicXME/specs/m3/code/Operation/_specify.py =================================================================== --- trunk/src/AeonicXME/specs/m3/code/Operation/_specify.py 2011-12-26 16:13:27 UTC (rev 1269) +++ trunk/src/AeonicXME/specs/m3/code/Operation/_specify.py 2011-12-26 16:24:01 UTC (rev 1270) @@ -1,3 +1,4 @@ -from XME.M3.Core.Constructs import Namespace +from XME.M3.Core.Constructs import Element, Namespace self._log.debug(_("Specifying Operation instance with XMI:ID = {0!s}".format(xmi.get_attribute("xmi:id")))) +Element._specify(self, rev=rev, layer=layer, xmi=xmi, owner=owner) return Namespace._specify(self, rev=rev, layer=layer, xmi=xmi, owner=owner) \ No newline at end of file Modified: trunk/src/AeonicXME/specs/m3/code/Package/_construct.py =================================================================== --- trunk/src/AeonicXME/specs/m3/code/Package/_construct.py 2011-12-26 16:13:27 UTC (rev 1269) +++ trunk/src/AeonicXME/specs/m3/code/Package/_construct.py 2011-12-26 16:24:01 UTC (rev 1270) @@ -6,8 +6,10 @@ for cref in layer.constructorsByType["cmof:Class"]: if cref in self.ownedMember: c = layer.get_constructor_by_ID(xmeID=cref) - source += c._construct(rev=rev, layer=layer) -#print(source) + source += c._construct(rev=rev, layer=layer, indent=0) +if source != "": + source = "\n\nfrom XME.M3.Core.Constructs import Class as MofClass" + source +#print("\n", 100*"=", "\n", self.xmeID.get(), " \n", 100*"-", "\n", source, "\n", 100*"=") import tempfile, os from AeonicXME import DEBUG if DEBUG: Modified: trunk/src/AeonicXME/specs/m3/code/Package/_registerModule.py =================================================================== --- trunk/src/AeonicXME/specs/m3/code/Package/_registerModule.py 2011-12-26 16:13:27 UTC (rev 1269) +++ trunk/src/AeonicXME/specs/m3/code/Package/_registerModule.py 2011-12-26 16:24:01 UTC (rev 1270) @@ -1,5 +1,6 @@ import types if self.name.get() is None: + self._log.error(_("Cannot register module with-out name: {0!s}").format(self.xmeID.get())) return else: module_name = self._python_qualifiedName(rev=rev, layer=layer) Modified: trunk/src/AeonicXME/specs/m3/code/Package/_specify.py =================================================================== --- trunk/src/AeonicXME/specs/m3/code/Package/_specify.py 2011-12-26 16:13:27 UTC (rev 1269) +++ trunk/src/AeonicXME/specs/m3/code/Package/_specify.py 2011-12-26 16:24:01 UTC (rev 1270) @@ -1,3 +1,5 @@ -from XME.M3.Core.Constructs import Namespace +from XME.M3.Core.Constructs import Element, Namespace, PackageableElement self._log.debug(_("Specifying Package instance with XMI:ID = {0!s}".format(xmi.get_attribute("xmi:id")))) -return Namespace._specify(self, rev=rev, layer=layer, xmi=xmi, owner=owner) \ No newline at end of file +Element._specify(self, rev=rev, layer=layer, xmi=xmi, owner=owner) +Namespace._specify(self, rev=rev, layer=layer, xmi=xmi, owner=owner) +return PackageableElement._specify(self, rev=rev, layer=layer, xmi=xmi, owner=owner) \ No newline at end of file Deleted: trunk/src/AeonicXME/specs/m3/code/PackageableElement/_specify.py =================================================================== --- 73/src/AeonicXME/specs/m3/code/PackageableElement/_specify.py 2011-12-26 16:13:27 UTC (rev 1269) +++ trunk/src/AeonicXME/specs/m3/code/PackageableElement/_specify.py 2011-12-26 16:24:01 UTC (rev 1270) @@ -1,8 +0,0 @@ -from XME.M3.Core.Constructs import NamedElement -#print(type(self)) -if owner and not self.owner.get(): -# print(3*"\n", self.xmeID.get(), "\t\t", owner, "\n", type(self), "\n") -# print(dir(type(self))) - self.owner.set(owner) -# print("\n", self.xmeID.get(), ".owner = ", self.owner.get()) -return NamedElement._specify(self, rev=rev, layer=layer, xmi=xmi, owner=owner) \ No newline at end of file Copied: trunk/src/AeonicXME/specs/m3/code/PackageableElement/_specify.py (from rev 1269, 73/src/AeonicXME/specs/m3/code/PackageableElement/_specify.py) =================================================================== --- trunk/src/AeonicXME/specs/m3/code/PackageableElement/_specify.py (rev 0) +++ trunk/src/AeonicXME/specs/m3/code/PackageableElement/_specify.py 2011-12-26 16:24:01 UTC (rev 1270) @@ -0,0 +1,8 @@ +from XME.M3.Core.Constructs import NamedElement +#print(type(self)) +if owner and not self.owner.get(): +# print(3*"\n", self.xmeID.get(), "\t\t", owner, "\n", type(self), "\n") +# print(dir(type(self))) + self.owner.set(owner) +# print("\n", self.xmeID.get(), ".owner = ", self.owner.get()) +return NamedElement._specify(self, rev=rev, layer=layer, xmi=xmi, owner=owner) \ No newline at end of file Modified: trunk/src/AeonicXME/specs/m3/code/Parameter/_construct.py =================================================================== --- trunk/src/AeonicXME/specs/m3/code/Parameter/_construct.py 2011-12-26 16:13:27 UTC (rev 1269) +++ trunk/src/AeonicXME/specs/m3/code/Parameter/_construct.py 2011-12-26 16:24:01 UTC (rev 1270) @@ -1 +1,19 @@ -pass \ No newline at end of file +from XME.M3.Core.Constructs import Parameter + +classname = self.xmeID.get() +Parameter._log.debug(_("Compiling Parameter instance with XME:ID = {0!s}".format(classname))) +classdeco = "MofParameter._new" +tplClass = """\n\n\n\t\t@%(classdeco)s\n\t\tclass %(classname)s(%(classbase)s):\n\t\t\t%(classdoc)s\n%(metaprops)s""" + +# No generalizations between parameters +classbase = "type" + +# Documentation +# Construct an example docstring +classdoc = '"""test doc"""' + +source = tplClass % { "classdeco" : classdeco, "classname" : classname, "classbase" : classbase, "classdoc" : classdoc, "metaprops" : self._src_metaprops(rev=rev, layer=layer, indent=indent+1) } + +Parameter._log.debug(source) + +return source \ No newline at end of file Modified: trunk/src/AeonicXME/specs/m3/code/Parameter/_specify.py =================================================================== --- trunk/src/AeonicXME/specs/m3/code/Parameter/_specify.py 2011-12-26 16:13:27 UTC (rev 1269) +++ trunk/src/AeonicXME/specs/m3/code/Parameter/_specify.py 2011-12-26 16:24:01 UTC (rev 1270) @@ -1,4 +1,5 @@ -from XME.M3.Core.Constructs import TypedElement, MultiplicityElement +from XME.M3.Core.Constructs import Element, TypedElement, MultiplicityElement self._log.debug(_("Specifying Parameter instance with XMI:ID = {0!s}".format(xmi.get_attribute("xmi:id")))) -return TypedElement._specify(self, rev=rev, layer=layer, xmi=xmi, owner=owner) -#return MultiplicityElement._specify(self, rev=rev, layer=layer, xmi=xmi, owner=owner) # FIXME: super() calls broken? \ No newline at end of file +Element._specify(self, rev=rev, layer=layer, xmi=xmi, owner=owner) +TypedElement._specify(self, rev=rev, layer=layer, xmi=xmi, owner=owner) +return MultiplicityElement._specify(self, rev=rev, layer=layer, xmi=xmi, owner=owner) \ No newline at end of file Modified: trunk/src/AeonicXME/specs/m3/code/Property/_construct.py =================================================================== --- trunk/src/AeonicXME/specs/m3/code/Property/_construct.py 2011-12-26 16:13:27 UTC (rev 1269) +++ trunk/src/AeonicXME/specs/m3/code/Property/_construct.py 2011-12-26 16:24:01 UTC (rev 1270) @@ -1,12 +1,10 @@ -from XME.M3.Core.Constructs import Class, Classifier +from XME.M3.Core.Constructs import Property classname = self.xmeID.get() -Class._log.debug(_("Compiling Property instance with XME:ID = {0!s}".format(classname))) +Property._log.debug(_("Compiling Property instance with XME:ID = {0!s}".format(classname))) classdeco = "MofProperty._new" -tplClass = """\n\t@%(classdeco)s\n\tclass %(classname)s(%(classbase)s):\n\t\t%(classdoc)s\n%(metaprops)s""" +tplClass = """\n\n\n\t@%(classdeco)s\n\tclass %(classname)s(%(classbase)s):\n\t\t%(classdoc)s\n%(metaprops)s""" -parents = [] - # No generalizations between properties classbase = "type" @@ -14,8 +12,8 @@ # Construct an example docstring classdoc = '"""test doc"""' -source = tplClass % { "classdeco" : classdeco, "classname" : classname, "classbase" : classbase, "classdoc" : classdoc, "metaprops" : self._src_metaprops(rev=rev, layer=layer, indent=2) } +source = tplClass % { "classdeco" : classdeco, "classname" : classname, "classbase" : classbase, "classdoc" : classdoc, "metaprops" : self._src_metaprops(rev=rev, layer=layer, indent=indent+1) } -Class._log.debug(source) +Property._log.debug(source) return source \ No newline at end of file Deleted: trunk/src/AeonicXME/specs/m3/code/Property/_specifiy.py =================================================================== --- trunk/src/AeonicXME/specs/m3/code/Property/_specifiy.py 2011-12-26 16:13:27 UTC (rev 1269) +++ trunk/src/AeonicXME/specs/m3/code/Property/_specifiy.py 2011-12-26 16:24:01 UTC (rev 1270) @@ -1,11 +0,0 @@ -from XME.M3.Core.Constructs import TypedElement, MultiplicityElement -self._log.debug(_("Specifying Property instance with XMI:ID = {0!s}".format(xmi.get_attribute("xmi:id")))) -return TypedElement._specify(self, rev=rev, layer=layer, xmi=xmi, owner=owner) -#return MultiplicityElement._specify(self, rev=rev, layer=layer, xmi=xmi, owner=owner) # FIXME: super() calls broken? - -tplAttr = '\n\n\t' + '''@MofProperty._new # %(xmeid)s\n\tclass %(xmeid)s(type):%(metaprops)s''' -attrmetaprops = "" -attrmetaprops += self._spec_metaprops(xmi=xmi, mcl=Property, prefix="\n\t\t") -if attrmetaprops == "": - attrmetaprops = "\n\t\tpass" -return tplAttr % { "xmeid" : Class._rev.xmiID_to_xmeID(xmiID=xmi.get_attribute("xmi:id")), "metaprops" : attrmetaprops } \ No newline at end of file Copied: trunk/src/AeonicXME/specs/m3/code/Property/_specify.py (from rev 1269, 73/src/AeonicXME/specs/m3/code/Property/_specify.py) =================================================================== --- trunk/src/AeonicXME/specs/m3/code/Property/_specify.py (rev 0) +++ trunk/src/AeonicXME/specs/m3/code/Property/_specify.py 2011-12-26 16:24:01 UTC (rev 1270) @@ -0,0 +1,5 @@ +from XME.M3.Core.Constructs import Element, TypedElement, MultiplicityElement +self._log.debug(_("Specifying Property instance with XMI:ID = {0!s}".format(xmi.get_attribute("xmi:id")))) +Element._specify(self, rev=rev, layer=layer, xmi=xmi, owner=owner) +TypedElement._specify(self, rev=rev, layer=layer, xmi=xmi, owner=owner) +return MultiplicityElement._specify(self, rev=rev, layer=layer, xmi=xmi, owner=owner) \ No newline at end of file Deleted: trunk/src/AeonicXME/specs/m3/code/Type/_specify.py =================================================================== --- 73/src/AeonicXME/specs/m3/code/Type/_specify.py 2011-12-26 16:13:27 UTC (rev 1269) +++ trunk/src/AeonicXME/specs/m3/code/Type/_specify.py 2011-12-26 16:24:01 UTC (rev 1270) @@ -1,3 +0,0 @@ -from XME.M3.Core.Constructs import NamedElement, PackageableElement -NamedElement._specify(self, rev=rev, layer=layer, xmi=xmi, owner=owner) -return PackageableElement._specify(self, rev=rev, layer=layer, xmi=xmi, owner=owner) \ No newline at end of file Copied: trunk/src/AeonicXME/specs/m3/code/Type/_specify.py (from rev 1269, 73/src/AeonicXME/specs/m3/code/Type/_specify.py) =================================================================== --- trunk/src/AeonicXME/specs/m3/code/Type/_specify.py (rev 0) +++ trunk/src/AeonicXME/specs/m3/code/Type/_specify.py 2011-12-26 16:24:01 UTC (rev 1270) @@ -0,0 +1,3 @@ +from XME.M3.Core.Constructs import NamedElement, PackageableElement +NamedElement._specify(self, rev=rev, layer=layer, xmi=xmi, owner=owner) +return PackageableElement._specify(self, rev=rev, layer=layer, xmi=xmi, owner=owner) \ No newline at end of file Deleted: trunk/src/AeonicXME/specs/m3/code/ValueSpecification/_specify.py =================================================================== --- 73/src/AeonicXME/specs/m3/code/ValueSpecification/_specify.py 2011-12-26 16:13:27 UTC (rev 1269) +++ trunk/src/AeonicXME/specs/m3/code/ValueSpecification/_specify.py 2011-12-26 16:24:01 UTC (rev 1270) @@ -1,3 +0,0 @@ -from XME.M3.Core.Constructs import TypedElement, PackageableElement -TypedElement._specify(self, rev=rev, layer=layer, xmi=xmi, owner=owner) -return PackageableElement._specify(self, rev=rev, layer=layer, xmi=xmi, owner=owner) \ No newline at end of file Copied: trunk/src/AeonicXME/specs/m3/code/ValueSpecification/_specify.py (from rev 1269, 73/src/AeonicXME/specs/m3/code/ValueSpecification/_specify.py) =================================================================== --- trunk/src/AeonicXME/specs/m3/code/ValueSpecification/_specify.py (rev 0) +++ trunk/src/AeonicXME/specs/m3/code/ValueSpecification/_specify.py 2011-12-26 16:24:01 UTC (rev 1270) @@ -0,0 +1,3 @@ +from XME.M3.Core.Constructs import TypedElement, PackageableElement +TypedElement._specify(self, rev=rev, layer=layer, xmi=xmi, owner=owner) +return PackageableElement._specify(self, rev=rev, layer=layer, xmi=xmi, owner=owner) \ No newline at end of file Modified: trunk/src/AeonicXME/specs/m3/m3patch.cmof =================================================================== --- trunk/src/AeonicXME/specs/m3/m3patch.cmof 2011-12-26 16:13:27 UTC (rev 1269) +++ trunk/src/AeonicXME/specs/m3/m3patch.cmof 2011-12-26 16:24:01 UTC (rev 1270) @@ -5,7 +5,7 @@ <difference xmi:type="xmi:Replace" xmi:id="XME-M3_patch"> <target href="Core"/> - + <difference xmi:type="xmi:Add" xmi:id="XME-M3_patch-Constructs-Element-_new"> <target href="Core-Constructs-Element" /> <addition href="Core-Constructs-Element-_new" /> @@ -283,7 +283,7 @@ <ownedRule xmi:type="cmof:Constraint" xmi:id="Core-Constructs-MultiplicityElement-_specify-spec" name="spec" constrainedElement="Core-Constructs-MultiplicityElement-_specify" namespace="Core-Constructs-MultiplicityElement-_specify"> <specification xmi:type="cmof:OpaqueExpression" xmi:id="Core-Constructs-MultiplicityElement-_specify-spec-specification"> <language>Python 3.2</language> - <body><include src="code/Class/_specify.py" /></body> + <body><include src="code/MultiplicityElement/_specify.py" /></body> </specification> </ownedRule> <ownedParameter name="rev" xmi:type="cmof:Parameter" xmi:id="Core-Constructs-MultiplicityElement-_specify-_ownedParameter.1" direction="in"> @@ -319,7 +319,7 @@ <ownedRule xmi:type="cmof:Constraint" xmi:id="Core-Constructs-TypedElement-_specify-spec" name="spec" constrainedElement="Core-Constructs-TypedElement-_specify" namespace="Core-Constructs-TypedElement-_specify"> <specification xmi:type="cmof:OpaqueExpression" xmi:id="Core-Constructs-TypedElement-_specify-spec-specification"> <language>Python 3.2</language> - <body><include src="code/Class/_specify.py" /></body> + <body><include src="code/TypedElement/_specify.py" /></body> </specification> </ownedRule> <ownedParameter name="rev" xmi:type="cmof:Parameter" xmi:id="Core-Constructs-TypedElement-_specify-_ownedParameter.1" direction="in"> @@ -345,6 +345,78 @@ </ownedOperation> </difference> + <difference xmi:type="xmi:Add" xmi:id="XME-M3_patch-Constructs-PackageableElement-_specify"> + <target href="Core-Constructs-PackageableElement" /> + <addition href="Core-Constructs-PackageableElement-_specify" /> + <ownedOperation xmi:type="cmof:Operation" xmi:id="Core-Constructs-PackageableElement-_specify" name="_specify" class="Core-Constructs-PackageableElement" bodyCondition="Core-Constructs-PackageableElement-_specify-spec"> + <ownedComment xmi:type="cmof:Comment" xmi:id="Core-Constructs-PackageableElement-_specify-spec-_ownedComment.0" annotatedElement="Core-Constructs-PackageableElement-_specify"> + <body>A decorator that is used to add a new metaclass to the UML layer, that may be extended by merging with metaclasses with the same name in other parts.</body> + </ownedComment> + <ownedRule xmi:type="cmof:Constraint" xmi:id="Core-Constructs-PackageableElement-_specify-spec" name="spec" constrainedElement="Core-Constructs-PackageableElement-_specify" namespace="Core-Constructs-PackageableElement-_specify"> + <specification xmi:type="cmof:OpaqueExpression" xmi:id="Core-Constructs-PackageableElement-_specify-spec-specification"> + <language>Python 3.2</language> + <body><include src="code/PackageableElement/_specify.py" /></body> + </specification> + </ownedRule> + <ownedParameter name="rev" xmi:type="cmof:Parameter" xmi:id="Core-Constructs-PackageableElement-_specify-_ownedParameter.1" direction="in"> + <ownedComment xmi:type="cmof:Comment" xmi:id="Core-Constructs-PackageableElement-_specify-_ownedComment.1" annotatedElement="Core-Constructs-PackageableElement-_specify-_ownedParameter.1"> + <body>The revision to which this element belongs.</body> + </ownedComment> + </ownedParameter> + <ownedParameter name="layer" xmi:type="cmof:Parameter" xmi:id="Core-Constructs-PackageableElement-_specify-_ownedParameter.2" direction="in"> + <ownedComment xmi:type="cmof:Comment" xmi:id="Core-Constructs-PackageableElement-_specify-_ownedComment.2" annotatedElement="Core-Constructs-PackageableElement-_specify-_ownedParameter.2"> + <body>The layer to which this element belongs.</body> + </ownedComment> + </ownedParameter> + <ownedParameter name="xmi" xmi:type="cmof:Parameter" xmi:id="Core-Constructs-PackageableElement-_specify-_ownedParameter.3" direction="in"> + <ownedComment xmi:type="cmof:Comment" xmi:id="Core-Constructs-PackageableElement-_specify-_ownedComment.3" annotatedElement="Core-Constructs-PackageableElement-_specify-_ownedParameter.3"> + <body>The XMI-element to process for this element.</body> + </ownedComment> + </ownedParameter> + <ownedParameter name="owner" xmi:type="cmof:Parameter" xmi:id="Core-Constructs-PackageableElement-_specify-_ownedParameter.4" direction="in" type="Core-PrimitiveTypes-String"> + <ownedComment xmi:type="cmof:Comment" xmi:id="Core-Constructs-PackageableElement-_specify-_ownedComment.4" annotatedElement="Core-Constructs-PackageableElement-_specify-_ownedParameter.4"> + <body>The XME-ID of the owner element of this element.</body> + </ownedComment> + </ownedParameter> + </ownedOperation> + </difference> + + <difference xmi:type="xmi:Add" xmi:id="XME-M3_patch-Constructs-ValueSpecification-_specify"> + <target href="Core-Constructs-ValueSpecification" /> + <addition href="Core-Constructs-ValueSpecification-_specify" /> + <ownedOperation xmi:type="cmof:Operation" xmi:id="Core-Constructs-ValueSpecification-_specify" name="_specify" class="Core-Constructs-ValueSpecification" bodyCondition="Core-Constructs-ValueSpecification-_specify-spec"> + <ownedComment xmi:type="cmof:Comment" xmi:id="Core-Constructs-ValueSpecification-_specify-spec-_ownedComment.0" annotatedElement="Core-Constructs-ValueSpecification-_specify"> + <body>A decorator that is used to add a new metaclass to the UML layer, that may be extended by merging with metaclasses with the same name in other parts.</body> + </ownedComment> + <ownedRule xmi:type="cmof:Constraint" xmi:id="Core-Constructs-ValueSpecification-_specify-spec" name="spec" constrainedElement="Core-Constructs-ValueSpecification-_specify" namespace="Core-Constructs-ValueSpecification-_specify"> + <specification xmi:type="cmof:OpaqueExpression" xmi:id="Core-Constructs-ValueSpecification-_specify-spec-specification"> + <language>Python 3.2</language> + <body><include src="code/ValueSpecification/_specify.py" /></body> + </specification> + </ownedRule> + <ownedParameter name="rev" xmi:type="cmof:Parameter" xmi:id="Core-Constructs-ValueSpecification-_specify-_ownedParameter.1" direction="in"> + <ownedComment xmi:type="cmof:Comment" xmi:id="Core-Constructs-ValueSpecification-_specify-_ownedComment.1" annotatedElement="Core-Constructs-ValueSpecification-_specify-_ownedParameter.1"> + <body>The revision to which this element belongs.</body> + </ownedComment> + </ownedParameter> + <ownedParameter name="layer" xmi:type="cmof:Parameter" xmi:id="Core-Constructs-ValueSpecification-_specify-_ownedParameter.2" direction="in"> + <ownedComment xmi:type="cmof:Comment" xmi:id="Core-Constructs-ValueSpecification-_specify-_ownedComment.2" annotatedElement="Core-Constructs-ValueSpecification-_specify-_ownedParameter.2"> + <body>The layer to which this element belongs.</body> + </ownedComment> + </ownedParameter> + <ownedParameter name="xmi" xmi:type="cmof:Parameter" xmi:id="Core-Constructs-ValueSpecification-_specify-_ownedParameter.3" direction="in"> + <ownedComment xmi:type="cmof:Comment" xmi:id="Core-Constructs-ValueSpecification-_specify-_ownedComment.3" annotatedElement="Core-Constructs-ValueSpecification-_specify-_ownedParameter.3"> + <body>The XMI-element to process for this element.</body> + </ownedComment> + </ownedParameter> + <ownedParameter name="owner" xmi:type="cmof:Parameter" xmi:id="Core-Constructs-ValueSpecification-_specify-_ownedParameter.4" direction="in" type="Core-PrimitiveTypes-String"> + <ownedComment xmi:type="cmof:Comment" xmi:id="Core-Constructs-ValueSpecification-_specify-_ownedComment.4" annotatedElement="Core-Constructs-ValueSpecification-_specify-_ownedParameter.4"> + <body>The XME-ID of the owner element of this element.</body> + </ownedComment> + </ownedParameter> + </ownedOperation> + </difference> + <difference xmi:type="xmi:Add" xmi:id="XME-M3_patch-Constructs-Package-_new"> <target href="Core-Constructs-Package" /> <addition href="Core-Constructs-Package-_new" /> @@ -446,6 +518,11 @@ <body>The layer to which this element belongs.</body> </ownedComment> </ownedParameter> + <ownedParameter name="indent" xmi:type="cmof:Parameter" xmi:id="Core-Constructs-Package-_construct-_ownedParameter.3" direction="in"> + <ownedComment xmi:type="cmof:Comment" xmi:id="Core-Constructs-Package-_construct-_ownedComment.3" annotatedElement="Core-Constructs-Package-_construct-_ownedParameter.3"> + <body>The number of indents to prefix for every line that represents a meta-property of this element. For example indent=2 will produce \n\t\t_name_ = "example"</body> + </ownedComment> + </ownedParameter> </ownedOperation> </difference> @@ -506,7 +583,7 @@ </ownedParameter> <ownedParameter name="xmi" xmi:type="cmof:Parameter" xmi:id="Core-Constructs-Class-_specify-_ownedParameter.3" direction="in"> <ownedComment xmi:type="cmof:Comment" xmi:id="Core-Constructs-Class-_specify-_ownedComment.3" annotatedElement="Core-Constructs-Class-_specify-_ownedParameter.3"> - <body>The XMI-element to process for this element.</body> + <body>The XMI-element to process for this element.</body> </ownedComment> </ownedParameter> <ownedParameter name="owner" xmi:type="cmof:Parameter" xmi:id="Core-Constructs-Class-_specify-_ownedParameter.4" direction="in" type="Core-PrimitiveTypes-String"> @@ -540,6 +617,11 @@ <body>The layer to which this element belongs.</body> </ownedComment> </ownedParameter> + <ownedParameter name="indent" xmi:type="cmof:Parameter" xmi:id="Core-Constructs-Class-_construct-_ownedParameter.3" direction="in"> + <ownedComment xmi:type="cmof:Comment" xmi:id="Core-Constructs-Class-_construct-_ownedComment.3" annotatedElement="Core-Constructs-Class-_construct-_ownedParameter.3"> + <body>The number of indents to prefix for every line that represents a meta-property of this element. For example indent=2 will produce \n\t\t_name_ = "example"</body> + </ownedComment> + </ownedParameter> </ownedOperation> </difference> @@ -569,7 +651,7 @@ <ownedRule xmi:type="cmof:Constraint" xmi:id="Core-Constructs-Property-_specify-spec" name="spec" constrainedElement="Core-Constructs-Property-_specify" namespace="Core-Constructs-Property-_specify"> <specification xmi:type="cmof:OpaqueExpression" xmi:id="Core-Constructs-Property-_specify-spec-specification"> <language>Python 3.2</langu... [truncated message content] |
From: <ah...@us...> - 2011-12-26 16:13:33
|
Revision: 1269 http://aeonic.svn.sourceforge.net/aeonic/?rev=1269&view=rev Author: ahatzis Date: 2011-12-26 16:13:27 +0000 (Mon, 26 Dec 2011) Log Message: ----------- belongs to r1267 Revision Links: -------------- http://aeonic.svn.sourceforge.net/aeonic/?rev=1267&view=rev Added Paths: ----------- 73/src/AeonicXME/specs/m3/code/Type/ 73/src/AeonicXME/specs/m3/code/Type/_specify.py Added: 73/src/AeonicXME/specs/m3/code/Type/_specify.py =================================================================== --- 73/src/AeonicXME/specs/m3/code/Type/_specify.py (rev 0) +++ 73/src/AeonicXME/specs/m3/code/Type/_specify.py 2011-12-26 16:13:27 UTC (rev 1269) @@ -0,0 +1,3 @@ +from XME.M3.Core.Constructs import NamedElement, PackageableElement +NamedElement._specify(self, rev=rev, layer=layer, xmi=xmi, owner=owner) +return PackageableElement._specify(self, rev=rev, layer=layer, xmi=xmi, owner=owner) \ No newline at end of file Property changes on: 73/src/AeonicXME/specs/m3/code/Type/_specify.py ___________________________________________________________________ Added: svn:keywords + Id This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ah...@us...> - 2011-12-26 16:11:49
|
Revision: 1268 http://aeonic.svn.sourceforge.net/aeonic/?rev=1268&view=rev Author: ahatzis Date: 2011-12-26 16:11:43 +0000 (Mon, 26 Dec 2011) Log Message: ----------- Removed Paths: ------------- 73/src/AeonicXME/specs/m3/code/TypedElement/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ah...@us...> - 2011-12-26 16:04:10
|
Revision: 1267 http://aeonic.svn.sourceforge.net/aeonic/?rev=1267&view=rev Author: ahatzis Date: 2011-12-26 16:04:02 +0000 (Mon, 26 Dec 2011) Log Message: ----------- implemented #73, operations now have constraints and opaque-expressions; however, the produced source code of M2 can be parsed by the Python interpreter and all tests run OK, but the operations can not be executed yet In details: * added constraints and opaque-expressions as part of the produced M2 source code * added methods `M3::OpaqueExpression::_construct` and `M3::OpaqueExpression::_specify` * added methods `M3::Constraint::_construct` and `M3::Constraint::_specify` * added methods `M3::PackageableElement::_specify`, M3::ValueSpecification::_specify` * string-type meta-properties in produced M2 source code now are in tripple-quotes, so `M3::OpaqueExpression::body` can be multi-line * refactored super-calls in most of the `_specify()` methods * improved readability of M2 source coded produced by default M3 * includes bug-fixes #89 and #90 Modified Paths: -------------- 73/src/AeonicXME/__init__.py 73/src/AeonicXME/specs/m3/code/Class/_construct.py 73/src/AeonicXME/specs/m3/code/Class/_specify.py 73/src/AeonicXME/specs/m3/code/Classifier/_specify.py 73/src/AeonicXME/specs/m3/code/Element/_specify.py 73/src/AeonicXME/specs/m3/code/Element/_src_metaprops.py 73/src/AeonicXME/specs/m3/code/MultiplicityElement/_specify.py 73/src/AeonicXME/specs/m3/code/NamedElement/_specify.py 73/src/AeonicXME/specs/m3/code/Operation/_construct.py 73/src/AeonicXME/specs/m3/code/Operation/_specify.py 73/src/AeonicXME/specs/m3/code/Package/_construct.py 73/src/AeonicXME/specs/m3/code/Package/_registerModule.py 73/src/AeonicXME/specs/m3/code/Package/_specify.py 73/src/AeonicXME/specs/m3/code/Parameter/_construct.py 73/src/AeonicXME/specs/m3/code/Parameter/_specify.py 73/src/AeonicXME/specs/m3/code/Property/_construct.py 73/src/AeonicXME/specs/m3/code/Property/_specify.py 73/src/AeonicXME/specs/m3/m3patch.cmof Added Paths: ----------- 73/src/AeonicXME/specs/m3/code/Comment/ 73/src/AeonicXME/specs/m3/code/Comment/_specify.py 73/src/AeonicXME/specs/m3/code/Constraint/ 73/src/AeonicXME/specs/m3/code/Constraint/_construct.py 73/src/AeonicXME/specs/m3/code/Constraint/_specify.py 73/src/AeonicXME/specs/m3/code/OpaqueExpression/ 73/src/AeonicXME/specs/m3/code/OpaqueExpression/_construct.py 73/src/AeonicXME/specs/m3/code/OpaqueExpression/_specify.py 73/src/AeonicXME/specs/m3/code/PackageableElement/ 73/src/AeonicXME/specs/m3/code/PackageableElement/_specify.py 73/src/AeonicXME/specs/m3/code/ValueSpecification/ 73/src/AeonicXME/specs/m3/code/ValueSpecification/_specify.py Modified: 73/src/AeonicXME/__init__.py =================================================================== --- 73/src/AeonicXME/__init__.py 2011-12-26 14:30:56 UTC (rev 1266) +++ 73/src/AeonicXME/__init__.py 2011-12-26 16:04:02 UTC (rev 1267) @@ -144,7 +144,7 @@ }, } -DEBUG = False +DEBUG = True __all__ = [ "constructions", "utils" Modified: 73/src/AeonicXME/specs/m3/code/Class/_construct.py =================================================================== --- 73/src/AeonicXME/specs/m3/code/Class/_construct.py 2011-12-26 14:30:56 UTC (rev 1266) +++ 73/src/AeonicXME/specs/m3/code/Class/_construct.py 2011-12-26 16:04:02 UTC (rev 1267) @@ -3,7 +3,7 @@ classname = self.xmeID.get() Class._log.debug(_("Compiling Class instance with XME:ID = {0!s}".format(classname))) classdeco = "MofClass._new" -tplClass = """\nfrom XME.M3.Core.Constructs import Class as MofClass\n\n@%(classdeco)s\nclass %(classname)s(%(classbase)s):\n%(classdoc)s\n\tfrom XME.M3.Core.Constructs import Property as MofProperty\n\tfrom XME.M3.Core.Constructs import Operation as MofOperation\n\tfrom XME.M3.Core.Constructs import OpaqueExpression as MofOpaqueExpression\n%(metaprops)s\n%(attributes)s\n%(operations)s""" +tplClass = """\n\n\n@%(classdeco)s\nclass %(classname)s(%(classbase)s):\n%(classdoc)s\n\tfrom XME.M3.Core.Constructs import Property as MofProperty\n\tfrom XME.M3.Core.Constructs import Operation as MofOperation\n%(metaprops)s%(attributes)s%(operations)s""" parents = [] #if xmi.has_attribute("superClass"): # TODO: eventually this one can be done by MofClass._new decorating the UML meta-class Modified: 73/src/AeonicXME/specs/m3/code/Class/_specify.py =================================================================== --- 73/src/AeonicXME/specs/m3/code/Class/_specify.py 2011-12-26 14:30:56 UTC (rev 1266) +++ 73/src/AeonicXME/specs/m3/code/Class/_specify.py 2011-12-26 16:04:02 UTC (rev 1267) @@ -1,3 +1,4 @@ -from XME.M3.Core.Constructs import Classifier +from XME.M3.Core.Constructs import Element, Classifier self._log.debug(_("Specifying Class instance with XMI:ID = {0!s}".format(xmi.get_attribute("xmi:id")))) +Element._specify(self, rev=rev, layer=layer, xmi=xmi, owner=owner) return Classifier._specify(self, rev=rev, layer=layer, xmi=xmi, owner=owner) \ No newline at end of file Modified: 73/src/AeonicXME/specs/m3/code/Classifier/_specify.py =================================================================== --- 73/src/AeonicXME/specs/m3/code/Classifier/_specify.py 2011-12-26 14:30:56 UTC (rev 1266) +++ 73/src/AeonicXME/specs/m3/code/Classifier/_specify.py 2011-12-26 16:04:02 UTC (rev 1267) @@ -1,3 +1,3 @@ -from XME.M3.Core.Constructs import Namespace -self._log.debug(_("Specifying Classifier instance with XMI:ID = {0!s}".format(xmi.get_attribute("xmi:id")))) -return Namespace._specify(self, rev=rev, layer=layer, xmi=xmi, owner=owner) \ No newline at end of file +from XME.M3.Core.Constructs import Namespace, Type +Namespace._specify(self, rev=rev, layer=layer, xmi=xmi, owner=owner) # FIXME: super() calls broken? +return Type._specify(self, rev=rev, layer=layer, xmi=xmi, owner=owner) # FIXME: super() calls broken? Added: 73/src/AeonicXME/specs/m3/code/Comment/_specify.py =================================================================== --- 73/src/AeonicXME/specs/m3/code/Comment/_specify.py (rev 0) +++ 73/src/AeonicXME/specs/m3/code/Comment/_specify.py 2011-12-26 16:04:02 UTC (rev 1267) @@ -0,0 +1,3 @@ +from XME.M3.Core.Constructs import Element +self._log.debug(_("Specifying Comment instance with XMI:ID = {0!s}".format(xmi.get_attribute("xmi:id")))) +return Element._specify(self, rev=rev, layer=layer, xmi=xmi, owner=owner) \ No newline at end of file Property changes on: 73/src/AeonicXME/specs/m3/code/Comment/_specify.py ___________________________________________________________________ Added: svn:keywords + Id Added: 73/src/AeonicXME/specs/m3/code/Constraint/_construct.py =================================================================== --- 73/src/AeonicXME/specs/m3/code/Constraint/_construct.py (rev 0) +++ 73/src/AeonicXME/specs/m3/code/Constraint/_construct.py 2011-12-26 16:04:02 UTC (rev 1267) @@ -0,0 +1,25 @@ +from XME.M3.Core.Constructs import Constraint + +classname = self.xmeID.get() +Constraint._log.debug(_("Compiling Constraint instance with XME:ID = {0!s}".format(classname))) +classdeco = "MofConstraint._new" +tplClass = """\n\n\n\t\t@%(classdeco)s\n\t\tclass %(classname)s(%(classbase)s):\n\t\t\t%(classdoc)s\n\t\t\tfrom XME.M3.Core.Constructs import OpaqueExpression as MofOpaqueExpression\n%(metaprops)s%(specification)s""" + +# No generalizations between parameters +classbase = "type" + +# Documentation +# Construct an example docstring +classdoc = '"""test doc"""' + +# Construct specification owned by the UML metaclass +specification = "" +if self.specification.get(): + s = layer.get_constructor_by_ID(xmeID=self.specification.get()) + specification += s._construct(rev=rev, layer=layer, indent=indent+1) + +source = tplClass % { "classdeco" : classdeco, "classname" : classname, "classbase" : classbase, "classdoc" : classdoc, "metaprops" : self._src_metaprops(rev=rev, layer=layer, indent=indent+1), "specification" : specification } + +Constraint._log.debug(source) + +return source \ No newline at end of file Property changes on: 73/src/AeonicXME/specs/m3/code/Constraint/_construct.py ___________________________________________________________________ Added: svn:keywords + Id Added: 73/src/AeonicXME/specs/m3/code/Constraint/_specify.py =================================================================== --- 73/src/AeonicXME/specs/m3/code/Constraint/_specify.py (rev 0) +++ 73/src/AeonicXME/specs/m3/code/Constraint/_specify.py 2011-12-26 16:04:02 UTC (rev 1267) @@ -0,0 +1,4 @@ +from XME.M3.Core.Constructs import Element, NamedElement +self._log.debug(_("Specifying Constraint instance with XMI:ID = {0!s}".format(xmi.get_attribute("xmi:id")))) +Element._specify(self, rev=rev, layer=layer, xmi=xmi, owner=owner) +return NamedElement._specify(self, rev=rev, layer=layer, xmi=xmi, owner=owner) Property changes on: 73/src/AeonicXME/specs/m3/code/Constraint/_specify.py ___________________________________________________________________ Added: svn:keywords + Id Modified: 73/src/AeonicXME/specs/m3/code/Element/_specify.py =================================================================== --- 73/src/AeonicXME/specs/m3/code/Element/_specify.py 2011-12-26 14:30:56 UTC (rev 1266) +++ 73/src/AeonicXME/specs/m3/code/Element/_specify.py 2011-12-26 16:04:02 UTC (rev 1267) @@ -1,22 +1,25 @@ from AeonicXME.constructions import Property as PropertyDescriptor -from XME.M3.Core.Constructs import Element, Class, Package, Property, Operation, Parameter #, Association, Comment, Constraint, Enumeration, EnumerationLiteral, OpaqueExpression, PackageImport, DataType, PrimitiveType, +from XME.M3.Core.Constructs import Element, Class, Package, Property, Operation, Parameter, Constraint, OpaqueExpression, ValueSpecification, TypedElement, PackageableElement, Association, Comment, Enumeration, EnumerationLiteral, PackageImport, DataType, PrimitiveType +if self.xmeID.get(): + return self.xmeID.get() + # dictionary of type names (from XMI) as key and the corresponding constructor class as value (non-abstract only) supported_constructor = { # "cmof:Association" : Association, "cmof:Class" : Class, -# "cmof:Comment" : Comment, -# "cmof:Constraint" : Constraint, -# "cmof:Enumeration" : Enumeration, -# "cmof:EnumerationLiteral" : EnumerationLiteral, -# "cmof:OpaqueExpression" : OpaqueExpression, + "cmof:Comment" : Comment, + "cmof:Constraint" : Constraint, + "cmof:Enumeration" : Enumeration, + "cmof:EnumerationLiteral" : EnumerationLiteral, + "cmof:OpaqueExpression" : OpaqueExpression, "cmof:Operation" : Operation, "cmof:Package" : Package, -# "cmof:PackageImport" : PackageImport, + "cmof:PackageImport" : PackageImport, "cmof:Parameter" : Parameter, "cmof:Property" : Property, -# "cmof:DataType": DataType, -# "cmof:PrimitiveType": PrimitiveType, + "cmof:DataType": DataType, + "cmof:PrimitiveType": PrimitiveType, # "xmi:Add" : AddUpdater, # "xmi:Delete" : DeleteUpdater, # "xmi:Replace" : ReplaceUpdater, @@ -55,11 +58,8 @@ else: Element._log.error("In M2 layer found instance with no XMI:ID, incomplete XMI = {0!s}").format(xmi.to_XML(collapsed=True)) # TODO: tolerate or raise error? -self._log.debug(_("Specifying instance with XMI:ID = {0!s}".format(self.xmeID.get()))) +#self._log.debug(_("Specifying instance with XME:ID = {0!s}".format(self.xmeID.get()))) -if owner: - self.owner.set(owner) - if xmi.has_attribute("xmi:type"): mclassID = rev.m3.mclassAlias[xmi.get_attribute("xmi:type")[5:]] else: @@ -258,7 +258,7 @@ if xmi.has_attribute(memberName) and xmi.get_attribute(memberName) is not None: _spec_ownedAttribute(self, rev=rev, layer=layer, propValue=propValue, prop=memberValue, value=xmi.get_attribute(memberName)) elif memberName in xmi.childElement: - for child in xmi.childElement[property]: + for child in xmi.childElement[memberName]: _spec_ownedAttribute(self, rev=rev, layer=layer, propValue=propValue, prop=memberValue, value=child.text) elif memberValue._metaProperty["default"] is not None: _spec_ownedAttribute(self, rev=rev, layer=layer, propValue=propValue, prop=memberValue, value=memberValue._metaProperty["default"]) Modified: 73/src/AeonicXME/specs/m3/code/Element/_src_metaprops.py =================================================================== --- 73/src/AeonicXME/specs/m3/code/Element/_src_metaprops.py 2011-12-26 14:30:56 UTC (rev 1266) +++ 73/src/AeonicXME/specs/m3/code/Element/_src_metaprops.py 2011-12-26 16:04:02 UTC (rev 1267) @@ -47,7 +47,7 @@ cvalue = str(value) elif typeID == idString: if value is not None: - cvalue = '"' + value + '"' + cvalue = '"""' + value + '"""' # allow multi-line strings, e.g. in OpaqueExpression::body else: if value is not None: cvalue = '"' + value + '"' # treat XME:ID as string Modified: 73/src/AeonicXME/specs/m3/code/MultiplicityElement/_specify.py =================================================================== --- 73/src/AeonicXME/specs/m3/code/MultiplicityElement/_specify.py 2011-12-26 14:30:56 UTC (rev 1266) +++ 73/src/AeonicXME/specs/m3/code/MultiplicityElement/_specify.py 2011-12-26 16:04:02 UTC (rev 1267) @@ -1,2 +1,2 @@ from XME.M3.Core.Constructs import Element -return Element._specify(self, rev=rev, layer=layer, xmi=xmi, owner=owner) \ No newline at end of file +return self.xmeID.get() \ No newline at end of file Modified: 73/src/AeonicXME/specs/m3/code/NamedElement/_specify.py =================================================================== --- 73/src/AeonicXME/specs/m3/code/NamedElement/_specify.py 2011-12-26 14:30:56 UTC (rev 1266) +++ 73/src/AeonicXME/specs/m3/code/NamedElement/_specify.py 2011-12-26 16:04:02 UTC (rev 1267) @@ -1,2 +1,2 @@ from XME.M3.Core.Constructs import Element -return Element._specify(self, rev=rev, layer=layer, xmi=xmi, owner=owner) \ No newline at end of file +return self.xmeID.get() \ No newline at end of file Added: 73/src/AeonicXME/specs/m3/code/OpaqueExpression/_construct.py =================================================================== --- 73/src/AeonicXME/specs/m3/code/OpaqueExpression/_construct.py (rev 0) +++ 73/src/AeonicXME/specs/m3/code/OpaqueExpression/_construct.py 2011-12-26 16:04:02 UTC (rev 1267) @@ -0,0 +1,23 @@ +from XME.M3.Core.Constructs import OpaqueExpression + +classname = self.xmeID.get() +OpaqueExpression._log.debug(_("Compiling OpaqueExpression instance with XME:ID = {0!s}".format(classname))) +classdeco = "MofOpaqueExpression._new" +tplClass = """\n\n\t\t\t@%(classdeco)s\n\t\t\tclass %(classname)s(%(classbase)s):\n\t\t\t\t%(classdoc)s\n%(metaprops)s""" + +# No generalizations between parameters +classbase = "type" + +# Documentation +# Construct an example docstring +classdoc = '"""test doc"""' + +# Construct body: +if not self.language[0].startswith('Python3.'): + self.body[0] = 'raise OpaqueExpression._errors.NotImplementedError(raiser=self, name="{0!s}")'.format(self.owner.get()) + +source = tplClass % { "classdeco" : classdeco, "classname" : classname, "classbase" : classbase, "classdoc" : classdoc, "metaprops" : self._src_metaprops(rev=rev, layer=layer, indent=indent+1) } + +OpaqueExpression._log.debug(source) + +return source \ No newline at end of file Property changes on: 73/src/AeonicXME/specs/m3/code/OpaqueExpression/_construct.py ___________________________________________________________________ Added: svn:keywords + Id Added: 73/src/AeonicXME/specs/m3/code/OpaqueExpression/_specify.py =================================================================== --- 73/src/AeonicXME/specs/m3/code/OpaqueExpression/_specify.py (rev 0) +++ 73/src/AeonicXME/specs/m3/code/OpaqueExpression/_specify.py 2011-12-26 16:04:02 UTC (rev 1267) @@ -0,0 +1,4 @@ +from XME.M3.Core.Constructs import Element, ValueSpecification +self._log.debug(_("Specifying OpaqueExpression instance with XMI:ID = {0!s}".format(xmi.get_attribute("xmi:id")))) +Element._specify(self, rev=rev, layer=layer, xmi=xmi, owner=owner) +return ValueSpecification._specify(self, rev=rev, layer=layer, xmi=xmi, owner=owner) \ No newline at end of file Property changes on: 73/src/AeonicXME/specs/m3/code/OpaqueExpression/_specify.py ___________________________________________________________________ Added: svn:keywords + Id Modified: 73/src/AeonicXME/specs/m3/code/Operation/_construct.py =================================================================== --- 73/src/AeonicXME/specs/m3/code/Operation/_construct.py 2011-12-26 14:30:56 UTC (rev 1266) +++ 73/src/AeonicXME/specs/m3/code/Operation/_construct.py 2011-12-26 16:04:02 UTC (rev 1267) @@ -1,9 +1,9 @@ from XME.M3.Core.Constructs import Operation classname = self.xmeID.get() -Operation._log.info(_("Compiling Operation instance with XME:ID = {0!s}".format(classname))) +Operation._log.debug(_("Compiling Operation instance with XME:ID = {0!s}".format(classname))) classdeco = "MofOperation._new" -tplClass = """\n\t@%(classdeco)s\n\tclass %(classname)s(%(classbase)s):\n\t\t%(classdoc)s\n\t\tfrom XME.M3.Core.Constructs import Parameter as MofParameter\n\t\tfrom XME.M3.Core.Constructs import Constraint as MofConstraint\n%(metaprops)s\n%(parameters)s""" +tplClass = """\n\n\n\t@%(classdeco)s\n\tclass %(classname)s(%(classbase)s):\n\t\t%(classdoc)s\n\t\tfrom XME.M3.Core.Constructs import Parameter as MofParameter\n\t\tfrom XME.M3.Core.Constructs import Constraint as MofConstraint\n%(metaprops)s%(parameters)s%(constraints)s""" # No generalizations between operations classbase = "type" @@ -18,8 +18,14 @@ p = layer.get_constructor_by_ID(xmeID=cref) parameters += p._construct(rev=rev, layer=layer, indent=indent+1) -source = tplClass % { "classdeco" : classdeco, "classname" : classname, "classbase" : classbase, "classdoc" : classdoc, "metaprops" : self._src_metaprops(rev=rev, layer=layer, indent=indent+1), "parameters" : parameters } +# Construct constraints owned by the UML metaclass +constraints = "" +for cref in self.ownedRule: + c = layer.get_constructor_by_ID(xmeID=cref) + constraints += c._construct(rev=rev, layer=layer, indent=indent+1) +source = tplClass % { "classdeco" : classdeco, "classname" : classname, "classbase" : classbase, "classdoc" : classdoc, "metaprops" : self._src_metaprops(rev=rev, layer=layer, indent=indent+1), "parameters" : parameters, "constraints" : constraints } + Operation._log.debug(source) return source Modified: 73/src/AeonicXME/specs/m3/code/Operation/_specify.py =================================================================== --- 73/src/AeonicXME/specs/m3/code/Operation/_specify.py 2011-12-26 14:30:56 UTC (rev 1266) +++ 73/src/AeonicXME/specs/m3/code/Operation/_specify.py 2011-12-26 16:04:02 UTC (rev 1267) @@ -1,3 +1,4 @@ -from XME.M3.Core.Constructs import Namespace +from XME.M3.Core.Constructs import Element, Namespace self._log.debug(_("Specifying Operation instance with XMI:ID = {0!s}".format(xmi.get_attribute("xmi:id")))) +Element._specify(self, rev=rev, layer=layer, xmi=xmi, owner=owner) return Namespace._specify(self, rev=rev, layer=layer, xmi=xmi, owner=owner) \ No newline at end of file Modified: 73/src/AeonicXME/specs/m3/code/Package/_construct.py =================================================================== --- 73/src/AeonicXME/specs/m3/code/Package/_construct.py 2011-12-26 14:30:56 UTC (rev 1266) +++ 73/src/AeonicXME/specs/m3/code/Package/_construct.py 2011-12-26 16:04:02 UTC (rev 1267) @@ -9,7 +9,7 @@ source += c._construct(rev=rev, layer=layer, indent=0) if source != "": source = "\n\nfrom XME.M3.Core.Constructs import Class as MofClass" + source -print("\n", 100*"=", "\n", self.xmeID.get(), " \n", 100*"-", "\n", source, "\n", 100*"=") +#print("\n", 100*"=", "\n", self.xmeID.get(), " \n", 100*"-", "\n", source, "\n", 100*"=") import tempfile, os from AeonicXME import DEBUG if DEBUG: Modified: 73/src/AeonicXME/specs/m3/code/Package/_registerModule.py =================================================================== --- 73/src/AeonicXME/specs/m3/code/Package/_registerModule.py 2011-12-26 14:30:56 UTC (rev 1266) +++ 73/src/AeonicXME/specs/m3/code/Package/_registerModule.py 2011-12-26 16:04:02 UTC (rev 1267) @@ -1,5 +1,6 @@ import types if self.name.get() is None: + self._log.error(_("Cannot register module with-out name: {0!s}").format(self.xmeID.get())) return else: module_name = self._python_qualifiedName(rev=rev, layer=layer) Modified: 73/src/AeonicXME/specs/m3/code/Package/_specify.py =================================================================== --- 73/src/AeonicXME/specs/m3/code/Package/_specify.py 2011-12-26 14:30:56 UTC (rev 1266) +++ 73/src/AeonicXME/specs/m3/code/Package/_specify.py 2011-12-26 16:04:02 UTC (rev 1267) @@ -1,3 +1,5 @@ -from XME.M3.Core.Constructs import Namespace +from XME.M3.Core.Constructs import Element, Namespace, PackageableElement self._log.debug(_("Specifying Package instance with XMI:ID = {0!s}".format(xmi.get_attribute("xmi:id")))) -return Namespace._specify(self, rev=rev, layer=layer, xmi=xmi, owner=owner) \ No newline at end of file +Element._specify(self, rev=rev, layer=layer, xmi=xmi, owner=owner) +Namespace._specify(self, rev=rev, layer=layer, xmi=xmi, owner=owner) +return PackageableElement._specify(self, rev=rev, layer=layer, xmi=xmi, owner=owner) \ No newline at end of file Added: 73/src/AeonicXME/specs/m3/code/PackageableElement/_specify.py =================================================================== --- 73/src/AeonicXME/specs/m3/code/PackageableElement/_specify.py (rev 0) +++ 73/src/AeonicXME/specs/m3/code/PackageableElement/_specify.py 2011-12-26 16:04:02 UTC (rev 1267) @@ -0,0 +1,8 @@ +from XME.M3.Core.Constructs import NamedElement +#print(type(self)) +if owner and not self.owner.get(): +# print(3*"\n", self.xmeID.get(), "\t\t", owner, "\n", type(self), "\n") +# print(dir(type(self))) + self.owner.set(owner) +# print("\n", self.xmeID.get(), ".owner = ", self.owner.get()) +return NamedElement._specify(self, rev=rev, layer=layer, xmi=xmi, owner=owner) \ No newline at end of file Property changes on: 73/src/AeonicXME/specs/m3/code/PackageableElement/_specify.py ___________________________________________________________________ Added: svn:keywords + Id Modified: 73/src/AeonicXME/specs/m3/code/Parameter/_construct.py =================================================================== --- 73/src/AeonicXME/specs/m3/code/Parameter/_construct.py 2011-12-26 14:30:56 UTC (rev 1266) +++ 73/src/AeonicXME/specs/m3/code/Parameter/_construct.py 2011-12-26 16:04:02 UTC (rev 1267) @@ -3,7 +3,7 @@ classname = self.xmeID.get() Parameter._log.debug(_("Compiling Parameter instance with XME:ID = {0!s}".format(classname))) classdeco = "MofParameter._new" -tplClass = """\n\t\t@%(classdeco)s\n\t\tclass %(classname)s(%(classbase)s):\n\t\t\t%(classdoc)s\n%(metaprops)s""" +tplClass = """\n\n\n\t\t@%(classdeco)s\n\t\tclass %(classname)s(%(classbase)s):\n\t\t\t%(classdoc)s\n%(metaprops)s""" # No generalizations between parameters classbase = "type" Modified: 73/src/AeonicXME/specs/m3/code/Parameter/_specify.py =================================================================== --- 73/src/AeonicXME/specs/m3/code/Parameter/_specify.py 2011-12-26 14:30:56 UTC (rev 1266) +++ 73/src/AeonicXME/specs/m3/code/Parameter/_specify.py 2011-12-26 16:04:02 UTC (rev 1267) @@ -1,4 +1,5 @@ -from XME.M3.Core.Constructs import TypedElement, MultiplicityElement +from XME.M3.Core.Constructs import Element, TypedElement, MultiplicityElement self._log.debug(_("Specifying Parameter instance with XMI:ID = {0!s}".format(xmi.get_attribute("xmi:id")))) -return TypedElement._specify(self, rev=rev, layer=layer, xmi=xmi, owner=owner) -#return MultiplicityElement._specify(self, rev=rev, layer=layer, xmi=xmi, owner=owner) # FIXME: super() calls broken? \ No newline at end of file +Element._specify(self, rev=rev, layer=layer, xmi=xmi, owner=owner) +TypedElement._specify(self, rev=rev, layer=layer, xmi=xmi, owner=owner) +return MultiplicityElement._specify(self, rev=rev, layer=layer, xmi=xmi, owner=owner) \ No newline at end of file Modified: 73/src/AeonicXME/specs/m3/code/Property/_construct.py =================================================================== --- 73/src/AeonicXME/specs/m3/code/Property/_construct.py 2011-12-26 14:30:56 UTC (rev 1266) +++ 73/src/AeonicXME/specs/m3/code/Property/_construct.py 2011-12-26 16:04:02 UTC (rev 1267) @@ -3,7 +3,7 @@ classname = self.xmeID.get() Property._log.debug(_("Compiling Property instance with XME:ID = {0!s}".format(classname))) classdeco = "MofProperty._new" -tplClass = """\n\t@%(classdeco)s\n\tclass %(classname)s(%(classbase)s):\n\t\t%(classdoc)s\n%(metaprops)s""" +tplClass = """\n\n\n\t@%(classdeco)s\n\tclass %(classname)s(%(classbase)s):\n\t\t%(classdoc)s\n%(metaprops)s""" # No generalizations between properties classbase = "type" Modified: 73/src/AeonicXME/specs/m3/code/Property/_specify.py =================================================================== --- 73/src/AeonicXME/specs/m3/code/Property/_specify.py 2011-12-26 14:30:56 UTC (rev 1266) +++ 73/src/AeonicXME/specs/m3/code/Property/_specify.py 2011-12-26 16:04:02 UTC (rev 1267) @@ -1,4 +1,5 @@ -from XME.M3.Core.Constructs import TypedElement, MultiplicityElement +from XME.M3.Core.Constructs import Element, TypedElement, MultiplicityElement self._log.debug(_("Specifying Property instance with XMI:ID = {0!s}".format(xmi.get_attribute("xmi:id")))) -return TypedElement._specify(self, rev=rev, layer=layer, xmi=xmi, owner=owner) -#return MultiplicityElement._specify(self, rev=rev, layer=layer, xmi=xmi, owner=owner) # FIXME: super() calls broken? \ No newline at end of file +Element._specify(self, rev=rev, layer=layer, xmi=xmi, owner=owner) +TypedElement._specify(self, rev=rev, layer=layer, xmi=xmi, owner=owner) +return MultiplicityElement._specify(self, rev=rev, layer=layer, xmi=xmi, owner=owner) \ No newline at end of file Added: 73/src/AeonicXME/specs/m3/code/ValueSpecification/_specify.py =================================================================== --- 73/src/AeonicXME/specs/m3/code/ValueSpecification/_specify.py (rev 0) +++ 73/src/AeonicXME/specs/m3/code/ValueSpecification/_specify.py 2011-12-26 16:04:02 UTC (rev 1267) @@ -0,0 +1,3 @@ +from XME.M3.Core.Constructs import TypedElement, PackageableElement +TypedElement._specify(self, rev=rev, layer=layer, xmi=xmi, owner=owner) +return PackageableElement._specify(self, rev=rev, layer=layer, xmi=xmi, owner=owner) \ No newline at end of file Property changes on: 73/src/AeonicXME/specs/m3/code/ValueSpecification/_specify.py ___________________________________________________________________ Added: svn:keywords + Id Modified: 73/src/AeonicXME/specs/m3/m3patch.cmof =================================================================== --- 73/src/AeonicXME/specs/m3/m3patch.cmof 2011-12-26 14:30:56 UTC (rev 1266) +++ 73/src/AeonicXME/specs/m3/m3patch.cmof 2011-12-26 16:04:02 UTC (rev 1267) @@ -5,7 +5,7 @@ <difference xmi:type="xmi:Replace" xmi:id="XME-M3_patch"> <target href="Core"/> - + <difference xmi:type="xmi:Add" xmi:id="XME-M3_patch-Constructs-Element-_new"> <target href="Core-Constructs-Element" /> <addition href="Core-Constructs-Element-_new" /> @@ -345,6 +345,78 @@ </ownedOperation> </difference> + <difference xmi:type="xmi:Add" xmi:id="XME-M3_patch-Constructs-PackageableElement-_specify"> + <target href="Core-Constructs-PackageableElement" /> + <addition href="Core-Constructs-PackageableElement-_specify" /> + <ownedOperation xmi:type="cmof:Operation" xmi:id="Core-Constructs-PackageableElement-_specify" name="_specify" class="Core-Constructs-PackageableElement" bodyCondition="Core-Constructs-PackageableElement-_specify-spec"> + <ownedComment xmi:type="cmof:Comment" xmi:id="Core-Constructs-PackageableElement-_specify-spec-_ownedComment.0" annotatedElement="Core-Constructs-PackageableElement-_specify"> + <body>A decorator that is used to add a new metaclass to the UML layer, that may be extended by merging with metaclasses with the same name in other parts.</body> + </ownedComment> + <ownedRule xmi:type="cmof:Constraint" xmi:id="Core-Constructs-PackageableElement-_specify-spec" name="spec" constrainedElement="Core-Constructs-PackageableElement-_specify" namespace="Core-Constructs-PackageableElement-_specify"> + <specification xmi:type="cmof:OpaqueExpression" xmi:id="Core-Constructs-PackageableElement-_specify-spec-specification"> + <language>Python 3.2</language> + <body><include src="code/PackageableElement/_specify.py" /></body> + </specification> + </ownedRule> + <ownedParameter name="rev" xmi:type="cmof:Parameter" xmi:id="Core-Constructs-PackageableElement-_specify-_ownedParameter.1" direction="in"> + <ownedComment xmi:type="cmof:Comment" xmi:id="Core-Constructs-PackageableElement-_specify-_ownedComment.1" annotatedElement="Core-Constructs-PackageableElement-_specify-_ownedParameter.1"> + <body>The revision to which this element belongs.</body> + </ownedComment> + </ownedParameter> + <ownedParameter name="layer" xmi:type="cmof:Parameter" xmi:id="Core-Constructs-PackageableElement-_specify-_ownedParameter.2" direction="in"> + <ownedComment xmi:type="cmof:Comment" xmi:id="Core-Constructs-PackageableElement-_specify-_ownedComment.2" annotatedElement="Core-Constructs-PackageableElement-_specify-_ownedParameter.2"> + <body>The layer to which this element belongs.</body> + </ownedComment> + </ownedParameter> + <ownedParameter name="xmi" xmi:type="cmof:Parameter" xmi:id="Core-Constructs-PackageableElement-_specify-_ownedParameter.3" direction="in"> + <ownedComment xmi:type="cmof:Comment" xmi:id="Core-Constructs-PackageableElement-_specify-_ownedComment.3" annotatedElement="Core-Constructs-PackageableElement-_specify-_ownedParameter.3"> + <body>The XMI-element to process for this element.</body> + </ownedComment> + </ownedParameter> + <ownedParameter name="owner" xmi:type="cmof:Parameter" xmi:id="Core-Constructs-PackageableElement-_specify-_ownedParameter.4" direction="in" type="Core-PrimitiveTypes-String"> + <ownedComment xmi:type="cmof:Comment" xmi:id="Core-Constructs-PackageableElement-_specify-_ownedComment.4" annotatedElement="Core-Constructs-PackageableElement-_specify-_ownedParameter.4"> + <body>The XME-ID of the owner element of this element.</body> + </ownedComment> + </ownedParameter> + </ownedOperation> + </difference> + + <difference xmi:type="xmi:Add" xmi:id="XME-M3_patch-Constructs-ValueSpecification-_specify"> + <target href="Core-Constructs-ValueSpecification" /> + <addition href="Core-Constructs-ValueSpecification-_specify" /> + <ownedOperation xmi:type="cmof:Operation" xmi:id="Core-Constructs-ValueSpecification-_specify" name="_specify" class="Core-Constructs-ValueSpecification" bodyCondition="Core-Constructs-ValueSpecification-_specify-spec"> + <ownedComment xmi:type="cmof:Comment" xmi:id="Core-Constructs-ValueSpecification-_specify-spec-_ownedComment.0" annotatedElement="Core-Constructs-ValueSpecification-_specify"> + <body>A decorator that is used to add a new metaclass to the UML layer, that may be extended by merging with metaclasses with the same name in other parts.</body> + </ownedComment> + <ownedRule xmi:type="cmof:Constraint" xmi:id="Core-Constructs-ValueSpecification-_specify-spec" name="spec" constrainedElement="Core-Constructs-ValueSpecification-_specify" namespace="Core-Constructs-ValueSpecification-_specify"> + <specification xmi:type="cmof:OpaqueExpression" xmi:id="Core-Constructs-ValueSpecification-_specify-spec-specification"> + <language>Python 3.2</language> + <body><include src="code/ValueSpecification/_specify.py" /></body> + </specification> + </ownedRule> + <ownedParameter name="rev" xmi:type="cmof:Parameter" xmi:id="Core-Constructs-ValueSpecification-_specify-_ownedParameter.1" direction="in"> + <ownedComment xmi:type="cmof:Comment" xmi:id="Core-Constructs-ValueSpecification-_specify-_ownedComment.1" annotatedElement="Core-Constructs-ValueSpecification-_specify-_ownedParameter.1"> + <body>The revision to which this element belongs.</body> + </ownedComment> + </ownedParameter> + <ownedParameter name="layer" xmi:type="cmof:Parameter" xmi:id="Core-Constructs-ValueSpecification-_specify-_ownedParameter.2" direction="in"> + <ownedComment xmi:type="cmof:Comment" xmi:id="Core-Constructs-ValueSpecification-_specify-_ownedComment.2" annotatedElement="Core-Constructs-ValueSpecification-_specify-_ownedParameter.2"> + <body>The layer to which this element belongs.</body> + </ownedComment> + </ownedParameter> + <ownedParameter name="xmi" xmi:type="cmof:Parameter" xmi:id="Core-Constructs-ValueSpecification-_specify-_ownedParameter.3" direction="in"> + <ownedComment xmi:type="cmof:Comment" xmi:id="Core-Constructs-ValueSpecification-_specify-_ownedComment.3" annotatedElement="Core-Constructs-ValueSpecification-_specify-_ownedParameter.3"> + <body>The XMI-element to process for this element.</body> + </ownedComment> + </ownedParameter> + <ownedParameter name="owner" xmi:type="cmof:Parameter" xmi:id="Core-Constructs-ValueSpecification-_specify-_ownedParameter.4" direction="in" type="Core-PrimitiveTypes-String"> + <ownedComment xmi:type="cmof:Comment" xmi:id="Core-Constructs-ValueSpecification-_specify-_ownedComment.4" annotatedElement="Core-Constructs-ValueSpecification-_specify-_ownedParameter.4"> + <body>The XME-ID of the owner element of this element.</body> + </ownedComment> + </ownedParameter> + </ownedOperation> + </difference> + <difference xmi:type="xmi:Add" xmi:id="XME-M3_patch-Constructs-Package-_new"> <target href="Core-Constructs-Package" /> <addition href="Core-Constructs-Package-_new" /> @@ -511,7 +583,7 @@ </ownedParameter> <ownedParameter name="xmi" xmi:type="cmof:Parameter" xmi:id="Core-Constructs-Class-_specify-_ownedParameter.3" direction="in"> <ownedComment xmi:type="cmof:Comment" xmi:id="Core-Constructs-Class-_specify-_ownedComment.3" annotatedElement="Core-Constructs-Class-_specify-_ownedParameter.3"> - <body>The XMI-element to process for this element.</body> + <body>The XMI-element to process for this element.</body> </ownedComment> </ownedParameter> <ownedParameter name="owner" xmi:type="cmof:Parameter" xmi:id="Core-Constructs-Class-_specify-_ownedParameter.4" direction="in" type="Core-PrimitiveTypes-String"> @@ -818,6 +890,140 @@ </ownedOperation> </difference> + <difference xmi:type="xmi:Add" xmi:id="XME-M3_patch-Constructs-Constraint-_specify"> + <target href="Core-Constructs-Constraint" /> + <addition href="Core-Constructs-Constraint-_specify" /> + <ownedOperation xmi:type="cmof:Operation" xmi:id="Core-Constructs-Constraint-_specify" name="_specify" class="Core-Constructs-Constraint" bodyCondition="Core-Constructs-Constraint-_specify-spec"> + <ownedComment xmi:type="cmof:Comment" xmi:id="Core-Constructs-Constraint-_specify-spec-_ownedComment.0" annotatedElement="Core-Constructs-Constraint-_specify"> + <body>A decorator that is used to add a new metaclass to the UML layer, that may be extended by merging with metaclasses with the same name in other parts.</body> + </ownedComment> + <ownedRule xmi:type="cmof:Constraint" xmi:id="Core-Constructs-Constraint-_specify-spec" name="spec" constrainedElement="Core-Constructs-Constraint-_specify" namespace="Core-Constructs-Constraint-_specify"> + <specification xmi:type="cmof:OpaqueExpression" xmi:id="Core-Constructs-Constraint-_specify-spec-specification"> + <language>Python 3.2</language> + <body><include src="code/Constraint/_specify.py" /></body> + </specification> + </ownedRule> + <ownedParameter name="rev" xmi:type="cmof:Parameter" xmi:id="Core-Constructs-Constraint-_specify-_ownedParameter.1" direction="in"> + <ownedComment xmi:type="cmof:Comment" xmi:id="Core-Constructs-Constraint-_specify-_ownedComment.1" annotatedElement="Core-Constructs-Constraint-_specify-_ownedParameter.1"> + <body>The revision to which this element belongs.</body> + </ownedComment> + </ownedParameter> + <ownedParameter name="layer" xmi:type="cmof:Parameter" xmi:id="Core-Constructs-Constraint-_specify-_ownedParameter.2" direction="in"> + <ownedComment xmi:type="cmof:Comment" xmi:id="Core-Constructs-Constraint-_specify-_ownedComment.2" annotatedElement="Core-Constructs-Constraint-_specify-_ownedParameter.2"> + <body>The layer to which this element belongs.</body> + </ownedComment> + </ownedParameter> + <ownedParameter name="xmi" xmi:type="cmof:Parameter" xmi:id="Core-Constructs-Constraint-_specify-_ownedParameter.3" direction="in"> + <ownedComment xmi:type="cmof:Comment" xmi:id="Core-Constructs-Constraint-_specify-_ownedComment.3" annotatedElement="Core-Constructs-Constraint-_specify-_ownedParameter.3"> + <body>The XMI-element to process for this element.</body> + </ownedComment> + </ownedParameter> + <ownedParameter name="owner" xmi:type="cmof:Parameter" xmi:id="Core-Constructs-Constraint-_specify-_ownedParameter.4" direction="in" type="Core-PrimitiveTypes-String"> + <ownedComment xmi:type="cmof:Comment" xmi:id="Core-Constructs-Constraint-_specify-_ownedComment.4" annotatedElement="Core-Constructs-Constraint-_specify-_ownedParameter.4"> + <body>The XME-ID of the owner element of this element.</body> + </ownedComment> + </ownedParameter> + </ownedOperation> + </difference> + + <difference xmi:type="xmi:Add" xmi:id="XME-M3_patch-Constructs-Constraint-_construct"> + <target href="Core-Constructs-Constraint" /> + <addition href="Core-Constructs-Constraint-_construct" /> + <ownedOperation xmi:type="cmof:Operation" xmi:id="Core-Constructs-Constraint-_construct" name="_construct" class="Core-Constructs-Constraint" bodyCondition="Core-Constructs-Constraint-_construct-spec"> + <ownedComment xmi:type="cmof:Comment" xmi:id="Core-Constructs-Constraint-_construct-spec-_ownedComment.0" annotatedElement="Core-Constructs-Constraint-_construct"> + <body>Constructs and compiles this element as Python code in the M2 layer.</body> + </ownedComment> + <ownedRule xmi:type="cmof:Constraint" xmi:id="Core-Constructs-Constraint-_construct-spec" name="spec" constrainedElement="Core-Constructs-Constraint-_construct" namespace="Core-Constructs-Constraint-_construct"> + <specification xmi:type="cmof:OpaqueExpression" xmi:id="Core-Constructs-Constraint-_construct-spec-specification"> + <language>Python 3.2</language> + <body><include src="code/Constraint/_construct.py" /></body> + </specification> + </ownedRule> + <ownedParameter name="rev" xmi:type="cmof:Parameter" xmi:id="Core-Constructs-Constraint-_construct-_ownedParameter.1" direction="in"> + <ownedComment xmi:type="cmof:Comment" xmi:id="Core-Constructs-Constraint-_construct-_ownedComment.1" annotatedElement="Core-Constructs-Constraint-_construct-_ownedParameter.1"> + <body>The revision to which this element belongs.</body> + </ownedComment> + </ownedParameter> + <ownedParameter name="layer" xmi:type="cmof:Parameter" xmi:id="Core-Constructs-Constraint-_construct-_ownedParameter.2" direction="in"> + <ownedComment xmi:type="cmof:Comment" xmi:id="Core-Constructs-Constraint-_construct-_ownedComment.2" annotatedElement="Core-Constructs-Constraint-_construct-_ownedParameter.2"> + <body>The layer to which this element belongs.</body> + </ownedComment> + </ownedParameter> + <ownedParameter name="indent" xmi:type="cmof:Parameter" xmi:id="Core-Constructs-Constraint-_construct-_ownedParameter.3" direction="in"> + <ownedComment xmi:type="cmof:Comment" xmi:id="Core-Constructs-Constraint-_construct-_ownedComment.3" annotatedElement="Core-Constructs-Constraint-_construct-_ownedParameter.3"> + <body>The number of indents to prefix for every line that represents a meta-property of this element. For example indent=2 will produce \n\t\t_name_ = "example"</body> + </ownedComment> + </ownedParameter> + </ownedOperation> + </difference> + + <difference xmi:type="xmi:Add" xmi:id="XME-M3_patch-Constructs-OpaqueExpression-_specify"> + <target href="Core-Constructs-OpaqueExpression" /> + <addition href="Core-Constructs-OpaqueExpression-_specify" /> + <ownedOperation xmi:type="cmof:Operation" xmi:id="Core-Constructs-OpaqueExpression-_specify" name="_specify" class="Core-Constructs-OpaqueExpression" bodyCondition="Core-Constructs-OpaqueExpression-_specify-spec"> + <ownedComment xmi:type="cmof:Comment" xmi:id="Core-Constructs-OpaqueExpression-_specify-spec-_ownedComment.0" annotatedElement="Core-Constructs-OpaqueExpression-_specify"> + <body>A decorator that is used to add a new metaclass to the UML layer, that may be extended by merging with metaclasses with the same name in other parts.</body> + </ownedComment> + <ownedRule xmi:type="cmof:Constraint" xmi:id="Core-Constructs-OpaqueExpression-_specify-spec" name="spec" constrainedElement="Core-Constructs-OpaqueExpression-_specify" namespace="Core-Constructs-OpaqueExpression-_specify"> + <specification xmi:type="cmof:OpaqueExpression" xmi:id="Core-Constructs-OpaqueExpression-_specify-spec-specification"> + <language>Python 3.2</language> + <body><include src="code/OpaqueExpression/_specify.py" /></body> + </specification> + </ownedRule> + <ownedParameter name="rev" xmi:type="cmof:Parameter" xmi:id="Core-Constructs-OpaqueExpression-_specify-_ownedParameter.1" direction="in"> + <ownedComment xmi:type="cmof:Comment" xmi:id="Core-Constructs-OpaqueExpression-_specify-_ownedComment.1" annotatedElement="Core-Constructs-OpaqueExpression-_specify-_ownedParameter.1"> + <body>The revision to which this element belongs.</body> + </ownedComment> + </ownedParameter> + <ownedParameter name="layer" xmi:type="cmof:Parameter" xmi:id="Core-Constructs-OpaqueExpression-_specify-_ownedParameter.2" direction="in"> + <ownedComment xmi:type="cmof:Comment" xmi:id="Core-Constructs-OpaqueExpression-_specify-_ownedComment.2" annotatedElement="Core-Constructs-OpaqueExpression-_specify-_ownedParameter.2"> + <body>The layer to which this element belongs.</body> + </ownedComment> + </ownedParameter> + <ownedParameter name="xmi" xmi:type="cmof:Parameter" xmi:id="Core-Constructs-OpaqueExpression-_specify-_ownedParameter.3" direction="in"> + <ownedComment xmi:type="cmof:Comment" xmi:id="Core-Constructs-OpaqueExpression-_specify-_ownedComment.3" annotatedElement="Core-Constructs-OpaqueExpression-_specify-_ownedParameter.3"> + <body>The XMI-element to process for this element.</body> + </ownedComment> + </ownedParameter> + <ownedParameter name="owner" xmi:type="cmof:Parameter" xmi:id="Core-Constructs-OpaqueExpression-_specify-_ownedParameter.4" direction="in" type="Core-PrimitiveTypes-String"> + <ownedComment xmi:type="cmof:Comment" xmi:id="Core-Constructs-OpaqueExpression-_specify-_ownedComment.4" annotatedElement="Core-Constructs-OpaqueExpression-_specify-_ownedParameter.4"> + <body>The XME-ID of the owner element of this element.</body> + </ownedComment> + </ownedParameter> + </ownedOperation> + </difference> + + <difference xmi:type="xmi:Add" xmi:id="XME-M3_patch-Constructs-OpaqueExpression-_construct"> + <target href="Core-Constructs-OpaqueExpression" /> + <addition href="Core-Constructs-OpaqueExpression-_construct" /> + <ownedOperation xmi:type="cmof:Operation" xmi:id="Core-Constructs-OpaqueExpression-_construct" name="_construct" class="Core-Constructs-OpaqueExpression" bodyCondition="Core-Constructs-OpaqueExpression-_construct-spec"> + <ownedComment xmi:type="cmof:Comment" xmi:id="Core-Constructs-OpaqueExpression-_construct-spec-_ownedComment.0" annotatedElement="Core-Constructs-OpaqueExpression-_construct"> + <body>Constructs and compiles this element as Python code in the M2 layer.</body> + </ownedComment> + <ownedRule xmi:type="cmof:Constraint" xmi:id="Core-Constructs-OpaqueExpression-_construct-spec" name="spec" constrainedElement="Core-Constructs-OpaqueExpression-_construct" namespace="Core-Constructs-OpaqueExpression-_construct"> + <specification xmi:type="cmof:OpaqueExpression" xmi:id="Core-Constructs-OpaqueExpression-_construct-spec-specification"> + <language>Python 3.2</language> + <body><include src="code/OpaqueExpression/_construct.py" /></body> + </specification> + </ownedRule> + <ownedParameter name="rev" xmi:type="cmof:Parameter" xmi:id="Core-Constructs-OpaqueExpression-_construct-_ownedParameter.1" direction="in"> + <ownedComment xmi:type="cmof:Comment" xmi:id="Core-Constructs-OpaqueExpression-_construct-_ownedComment.1" annotatedElement="Core-Constructs-OpaqueExpression-_construct-_ownedParameter.1"> + <body>The revision to which this element belongs.</body> + </ownedComment> + </ownedParameter> + <ownedParameter name="layer" xmi:type="cmof:Parameter" xmi:id="Core-Constructs-OpaqueExpression-_construct-_ownedParameter.2" direction="in"> + <ownedComment xmi:type="cmof:Comment" xmi:id="Core-Constructs-OpaqueExpression-_construct-_ownedComment.2" annotatedElement="Core-Constructs-OpaqueExpression-_construct-_ownedParameter.2"> + <body>The layer to which this element belongs.</body> + </ownedComment> + </ownedParameter> + <ownedParameter name="indent" xmi:type="cmof:Parameter" xmi:id="Core-Constructs-OpaqueExpression-_construct-_ownedParameter.3" direction="in"> + <ownedComment xmi:type="cmof:Comment" xmi:id="Core-Constructs-OpaqueExpression-_construct-_ownedComment.3" annotatedElement="Core-Constructs-OpaqueExpression-_construct-_ownedParameter.3"> + <body>The number of indents to prefix for every line that represents a meta-property of this element. For example indent=2 will produce \n\t\t_name_ = "example"</body> + </ownedComment> + </ownedParameter> + </ownedOperation> + </difference> + <difference xmi:type="xmi:Add" xmi:id="XME-M3_patch-Constructs-Generator"> <target href="Core-Constructs" /> <addition href="Core-Constructs-Generator" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ah...@us...> - 2011-12-26 14:31:02
|
Revision: 1266 http://aeonic.svn.sourceforge.net/aeonic/?rev=1266&view=rev Author: ahatzis Date: 2011-12-26 14:30:56 +0000 (Mon, 26 Dec 2011) Log Message: ----------- updating `properties` to bug-fix #90 in trunk Modified Paths: -------------- 73/src/AeonicXME/properties.py Modified: 73/src/AeonicXME/properties.py =================================================================== --- 73/src/AeonicXME/properties.py 2011-12-26 14:04:35 UTC (rev 1265) +++ 73/src/AeonicXME/properties.py 2011-12-26 14:30:56 UTC (rev 1266) @@ -203,7 +203,8 @@ if self._metaProperty['upper'] > 1: union = set() else: - union = None + union = self._fresh_property_value(instance) + # Look for subsetting properties if self._metaProperty['xme:id'] in self.layer.opposite_references['subsettedProperty']: # property is subsetted by other properties for ref in self.layer.opposite_references['subsettedProperty'][self._metaProperty['xme:id']]: @@ -211,10 +212,20 @@ # only the properties available in the type of this instance are considered if subsettingProperty.ownedAttribute['name'] in dir(type(instance)) and self._metaProperty['upper'] > 1: # properties with collection-type values union |= set(getattr(instance, subsettingProperty.ownedAttribute['name'])) - elif subsettingProperty.ownedAttribute['name'] in dir(type(instance)): # properties with single values + elif subsettingProperty.ownedAttribute['name'] in dir(type(instance)) and getattr(instance, subsettingProperty.ownedAttribute['name']): # properties with single values union = getattr(instance, subsettingProperty.ownedAttribute['name']) return union + def _fresh_property_value(self, instance): + attr = self._metaProperty + property_value = instance._properties[attr.get('name')] = BasePropertyValue( + lower=attr.get('lower'), + upper=attr.get('upper'), + isUnique=attr.get('isUnique'), + isOrdered=attr.get('isOrdered'), + ) + return property_value + def __get__(self, instance, owner): if instance is None: return self @@ -228,14 +239,7 @@ try: return instance._properties[name] except KeyError: - attr = self._metaProperty - property_value = instance._properties[name] = BasePropertyValue( - lower=attr.get('lower'), - upper=attr.get('upper'), - isUnique=attr.get('isUnique'), - isOrdered=attr.get('isOrdered'), - ) - return property_value + return self._fresh_property_value(instance) def __set__(self, instance, value): name = self._metaProperty['name'] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ah...@us...> - 2011-12-26 14:04:41
|
Revision: 1265 http://aeonic.svn.sourceforge.net/aeonic/?rev=1265&view=rev Author: ahatzis Date: 2011-12-26 14:04:35 +0000 (Mon, 26 Dec 2011) Log Message: ----------- remove bug-fix #90 Removed Paths: ------------- branches/90/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ah...@us...> - 2011-12-26 13:58:41
|
Revision: 1264 http://aeonic.svn.sourceforge.net/aeonic/?rev=1264&view=rev Author: ahatzis Date: 2011-12-26 13:58:35 +0000 (Mon, 26 Dec 2011) Log Message: ----------- merging bug-fix #90 back to trunk Modified Paths: -------------- trunk/src/AeonicXME/properties.py Property Changed: ---------------- trunk/ trunk/src/AeonicXME/properties.py Property changes on: trunk ___________________________________________________________________ Modified: svn:mergeinfo - /61-fixing_53:987-988 /branches/10-py_inclusion:745-750 /branches/11-constraints:747-767 /branches/11-constraints_prep:734-735 /branches/13-mof-properties:813-827 /branches/14-MOF_statistics:738-739 /branches/15-content_report_MOF:993-1026 /branches/18_mofpatch:770-810 /branches/20-cache-cmof:774-777 /branches/21-packages-as-modules:777-782 /branches/22-add-classes-to-modules:783-802 /branches/23_construct-accepts-IDs:797-798 /branches/28-derived-properties:832-840 /branches/29_split_PropertyConstructor:836-837 /branches/3-methods:705-717 /branches/30-derived-union:938-942 /branches/31-associations:830-934 /branches/35-multi-prop:844-887 /branches/36_revision_ref_in_MOF:848-849 /branches/37-log-level-destinations:953-956 /branches/38_generate_M2classes:854-863 /branches/39-patchable_M2:1002-1007 /branches/52_generate_M2classes_with_operations:866-870 /branches/53_generate_M2classes_with_attributes:874-948 /branches/55-split-tests:892-900 /branches/56-func-files-newlines:890-898 /branches/57_incomplete_metaprops:906-919 /branches/58-primitive-types:969-976 /branches/60-logger-configs:979-983 /branches/62-primitive-refactor:994-999 /branches/63-cache-checksum:1014-1023 /branches/66-constructions-terminology:1030-1149 /branches/70-ReviewM2Generation:1152-1157 /branches/72-packages_in_M2:1190-1235 /branches/75-enumerations_in_M2:1188 /branches/8-release_0.8:742-760 /branches/80-renaming:1160-1161 /branches/81-fixM3patch:1166-1183 /branches/86:1237-1240 /branches/87:1242-1246 /branches/89:1253-1254 /branches/9-cleanup:723-729 + /61-fixing_53:987-988 /branches/10-py_inclusion:745-750 /branches/11-constraints:747-767 /branches/11-constraints_prep:734-735 /branches/13-mof-properties:813-827 /branches/14-MOF_statistics:738-739 /branches/15-content_report_MOF:993-1026 /branches/18_mofpatch:770-810 /branches/20-cache-cmof:774-777 /branches/21-packages-as-modules:777-782 /branches/22-add-classes-to-modules:783-802 /branches/23_construct-accepts-IDs:797-798 /branches/28-derived-properties:832-840 /branches/29_split_PropertyConstructor:836-837 /branches/3-methods:705-717 /branches/30-derived-union:938-942 /branches/31-associations:830-934 /branches/35-multi-prop:844-887 /branches/36_revision_ref_in_MOF:848-849 /branches/37-log-level-destinations:953-956 /branches/38_generate_M2classes:854-863 /branches/39-patchable_M2:1002-1007 /branches/52_generate_M2classes_with_operations:866-870 /branches/53_generate_M2classes_with_attributes:874-948 /branches/55-split-tests:892-900 /branches/56-func-files-newlines:890-898 /branches/57_incomplete_metaprops:906-919 /branches/58-primitive-types:969-976 /branches/60-logger-configs:979-983 /branches/62-primitive-refactor:994-999 /branches/63-cache-checksum:1014-1023 /branches/66-constructions-terminology:1030-1149 /branches/70-ReviewM2Generation:1152-1157 /branches/72-packages_in_M2:1190-1235 /branches/75-enumerations_in_M2:1188 /branches/8-release_0.8:742-760 /branches/80-renaming:1160-1161 /branches/81-fixM3patch:1166-1183 /branches/86:1237-1240 /branches/87:1242-1246 /branches/89:1253-1254 /branches/9-cleanup:723-729 /branches/90:1262-1263 Modified: trunk/src/AeonicXME/properties.py =================================================================== --- trunk/src/AeonicXME/properties.py 2011-12-26 13:55:00 UTC (rev 1263) +++ trunk/src/AeonicXME/properties.py 2011-12-26 13:58:35 UTC (rev 1264) @@ -203,7 +203,8 @@ if self._metaProperty['upper'] > 1: union = set() else: - union = None + union = self._fresh_property_value(instance) + # Look for subsetting properties if self._metaProperty['xme:id'] in self.layer.opposite_references['subsettedProperty']: # property is subsetted by other properties for ref in self.layer.opposite_references['subsettedProperty'][self._metaProperty['xme:id']]: @@ -211,10 +212,20 @@ # only the properties available in the type of this instance are considered if subsettingProperty.ownedAttribute['name'] in dir(type(instance)) and self._metaProperty['upper'] > 1: # properties with collection-type values union |= set(getattr(instance, subsettingProperty.ownedAttribute['name'])) - elif subsettingProperty.ownedAttribute['name'] in dir(type(instance)): # properties with single values + elif subsettingProperty.ownedAttribute['name'] in dir(type(instance)) and getattr(instance, subsettingProperty.ownedAttribute['name']): # properties with single values union = getattr(instance, subsettingProperty.ownedAttribute['name']) return union + def _fresh_property_value(self, instance): + attr = self._metaProperty + property_value = instance._properties[attr.get('name')] = BasePropertyValue( + lower=attr.get('lower'), + upper=attr.get('upper'), + isUnique=attr.get('isUnique'), + isOrdered=attr.get('isOrdered'), + ) + return property_value + def __get__(self, instance, owner): if instance is None: return self @@ -228,14 +239,7 @@ try: return instance._properties[name] except KeyError: - attr = self._metaProperty - property_value = instance._properties[name] = BasePropertyValue( - lower=attr.get('lower'), - upper=attr.get('upper'), - isUnique=attr.get('isUnique'), - isOrdered=attr.get('isOrdered'), - ) - return property_value + return self._fresh_property_value(instance) def __set__(self, instance, value): name = self._metaProperty['name'] Property changes on: trunk/src/AeonicXME/properties.py ___________________________________________________________________ Modified: svn:mergeinfo - /61-fixing_53/src/AeonicXME/properties.py:987-988 /branches/15-content_report_MOF/src/AeonicXME/properties.py:993-1026 /branches/30-derived-union/src/AeonicXME/properties.py:938-942 /branches/31-associations/src/AeonicXME/properties.py:830-934 /branches/37-log-level-destinations/src/AeonicXME/properties.py:953-956 /branches/39-patchable_M2/src/AeonicXME/properties.py:1002-1007 /branches/53_generate_M2classes_with_attributes/src/AeonicXME/properties.py:874-948 /branches/58-primitive-types/src/AeonicXME/properties.py:969-976 /branches/60-logger-configs/src/AeonicXME/properties.py:979-983 /branches/62-primitive-refactor/src/AeonicXME/properties.py:994-999 /branches/63-cache-checksum/src/AeonicXME/properties.py:1014-1023 /branches/66-constructions-terminology/src/AeonicXME/properties.py:1030-1149 /branches/70-ReviewM2Generation/src/AeonicXME/properties.py:1152-1157 /branches/72-packages_in_M2/src/AeonicXME/properties.py:1190-1235 /branches/75-enumerations_in_M2/src/AeonicXME/properties.py:1188 /branches/80-renaming/src/AeonicXME/properties.py:1160-1161 /branches/81-fixM3patch/src/AeonicXME/properties.py:1166-1183 /branches/86/src/AeonicXME/properties.py:1237-1240 /branches/87/src/AeonicXME/properties.py:1242-1246 /branches/89/src/AeonicXME/properties.py:1253-1254 + /61-fixing_53/src/AeonicXME/properties.py:987-988 /branches/15-content_report_MOF/src/AeonicXME/properties.py:993-1026 /branches/30-derived-union/src/AeonicXME/properties.py:938-942 /branches/31-associations/src/AeonicXME/properties.py:830-934 /branches/37-log-level-destinations/src/AeonicXME/properties.py:953-956 /branches/39-patchable_M2/src/AeonicXME/properties.py:1002-1007 /branches/53_generate_M2classes_with_attributes/src/AeonicXME/properties.py:874-948 /branches/58-primitive-types/src/AeonicXME/properties.py:969-976 /branches/60-logger-configs/src/AeonicXME/properties.py:979-983 /branches/62-primitive-refactor/src/AeonicXME/properties.py:994-999 /branches/63-cache-checksum/src/AeonicXME/properties.py:1014-1023 /branches/66-constructions-terminology/src/AeonicXME/properties.py:1030-1149 /branches/70-ReviewM2Generation/src/AeonicXME/properties.py:1152-1157 /branches/72-packages_in_M2/src/AeonicXME/properties.py:1190-1235 /branches/75-enumerations_in_M2/src/AeonicXME/properties.py:1188 /branches/80-renaming/src/AeonicXME/properties.py:1160-1161 /branches/81-fixM3patch/src/AeonicXME/properties.py:1166-1183 /branches/86/src/AeonicXME/properties.py:1237-1240 /branches/87/src/AeonicXME/properties.py:1242-1246 /branches/89/src/AeonicXME/properties.py:1253-1254 /branches/90/src/AeonicXME/properties.py:1262-1263 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ah...@us...> - 2011-12-26 13:55:06
|
Revision: 1263 http://aeonic.svn.sourceforge.net/aeonic/?rev=1263&view=rev Author: ahatzis Date: 2011-12-26 13:55:00 +0000 (Mon, 26 Dec 2011) Log Message: ----------- fixed bug #90, where derived-union properties in M3 returned `None` when any or all of the subsetting properties were `None`; now a fresh PropertyValue instance is returned and a refactored method is used for this because it is needed in multiple places Modified Paths: -------------- branches/90/src/AeonicXME/properties.py Modified: branches/90/src/AeonicXME/properties.py =================================================================== --- branches/90/src/AeonicXME/properties.py 2011-12-26 13:03:55 UTC (rev 1262) +++ branches/90/src/AeonicXME/properties.py 2011-12-26 13:55:00 UTC (rev 1263) @@ -203,7 +203,8 @@ if self._metaProperty['upper'] > 1: union = set() else: - union = None + union = self._fresh_property_value(instance) + # Look for subsetting properties if self._metaProperty['xme:id'] in self.layer.opposite_references['subsettedProperty']: # property is subsetted by other properties for ref in self.layer.opposite_references['subsettedProperty'][self._metaProperty['xme:id']]: @@ -211,10 +212,20 @@ # only the properties available in the type of this instance are considered if subsettingProperty.ownedAttribute['name'] in dir(type(instance)) and self._metaProperty['upper'] > 1: # properties with collection-type values union |= set(getattr(instance, subsettingProperty.ownedAttribute['name'])) - elif subsettingProperty.ownedAttribute['name'] in dir(type(instance)): # properties with single values + elif subsettingProperty.ownedAttribute['name'] in dir(type(instance)) and getattr(instance, subsettingProperty.ownedAttribute['name']): # properties with single values union = getattr(instance, subsettingProperty.ownedAttribute['name']) return union + def _fresh_property_value(self, instance): + attr = self._metaProperty + property_value = instance._properties[attr.get('name')] = BasePropertyValue( + lower=attr.get('lower'), + upper=attr.get('upper'), + isUnique=attr.get('isUnique'), + isOrdered=attr.get('isOrdered'), + ) + return property_value + def __get__(self, instance, owner): if instance is None: return self @@ -228,14 +239,7 @@ try: return instance._properties[name] except KeyError: - attr = self._metaProperty - property_value = instance._properties[name] = BasePropertyValue( - lower=attr.get('lower'), - upper=attr.get('upper'), - isUnique=attr.get('isUnique'), - isOrdered=attr.get('isOrdered'), - ) - return property_value + return self._fresh_property_value(instance) def __set__(self, instance, value): name = self._metaProperty['name'] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ah...@us...> - 2011-12-26 13:04:01
|
Revision: 1262 http://aeonic.svn.sourceforge.net/aeonic/?rev=1262&view=rev Author: ahatzis Date: 2011-12-26 13:03:55 +0000 (Mon, 26 Dec 2011) Log Message: ----------- branching from trunk for ticket #90 Added Paths: ----------- branches/90/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ah...@us...> - 2011-12-26 12:48:03
|
Revision: 1261 http://aeonic.svn.sourceforge.net/aeonic/?rev=1261&view=rev Author: ahatzis Date: 2011-12-26 12:47:54 +0000 (Mon, 26 Dec 2011) Log Message: ----------- minor bug-fix in creation of temporary code-files Modified Paths: -------------- 73/src/AeonicXME/constructions.py Modified: 73/src/AeonicXME/constructions.py =================================================================== --- 73/src/AeonicXME/constructions.py 2011-12-25 18:16:35 UTC (rev 1260) +++ 73/src/AeonicXME/constructions.py 2011-12-26 12:47:54 UTC (rev 1261) @@ -1990,7 +1990,9 @@ if DEBUG: tempdir = os.path.join(tempfile.gettempdir(), "aeonic", "code") - if not os.path.exists(tempdir): + if not os.path.exists(os.path.join(tempfile.gettempdir(), "aeonic")): + os.mkdir(os.path.join(tempfile.gettempdir(), "aeonic")) + if not os.path.exists(os.path.join(tempfile.gettempdir(), "aeonic", "code")): os.mkdir(tempdir) fd, fn = tempfile.mkstemp(dir=tempdir) f = os.fdopen(fd, "wb") This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ah...@us...> - 2011-12-25 18:16:41
|
Revision: 1260 http://aeonic.svn.sourceforge.net/aeonic/?rev=1260&view=rev Author: ahatzis Date: 2011-12-25 18:16:35 +0000 (Sun, 25 Dec 2011) Log Message: ----------- merging changes of bug-fix #89 from trunk into branch #73 because needed for this branch Modified Paths: -------------- 73/src/AeonicXME/constructions.py 73/src/AeonicXME/properties.py 73/src/AeonicXME/testdata/testM4_M3properties.cmof 73/src/AeonicXME/tests/testM4_M3properties.py 73/src/AeonicXME/tests/testM4_constructM3.py Modified: 73/src/AeonicXME/constructions.py =================================================================== --- 73/src/AeonicXME/constructions.py 2011-12-25 17:58:05 UTC (rev 1259) +++ 73/src/AeonicXME/constructions.py 2011-12-25 18:16:35 UTC (rev 1260) @@ -367,6 +367,7 @@ self.opposite_references["superClass"] = {} # see Class::superClass self.opposite_references["annotatedElement"] = {} # see Comment::annotatedElement self.opposite_references["constrainedElement"] = {} # see Constraint::constrainedElement + self.opposite_references["subsettedProperty"] = {} # see Property::subsettedProperty self.association_by_memberEnd = {} # memberEnd ID -> list of Association ID @@ -1510,7 +1511,7 @@ self.ownedAttribute["isDerived"] = None self.ownedAttribute["isDerivedUnion"] = None self.ownedAttribute["isReadOnly"] = None - self.ownedAttribute["subsettedProperty"] = None + self.relatedElement["subsettedProperty"] = [] self.relatedElement["association"] = [] def _specify(self, rev=None, layer=None, owner=None, xmi=None): @@ -1572,8 +1573,8 @@ if self.ownedAttribute["isReadOnly"] and "readOnly" not in self._textualNotation["decoration"] and not self.ownedAttribute["isDerived"]: # isDerived already implies readOnly, so not needed in notation self._textualNotation["decoration"].append("readOnly") - if self.ownedAttribute["subsettedProperty"]: - for subsetted in self.ownedAttribute["subsettedProperty"].split(" "): + if len(self.relatedElement["subsettedProperty"]) > 0: + for subsetted in self.relatedElement["subsettedProperty"]: if "subsets %(subsettedProp)s" % {"subsettedProp" : subsetted} not in self._textualNotation["decoration"]: self._textualNotation["decoration"].append("subsets %(subsettedProp)s" % {"subsettedProp" : subsetted}) Modified: 73/src/AeonicXME/properties.py =================================================================== --- 73/src/AeonicXME/properties.py 2011-12-25 17:58:05 UTC (rev 1259) +++ 73/src/AeonicXME/properties.py 2011-12-25 18:16:35 UTC (rev 1260) @@ -198,22 +198,21 @@ def _deriveUnion(self, instance, name): """Finds all subsetting properties of the named property and combines them into one union of all values. + """ if self._metaProperty['upper'] > 1: union = set() else: union = None - # Look for subsetting properties - for name in dir(type(instance)): - prop = getattr(type(instance), name, None) - if isinstance(prop, Property) and prop._metaProperty['subsettedProperty']: - for subsettedProperty in prop._metaProperty['subsettedProperty'].split(" "): - if subsettedProperty is not None and self.rev.xmiID_to_xmeID(subsettedProperty) == self._metaProperty['xme:id']: - if self._metaProperty['upper'] > 1: - union |= set(getattr(instance, name)) - else: - union = getattr(instance, name) + if self._metaProperty['xme:id'] in self.layer.opposite_references['subsettedProperty']: # property is subsetted by other properties + for ref in self.layer.opposite_references['subsettedProperty'][self._metaProperty['xme:id']]: + subsettingProperty = self.layer.get_constructor_by_ID(xmeID=ref) # for every subsetting prop get the property + # only the properties available in the type of this instance are considered + if subsettingProperty.ownedAttribute['name'] in dir(type(instance)) and self._metaProperty['upper'] > 1: # properties with collection-type values + union |= set(getattr(instance, subsettingProperty.ownedAttribute['name'])) + elif subsettingProperty.ownedAttribute['name'] in dir(type(instance)): # properties with single values + union = getattr(instance, subsettingProperty.ownedAttribute['name']) return union def __get__(self, instance, owner): Modified: 73/src/AeonicXME/testdata/testM4_M3properties.cmof =================================================================== --- 73/src/AeonicXME/testdata/testM4_M3properties.cmof 2011-12-25 17:58:05 UTC (rev 1259) +++ 73/src/AeonicXME/testdata/testM4_M3properties.cmof 2011-12-25 18:16:35 UTC (rev 1260) @@ -47,6 +47,9 @@ <ownedAttribute xmi:type="cmof:Property" xmi:id="I-i1" name="i1" isOrdered="true" isUnique="true" isDerivedUnion="true" lower="0" upper="*"></ownedAttribute> <ownedAttribute xmi:type="cmof:Property" xmi:id="I-i2" name="i2" isOrdered="true" isUnique="true" isDerivedUnion="true" subsettedProperty="I-i1" lower="0" upper="*"></ownedAttribute> <ownedAttribute xmi:type="cmof:Property" xmi:id="I-i3" name="i3" isOrdered="true" isUnique="true" subsettedProperty="I-i2" lower="0" upper="*"></ownedAttribute> + <ownedAttribute xmi:type="cmof:Property" xmi:id="I-i4" name="i4" isOrdered="true" isUnique="true" isDerivedUnion="true" lower="0"></ownedAttribute> + <ownedAttribute xmi:type="cmof:Property" xmi:id="I-i5" name="i5" isOrdered="true" isUnique="true" isDerivedUnion="true" subsettedProperty="I-i4" lower="0"></ownedAttribute> + <ownedAttribute xmi:type="cmof:Property" xmi:id="I-i6" name="i6" isOrdered="true" isUnique="true" subsettedProperty="I-i5" lower="0"></ownedAttribute> </ownedMember> </ownedMember> Modified: 73/src/AeonicXME/tests/testM4_M3properties.py =================================================================== --- 73/src/AeonicXME/tests/testM4_M3properties.py 2011-12-25 17:58:05 UTC (rev 1259) +++ 73/src/AeonicXME/tests/testM4_M3properties.py 2011-12-25 18:16:35 UTC (rev 1260) @@ -38,10 +38,10 @@ def setUp(self): self.rev = constructions.construct_revision(withM2=False, m3URI='testdata/testM4_M3properties.cmof', m3ID='Test', m3PatchID=None) - self.C = self.rev.m3.mclass['Test_Class_C_rev1'] - self.D = self.rev.m3.mclass['Test_Class_D_rev1'] - self.E = self.rev.m3.mclass['Test_Class_E_rev1'] - self.F = self.rev.m3.mclass['Test_Class_F_rev1'] + self.C = self.rev.m3.mclass[self.rev.xmiID_to_xmeID(xmiID='Test-Class-C')] + self.D = self.rev.m3.mclass[self.rev.xmiID_to_xmeID(xmiID='Test-Class-D')] + self.E = self.rev.m3.mclass[self.rev.xmiID_to_xmeID(xmiID='Test-Class-E')] + self.F = self.rev.m3.mclass[self.rev.xmiID_to_xmeID(xmiID='Test-Class-F')] def tearDown(self): self.rev = None @@ -204,11 +204,10 @@ def setUp(self): self.rev = constructions.construct_revision(withM2=False, m3URI='testdata/testM4_M3properties.cmof', m3ID='Test', m3PatchID=None) + self.G = self.rev.m3.mclass[self.rev.xmiID_to_xmeID(xmiID='Test-Class-G')] + self.H = self.rev.m3.mclass[self.rev.xmiID_to_xmeID(xmiID='Test-Class-H')] + self.I = self.rev.m3.mclass[self.rev.xmiID_to_xmeID(xmiID='Test-Class-I')] - self.G = self.rev.m3.mclass['Test_Class_G_rev1'] - self.H = self.rev.m3.mclass['Test_Class_H_rev1'] - self.I = self.rev.m3.mclass['Test_Class_I_rev1'] - def test_cant_write_derived(self): self.assertRaises(AttributeError, setattr, self.G(), 'X', 10) @@ -228,21 +227,29 @@ h.g2.add(1) h.g3.add(2) - self.assertEquals(set(h.g1), set((1, 2))) + self.assertEqual(set(h.g1), set((1, 2))) def test_subset_meta_property(self): - self.assertEqual(self.H.g2._metaProperty['subsettedProperty'], 'G-g1') + self.assertEqual(self.H.g2._metaProperty['subsettedProperty'][0], self.rev.xmiID_to_xmeID(xmiID='G-g1')) - def test_deep_subset(self): + def test_deep_subset_collection(self): i = self.I() i.i3.add(1) - self.assertEquals(list(i.i2), [1]) - self.assertEquals(list(i.i1), [1]) + self.assertEqual(list(i.i2), [1]) + self.assertEqual(list(i.i1), [1]) + def test_deep_subset_single(self): + i = self.I() + i.i6.set(1) + + self.assertEqual(i.i5.get(), 1) + self.assertEqual(i.i4.get(), 1) + + def suite(): suite = unittest.TestLoader().loadTestsFromName(__name__) return suite Modified: 73/src/AeonicXME/tests/testM4_constructM3.py =================================================================== --- 73/src/AeonicXME/tests/testM4_constructM3.py 2011-12-25 17:58:05 UTC (rev 1259) +++ 73/src/AeonicXME/tests/testM4_constructM3.py 2011-12-25 18:16:35 UTC (rev 1260) @@ -249,7 +249,7 @@ \t\t+nonunique [1..1] {nonunique} <cmof:Property> \t\t+ordered [1..1] {ordered} <cmof:Property> \t\t+readonly [1..1] {readOnly} <cmof:Property> -\t\t+subsetting [1..1] {subsets Test-Property-X, subsets Test-Property-Y} <cmof:Property> +\t\t+subsetting [1..1] {subsets """ + self.rev.xmiID_to_xmeID(xmiID="Test-Property-X") + """, subsets """ + self.rev.xmiID_to_xmeID(xmiID="Test-Property-Y") + """} <cmof:Property> \t\t+lower0 [0..1] <cmof:Property> \t\t+unlimited [0..*] <cmof:Property> \t\t+typed : Test::D [0..*] <cmof:Property> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |