← Back to team overview

oship-dev team mailing list archive

[Branch ~oship-dev/oship/devel] Rev 503: Fix Bug #608829. Method isPeriodic implemented and superclass call in the constructor

 

------------------------------------------------------------
revno: 503
committer: Eduardo César edu@starforge>
branch nick: local
timestamp: Fri 2010-10-08 16:46:53 -0300
message:
  Fix Bug #608829. Method isPeriodic implemented and superclass call in the constructor
modified:
  src/oship/openehr/rm/data_structures/history/__init__.py
  src/oship/openehr/rm/data_structures/history/tests/history.txt


--
lp:oship
https://code.launchpad.net/~oship-dev/oship/devel

Your team OSHIP Development Team is subscribed to branch lp:oship.
To unsubscribe from this branch go to https://code.launchpad.net/~oship-dev/oship/devel/+edit-subscription
=== modified file 'src/oship/openehr/rm/data_structures/history/__init__.py'
--- src/oship/openehr/rm/data_structures/history/__init__.py	2010-08-06 21:24:11 +0000
+++ src/oship/openehr/rm/data_structures/history/__init__.py	2010-10-08 19:46:53 +0000
@@ -136,8 +136,8 @@
     events = FieldProperty(IHistory['events'])
     
 
-    def __init__(self, origin, klass_structure, events=None,
-                 period=None, duration=None, summary=None):
+    def __init__(self, origin, klass_structure, events=None, period=None, duration=None, summary=None):
+        DataStructure.__init__(self, uid=None, atnodeid=None, name=None, atdetails=None, fdraudit=None, links=None, parent=None)
 
         self.origin=origin
         self.events = EventContainer(self,klass_structure,events)
@@ -189,7 +189,10 @@
         
     def isPeriodic(self):
         u"""Indicates whether history is periodic. Returns Boolean"""
-        pass
+        if self.period is not None:
+            return True
+        else:
+            return False
 
 
 class PointEvent(Event):

=== modified file 'src/oship/openehr/rm/data_structures/history/tests/history.txt'
--- src/oship/openehr/rm/data_structures/history/tests/history.txt	2010-08-06 21:24:11 +0000
+++ src/oship/openehr/rm/data_structures/history/tests/history.txt	2010-10-08 19:46:53 +0000
@@ -175,6 +175,11 @@
 >>> myhistory["2"] # doctest: +ELLIPSIS
 <...PointEvent object at...>
 
+
+>>> h = History(origin_date, WeightStructure, event_list)
+>>> h.isPeriodic()
+False
+
 Let's remove the third event from the weight measurement included::
 
 >>> del myhistory["3"]
@@ -209,6 +214,8 @@
 >>> weight_measurement_series["4"] = a_alone_event
 
 
+
+
 >>> a_alone_event.parent() == weight_measurement_series
 True
 
@@ -242,3 +249,6 @@
 True
 >>> other_alone_event.parent() # doctest : +ELIPSIS
 <...History object at...>
+
+
+