r13420 - AGX/agx.io.uml/trunk/src/agx/io/uml

"johannes raggam" <[email protected]>
Newsgroups gmane.comp.web.zope.plone.archetypes.cvs
Message-ID <[email protected]>
Author: thet
Date: Tue Jan 18 12:44:48 2011
New Revision: 13420

Modified:
   AGX/agx.io.uml/trunk/src/agx/io/uml/classes.py
   AGX/agx.io.uml/trunk/src/agx/io/uml/core.py
   AGX/agx.io.uml/trunk/src/agx/io/uml/interfaces.py
   AGX/agx.io.uml/trunk/src/agx/io/uml/utils.py
Log:
cleanup, TODO notes for failing code blocks

Modified: AGX/agx.io.uml/trunk/src/agx/io/uml/classes.py
==============================================================================
--- AGX/agx.io.uml/trunk/src/agx/io/uml/classes.py	(original)
+++ AGX/agx.io.uml/trunk/src/agx/io/uml/classes.py	Tue Jan 18 12:44:48 2011
@@ -37,35 +37,35 @@
     @property
     def operations(self):
         return self.filtereditems(IOperation)
-    
+
 class _TypedElement(UMLElement):
-    
+
     def __init__(self, name=None):
         super(UMLElement, self).__init__(name)
-        self._type = None      
-    
+        self._type = None
+
     def _gettype(self):
         if self._type is not None:
             return  self.node(self._type)
         return None
-    
+
     def _settype(self, typeinstance):
         self._type = typeinstance.uuid
-        
-    type = property(_gettype, _settype)    
-    
+
+    type = property(_gettype, _settype)
+
 class Property(_TypedElement):
     implements(IProperty)
-    
+
     def __init__(self, name=None):
         super(_TypedElement, self).__init__(name)
-        self.default = NODEFAULTMARKER        
-    
+        self.default = NODEFAULTMARKER
+
 class Operation(UMLElement):
     implements(IOperation)
 
     @property
-    def parameter(self): 
+    def parameter(self):
         return self.filtereditems(IParameter)
 
 class Parameter(_TypedElement):
@@ -74,17 +74,17 @@
     def __init__(self, name=None):
         super(_TypedElement, self).__init__(name)
         self.default = NODEFAULTMARKER
-        self.direction = 'in'    
+        self.direction = 'in'
 
 ### Elements connecting two elements below here
 
 class Generalization(UMLElement):
     implements(IGeneralization)
-    
+
     def __init__(self, name=None):
         super(UMLElement, self).__init__(name)
         self._general = None
-    
+
     @property
     def specific(self):
         return self.__parent__
@@ -93,50 +93,50 @@
         if self._general is not None:
             return  self.node(self._general)
         return None
-    
+
     def _setgeneral(self, instance):
         self._general = instance.uuid
-        
-    general = property(_getgeneral, _setgeneral)  
-        
-    
+
+    general = property(_getgeneral, _setgeneral)
+
+
 class InterfaceRealization(UMLElement):
     implements(IInterfaceRealization)
-    
+
     def __init__(self, name=None):
         super(UMLElement, self).__init__(name)
-        self._contract = None    
-        
+        self._contract = None
+
     @property
     def implementingClassifier(self):
-        return self.__parent__        
+        return self.__parent__
 
     def _getcontract(self):
         if self._contract is not None:
-            return  self.node(self._contract)        
+            return  self.node(self._contract)
         return None
 
     def _setcontract(self, instance):
-        self._contract = instance.uuid    
-        
-    contract = property(_getcontract, _setcontract)     
-    
-    
+        self._contract = instance.uuid
+
+    contract = property(_getcontract, _setcontract)
+
+
 class Association(UMLElement):
     implements(IAssociation)
-    
+
     def __init__(self, name=None):
         super(UMLElement, self).__init__(name)
         self._memberEnds = list()
-            
+
     def _getmemberEnds(self):
-        return [self.node(uuid) for uuid in self._memberEnds]      
-    
+        return [self.node(uuid) for uuid in self._memberEnds]
+
     def _setmemberEnds(self, instances):
         self._memberEnds = [i.uuid for i in instances]
-        
-    memberEnds = property(_getmemberEnds, _setmemberEnds)       
-    
+
+    memberEnds = property(_getmemberEnds, _setmemberEnds)
+
     @property
     def ownedEnds(self):
         return self.filtereditems(IAssociationEnd)
@@ -144,44 +144,44 @@
 
 class AssociationEnd(UMLElement):
     implements(IAssociationEnd)
-    
+
     SHARED = 'shared'
     COMPOSITE = 'composite'
     AGGREGATIONS = [SHARED, COMPOSITE]
-    
+
     def __init__(self, name=None):
         super(UMLElement, self).__init__(name)
-        self._type = None     
-        self._association = None     
+        self._type = None
+        self._association = None
         self.lowervalue = None
         self.uppervalue = None
         self.aggregationkind = None
         self.navigable = False
-    
+
     def _gettype(self):
         if self._type is not None:
-            return self.node(self._type)        
+            return self.node(self._type)
         return None
-    
+
     def _settype(self, instance):
         self._type = instance.uuid
-        
-    type = property(_gettype, _settype)   
+
+    type = property(_gettype, _settype)
 
     def _getassociation(self):
         if self._association is not None:
-            return self.node(self._association)        
+            return self.node(self._association)
         return None
-    
+
     def _setassociation(self, instance):
         self._association = instance.uuid
-        
-    association = property(_getassociation, _setassociation)   
-    
-       
+
+    association = property(_getassociation, _setassociation)
+
+
 class Dependency(UMLElement):
     implements(IDependency)
-    
+
     def __init__(self, name=None):
         super(UMLElement, self).__init__(name)
         self._client = None
@@ -191,18 +191,18 @@
         if self._client is not None:
             return  self.node(self._client)
         return None
-    
+
     def _setclient(self, instance):
         self._client = instance.uuid
-        
-    client = property(_getclient, _setclient)         
+
+    client = property(_getclient, _setclient)
 
     def _getsupplier(self):
         if self._supplier is not None:
             return  self.node(self._supplier)
         return None
-    
+
     def _setsupplier(self, instance):
         self._supplier = instance.uuid
-        
-    supplier = property(_getsupplier, _setsupplier)         
\ No newline at end of file
+
+    supplier = property(_getsupplier, _setsupplier)

Modified: AGX/agx.io.uml/trunk/src/agx/io/uml/core.py
==============================================================================
--- AGX/agx.io.uml/trunk/src/agx/io/uml/core.py	(original)
+++ AGX/agx.io.uml/trunk/src/agx/io/uml/core.py	Tue Jan 18 12:44:48 2011
@@ -98,10 +98,12 @@
     def packages(self):
         return self.filtereditems(IPackage)
 
+    # TODO: write test for this failing method
     @property
     def classes(self):
         return self.filtereditems(IClass)
 
+    # TODO: write test for this failing method
     @property
     def interfaces(self):
         return self.filtereditems(IInterface)

Modified: AGX/agx.io.uml/trunk/src/agx/io/uml/interfaces.py
==============================================================================
--- AGX/agx.io.uml/trunk/src/agx/io/uml/interfaces.py	(original)
+++ AGX/agx.io.uml/trunk/src/agx/io/uml/interfaces.py	Tue Jan 18 12:44:48 2011
@@ -10,7 +10,6 @@
 [3] Unified Modeling Language Specification (version 2.1)
 """
 
-from zope.interface import Interface
 from zope.interface import Attribute
 from zodict.interfaces import INode
 from zodict.interfaces import ILeaf

Modified: AGX/agx.io.uml/trunk/src/agx/io/uml/utils.py
==============================================================================
--- AGX/agx.io.uml/trunk/src/agx/io/uml/utils.py	(original)
+++ AGX/agx.io.uml/trunk/src/agx/io/uml/utils.py	Tue Jan 18 12:44:48 2011
@@ -284,6 +284,7 @@
             normalized.append(list(reversed(tag.split(':'))))
         else:
             normalized.append((tag, stereotype))
+        # TODO: next code block can't work, apparently not tests catch it. FIX!
         for alterative in alternatives:
             if isinstance(alternative, tuple) or isinstance(alternative, list):
                normalized.append(alternative)

------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand 
malware threats, the impact they can have on your business, and how you 
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.