Skip to content

Commit

Permalink
Sort base classes
Browse files Browse the repository at this point in the history
So they do not cause unneeded diffs in the code.
  • Loading branch information
amolenaar committed Aug 10, 2020
1 parent cece109 commit 0a15e93
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions gaphor/SysML/sysml.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class ElementPropertyPath(Element):


class AddFlowPropertyValueOnNestedPortAction(
ElementPropertyPath, AddStructuralFeatureValueAction
AddStructuralFeatureValueAction, ElementPropertyPath
):
pass

Expand All @@ -67,13 +67,13 @@ class AdjuntProperty(Property):


class DirectedRelationshipPropertyPath(DirectedRelationship):
targetContext: relation_one[Classifier]
targetPropertyPath: relation_many[Property]
sourceContext: relation_one[Classifier]
sourcePropertyPath: relation_many[Property]
targetPropertyPath: relation_many[Property]
targetContext: relation_one[Classifier]


class Allocate(DirectedRelationshipPropertyPath, Abstraction):
class Allocate(Abstraction, DirectedRelationshipPropertyPath):
pass


Expand Down Expand Up @@ -178,7 +178,7 @@ class InvocationOnNestedPortAction(ElementPropertyPath, InvocationAction):
onNestedPort: relation_many[Port]


class NestedConnectorEnd(ElementPropertyPath, ConnectorEnd):
class NestedConnectorEnd(ConnectorEnd, ElementPropertyPath):
pass


Expand Down Expand Up @@ -279,7 +279,7 @@ class _Refine:
)
ConnectorProperty.connector = association("connector", Connector, upper=1)
DirectedFeature.featureDirection = enumeration(
"kind", ("required", "providedRequired", "provided"), "required"
"kind", ("providedRequired", "provided", "required"), "providedRequired"
)
DirectedRelationshipPropertyPath.sourceContext = association(
"sourceContext", Classifier, upper=1
Expand All @@ -296,7 +296,7 @@ class _Refine:
ElementGroup.name = attribute("name", str)
ElementGroup.orderedMember = association("orderedMember", Element)
ElementPropertyPath.propertyPath = association("propertyPath", Property, lower=1)
FlowProperty.direction = enumeration("kind", ("out", "inout", "in"), "out")
FlowProperty.direction = enumeration("kind", ("inout", "in", "out"), "inout")
InvocationOnNestedPortAction.onNestedPort = association("onNestedPort", Port, lower=1)
ParticipantProperty.end_ = association("end_", Property, upper=1)
Probability.probability = attribute("probability", str)
Expand Down
2 changes: 1 addition & 1 deletion gaphor/codegen/profile_coder.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def create_class_trees(classes: List[UML.Class]) -> Dict[UML.Class, List[UML.Cla
for cls in classes:
base_classes = [base_cls for base_cls in cls.general]
meta_classes = [meta_cls for meta_cls in get_class_extensions(cls)]
trees[cls] = base_classes + meta_classes
trees[cls] = sorted(base_classes + meta_classes, key=lambda e: e.name)
return trees


Expand Down

0 comments on commit 0a15e93

Please sign in to comment.