Python: added various price specification classes
authorjani <jani@asema.com>
Fri, 2 Aug 2019 20:47:03 +0000 (23:47 +0300)
committerjani <jani@asema.com>
Fri, 2 Aug 2019 20:47:03 +0000 (23:47 +0300)
18 files changed:
Common/Python/SmartAPI/model/CalculationMethod.py [new file with mode: 0644]
Common/Python/SmartAPI/model/DependentPriceSpecification.py [new file with mode: 0644]
Common/Python/SmartAPI/model/DistanceDependentPriceSpecification.py [new file with mode: 0644]
Common/Python/SmartAPI/model/DurationAtDistanceDependentPriceSpecification.py [new file with mode: 0644]
Common/Python/SmartAPI/model/DurationAtZoneDependentPriceSpecification.py [new file with mode: 0644]
Common/Python/SmartAPI/model/DurationDependentPriceSpecification.py [new file with mode: 0644]
Common/Python/SmartAPI/model/LinearCalculation.py [new file with mode: 0644]
Common/Python/SmartAPI/model/Message.py
Common/Python/SmartAPI/model/ObjectOperationDependentPriceSpecification.py [new file with mode: 0644]
Common/Python/SmartAPI/model/PropertyDependentPriceSpecification.py [new file with mode: 0644]
Common/Python/SmartAPI/model/TimeDependentPriceListSpecification.py [new file with mode: 0644]
Common/Python/SmartAPI/model/TimeDependentPriceSpecification.py [new file with mode: 0644]
Common/Python/SmartAPI/model/TravelDistanceDependentPriceSpecification.py [new file with mode: 0644]
Common/Python/SmartAPI/model/TravelDistanceDurationDependentPriceSpecification.py [new file with mode: 0644]
Common/Python/SmartAPI/model/ZoneDependentPriceSpecification.py [new file with mode: 0644]
Common/Python/SmartAPI/model/ZoneTravelDependentPriceSpecification.py [new file with mode: 0644]
Common/Python/SmartAPI/model/ZoneTravelDurationDependentPriceSpecification.py [new file with mode: 0644]
Common/Python/SmartAPI/rdf/Variant.py

diff --git a/Common/Python/SmartAPI/model/CalculationMethod.py b/Common/Python/SmartAPI/model/CalculationMethod.py
new file mode 100644 (file)
index 0000000..ab3c8ac
--- /dev/null
@@ -0,0 +1,6 @@
+from SmartAPI.model.Obj import Obj
+
+class CalculationMethod(Obj):
+       
+       def __init__(self, uri = None):
+               Obj.__init__(self, uri)
\ No newline at end of file
diff --git a/Common/Python/SmartAPI/model/DependentPriceSpecification.py b/Common/Python/SmartAPI/model/DependentPriceSpecification.py
new file mode 100644 (file)
index 0000000..88f93f8
--- /dev/null
@@ -0,0 +1,25 @@
+from SmartAPI.common.PROPERTY import PROPERTY
+
+from SmartAPI.model.PriceSpecification import PriceSpecification
+from SmartAPI.model.Condition import Condition
+
+
+class DependentPriceSpecification(PriceSpecification):
+
+       def __init__(uri = None, value = None, unit = None, validFrom = None, validThrough = None):
+               super(DependentPriceSpecification, self).__init__(uri = uri, value = value, unit = unit, validFrom = validFrom, validThrough = validThrough)
+
+               self.init_property(PROPERTY.LIST, 'conditions', self.hasCondition, self.getConditions, islist = True)
+       
+       def hasCondition(self):
+               return len(self.conditions) > 0
+               
+       def getConditions(self):
+               return self.conditions
+
+       def addCondition(self, c):
+               self.conditions.append(c)
+
+       def _parseStatement(self, statement, custom_classes = None):
+               self.parse_property(statement, PROPERTY.LIST, self.addCondition, Condition, custom_classes = custom_classes)
+               super(DependentPriceSpecification, self)._parseStatement(statement, custom_classes = custom_classes)
\ No newline at end of file
diff --git a/Common/Python/SmartAPI/model/DistanceDependentPriceSpecification.py b/Common/Python/SmartAPI/model/DistanceDependentPriceSpecification.py
new file mode 100644 (file)
index 0000000..57749bf
--- /dev/null
@@ -0,0 +1,29 @@
+from SmartAPI.model.TravelDistanceDependentPriceSpecification import TravelDistanceDependentPriceSpecification
+from SmartAPI.model.Coordinates import Coordinates
+from SmartAPI.common.PROPERTY import PROPERTY
+from SmartAPI.common.RESOURCE import RESOURCE
+
+
+class DistanceDependentPriceSpecification(TravelDistanceDependentPriceSpecification):
+
+       def __init__(uri = None, value = None, unit = None, validFrom = None, validThrough = None):
+               super(DistanceDependentPriceSpecification, self).__init__(uri = uri, value = value, unit = unit, validFrom = validFrom, validThrough = validThrough)
+               self.setType(RESOURCE.DISTANCEDEPENDENTPRICESPECIFICATION)
+               self.init_property(PROPERTY.LOCATION, 'coordinates', self.hasCoordinates, self.getCoordinates)
+       
+       def hasCoordinates(self):
+               return self.coordinates is not None
+
+       def getCoordinates(self):
+               return self.coordinates
+
+       def setCoordinates(self, coordinates=None, latitude=None, longitude=None):
+               if (latitude is not None and longitude is not None):
+                       coordinates = Coordinates(latitude=None, longitude=None)
+               self.coordinates = coordinates
+
+       def _parseStatement(self, statement, custom_classes = None):
+               self.parse_property(statement, PROPERTY.LOCATION, self.setCoordinates, Coordinates, custom_classes = custom_classes)
+               super(DistanceDependentPriceSpecification, self)._parseStatement(statement, custom_classes = custom_classes)
+               
+
diff --git a/Common/Python/SmartAPI/model/DurationAtDistanceDependentPriceSpecification.py b/Common/Python/SmartAPI/model/DurationAtDistanceDependentPriceSpecification.py
new file mode 100644 (file)
index 0000000..28de5e1
--- /dev/null
@@ -0,0 +1,29 @@
+from SmartAPI.model.DependentPriceSpecification import DependentPriceSpecification
+from SmartAPI.model.Coordinates import Coordinates
+from SmartAPI.common.PROPERTY import PROPERTY
+from SmartAPI.common.RESOURCE import RESOURCE
+
+
+class DurationAtDistanceDependentPriceSpecification(DependentPriceSpecification):
+
+       def __init__(uri = None, value = None, unit = None, validFrom = None, validThrough = None):
+               super(DurationAtDistanceDependentPriceSpecification, self).__init__(uri = uri, value = value, unit = unit, validFrom = validFrom, validThrough = validThrough)
+               self.setType(RESOURCE.DURATIONATDISTANCEDEPENDENTPRICESPECIFICATION)
+               self.init_property(PROPERTY.LOCATION, 'coordinates', self.hasCoordinates, self.getCoordinates)
+       
+       def hasCoordinates(self):
+               return self.coordinates is not None
+
+       def getCoordinates(self):
+               return self.coordinates
+
+       def setCoordinates(self, coordinates=None, latitude=None, longitude=None):
+               if (latitude is not None and longitude is not None):
+                       coordinates = Coordinates(latitude=None, longitude=None)
+               self.coordinates = coordinates
+
+       def _parseStatement(self, statement, custom_classes = None):
+               self.parse_property(statement, PROPERTY.LOCATION, self.setCoordinates, Coordinates, custom_classes = custom_classes)
+               super(DurationAtDistanceDependentPriceSpecification, self)._parseStatement(statement, custom_classes = custom_classes)
+               
+
diff --git a/Common/Python/SmartAPI/model/DurationAtZoneDependentPriceSpecification.py b/Common/Python/SmartAPI/model/DurationAtZoneDependentPriceSpecification.py
new file mode 100644 (file)
index 0000000..8702559
--- /dev/null
@@ -0,0 +1,13 @@
+from SmartAPI.model.DependentPriceSpecification import DependentPriceSpecification
+from SmartAPI.common.RESOURCE import RESOURCE
+
+
+class DurationAtZoneDependentPriceSpecification(DependentPriceSpecification):
+
+       def __init__(uri = None, value = None, unit = None, validFrom = None, validThrough = None):
+               super(DurationAtZoneDependentPriceSpecification, self).__init__(uri = uri, value = value, unit = unit, validFrom = validFrom, validThrough = validThrough)
+               self.setType(RESOURCE.DURATIONATDISTANCEDEPENDENTPRICESPECIFICATION)
+               
+       def _parseStatement(self, statement, custom_classes = None):
+               super(DurationAtZoneDependentPriceSpecification, self)._parseStatement(statement, custom_classes = custom_classes)
+               
diff --git a/Common/Python/SmartAPI/model/DurationDependentPriceSpecification.py b/Common/Python/SmartAPI/model/DurationDependentPriceSpecification.py
new file mode 100644 (file)
index 0000000..5d2a997
--- /dev/null
@@ -0,0 +1,13 @@
+from SmartAPI.model.DependentPriceSpecification import DependentPriceSpecification
+from SmartAPI.common.RESOURCE import RESOURCE
+
+
+class DurationDependentPriceSpecification(DependentPriceSpecification):
+
+       def __init__(uri = None, value = None, unit = None, validFrom = None, validThrough = None):
+               super(DurationDependentPriceSpecification, self).__init__(uri = uri, value = value, unit = unit, validFrom = validFrom, validThrough = validThrough)
+               self.setType(RESOURCE.DURATIONDEPENDENTPRICESPECIFICATION)
+               
+       def _parseStatement(self, statement, custom_classes = None):
+               super(DurationDependentPriceSpecification, self)._parseStatement(statement, custom_classes = custom_classes)
+               
diff --git a/Common/Python/SmartAPI/model/LinearCalculation.py b/Common/Python/SmartAPI/model/LinearCalculation.py
new file mode 100644 (file)
index 0000000..91f37d1
--- /dev/null
@@ -0,0 +1,64 @@
+from SmartAPI.model.CalculationMethod import CalculationMethod
+from SmartAPI.common.RESOURCE import RESOURCE
+from SmartAPI.common.PROPERTY import PROPERTY
+
+"""
+ * Linear calculation represents a calculation of an n-variable linear equation:
+ * 
+ *   a(1)x(1) + ... + a(n)x(n) + c = y
+ * 
+ *     where
+ *   a(n) is Nth multiplier
+ *   x(n) is Nth variable
+ *   c is offset
+ *   y is the calculation result
+ *     
+ * @author Asema 2018
+ *
+"""
+class LinearCalculation(CalculationMethod):
+
+       def __init__(self, uri = None):
+               CalculationMethod.__init__(self, uri)
+               self.setType(RESOURCE.LINEARCALCULATION);
+               
+               self.init_property(PROPERTY.OFFSET, 'offset', self.hasOffset, self.getOffset)
+               self.init_property(PROPERTY.LIST, 'multipliers', self.hasMultiplier, self.getMultipliers, islist = True)
+
+       def hasOffset(self):
+               return self.offset is not None
+       
+       def getOffset(self):
+               return self.offset
+       
+       def setOffset(self, o):
+               if o is not None:
+                       if not isinstance(o, Variant):
+                               o = Variant(o)
+                       self.offset = o
+
+       def hasMultiplier(self):
+               return len(self.multipliers) > 0
+       
+       def getMultipliers(self):
+               return self.multipliers
+       
+       def getMultiplier(self, index):
+               return self.multipliers[index]
+       
+       def addMultiplier(self, m):
+               self.multipliers.append(m)
+       
+       # calculates y as the result
+       def calculate(args):
+               res = 0.0
+               for a in args:
+                       if a is not None:
+                               res = res + a * self.getMultiplier(i) 
+               
+               if self.hasOffset() and (self.offset.isInteger() or self.offset.isDouble() or self.offset.isFloat()):
+                       res = res + self.getOffset().getValue()
+               
+               return res;
+
index 61264856fac6aa0e7393357537d954160b55e396..e2fd5d5fcabcb804be1b556b6b80e1fa538b1124 100644 (file)
@@ -43,7 +43,7 @@ class Message(Obj):
                        if isinstance(m, str): 
                                m = Variant(URIRef(m))
                        elif isinstance(m, URIRef):
-                               m = Variant(m)                          
+                               m = Variant(m)
                        self.method = m
                
        def hasId(self):
@@ -80,7 +80,7 @@ class Message(Obj):
                '''
                @param e: string or Obj type 
                '''     
-               from Obj import Obj                                     
+               from Obj import Obj
                if isinstance(e, str):
                        e = Obj(e)              
                self.transactionId = e
diff --git a/Common/Python/SmartAPI/model/ObjectOperationDependentPriceSpecification.py b/Common/Python/SmartAPI/model/ObjectOperationDependentPriceSpecification.py
new file mode 100644 (file)
index 0000000..b745bb2
--- /dev/null
@@ -0,0 +1,14 @@
+from SmartAPI.model.PropertyDependentPriceSpecification import PropertyDependentPriceSpecification
+from SmartAPI.common.RESOURCE import RESOURCE
+
+
+class ObjectOperationDependentPriceSpecification(DependentPriceSpecification):
+
+       def __init__(uri = None, value = None, unit = None, validFrom = None, validThrough = None):
+               super(ObjectOperationDependentPriceSpecification, self).__init__(uri = uri, value = value, unit = unit, validFrom = validFrom, validThrough = validThrough)
+               self.setType(RESOURCE.OBJECTOPERATIONDEPENDENTPRICESPECIFICATION)
+               
+       def _parseStatement(self, statement, custom_classes = None):
+               super(ObjectOperationDependentPriceSpecification, self)._parseStatement(statement, custom_classes = custom_classes)
+               
+               
\ No newline at end of file
diff --git a/Common/Python/SmartAPI/model/PropertyDependentPriceSpecification.py b/Common/Python/SmartAPI/model/PropertyDependentPriceSpecification.py
new file mode 100644 (file)
index 0000000..40b1b3e
--- /dev/null
@@ -0,0 +1,50 @@
+from SmartAPI.model.DependentPriceSpecification import DependentPriceSpecification
+from SmartAPI.common.RESOURCE import RESOURCE
+from SmartAPI.common.PROPERTY import PROPERTY
+from SmartAPI.rdf.Variant import Variant
+
+from rdflib import URIRef, XSD
+
+
+class PropertyDependentPriceSpecification(DependentPriceSpecification):
+
+       def __init__(uri = None, value = None, unit = None, validFrom = None, validThrough = None):
+               super(PropertyDependentPriceSpecification, self).__init__(uri = uri, value = value, unit = unit, validFrom = validFrom, validThrough = validThrough)
+               self.setType(RESOURCE.PROPERTYDEPENDENTPRICESPECIFICATION)
+               
+               self.init_property(PROPERTY.REFERENCEOBJECT, 'referenceObject', self.hasReferenceObject, self.getReferenceObject)
+               self.init_property(PROPERTY.SMARTAPI_PROPERTY, 'property', self.hasProperty, self.getProperty)
+       
+       def hasReferenceObject(self):
+               return self.referenceObject is not None
+
+       def getReferenceObject(self):
+               return self.referenceObject
+
+       def setReferenceObject(self, r):
+               if r is not None:
+                       if isinstance(r, str): 
+                               r = Variant(URIRef(r))
+                       elif isinstance(r, URIRef):
+                               r = Variant(r)
+                       self.referenceObject = r
+       
+       def hasProperty(self):
+               return self.property is not None
+
+       def getProperty(self):
+               return self.property
+
+       def setProperty(self, p):
+               if p is not None:
+                       if isinstance(p, str): 
+                               p = Variant(URIRef(p))
+                       elif isinstance(r, URIRef):
+                               p = Variant(p)
+                       self.referenceObject = p
+               
+       def _parseStatement(self, statement, custom_classes = None):
+               self.parse_property(statement, PROPERTY.REFERENCEOBJECT, self.setCoordinates, Variant, custom_classes = custom_classes)
+               self.parse_property(statement, PROPERTY.SMARTAPI_PROPERTY, self.setCoordinates, Variant, custom_classes = custom_classes)
+               super(PropertyDependentPriceSpecification, self)._parseStatement(statement, custom_classes = custom_classes)
+               
diff --git a/Common/Python/SmartAPI/model/TimeDependentPriceListSpecification.py b/Common/Python/SmartAPI/model/TimeDependentPriceListSpecification.py
new file mode 100644 (file)
index 0000000..cdac502
--- /dev/null
@@ -0,0 +1,15 @@
+from SmartAPI.model.TimeDependentPriceSpecification import TimeDependentPriceSpecification
+from SmartAPI.common.RESOURCE import RESOURCE
+
+
+class TimeDependentPriceListSpecification(TimeDependentPriceSpecification):
+
+       def __init__(uri = None, value = None, unit = None, validFrom = None, validThrough = None):
+               super(TimeDependentPriceListSpecification, self).__init__(uri = uri, value = value, unit = unit, validFrom = validFrom, validThrough = validThrough)
+               self.setType(RESOURCE.TIMEDEPENDENTPRICELISTSPECIFICATION)
+               
+       def _parseStatement(self, statement, custom_classes = None):
+               super(TimeDependentPriceListSpecification, self)._parseStatement(statement, custom_classes = custom_classes)
+               
+               
+               
\ No newline at end of file
diff --git a/Common/Python/SmartAPI/model/TimeDependentPriceSpecification.py b/Common/Python/SmartAPI/model/TimeDependentPriceSpecification.py
new file mode 100644 (file)
index 0000000..bc09263
--- /dev/null
@@ -0,0 +1,13 @@
+from SmartAPI.model.DependentPriceSpecification import DependentPriceSpecification
+from SmartAPI.common.RESOURCE import RESOURCE
+
+
+class TimeDependentPriceSpecification(DependentPriceSpecification):
+
+       def __init__(uri = None, value = None, unit = None, validFrom = None, validThrough = None):
+               super(TimeDependentPriceSpecification, self).__init__(uri = uri, value = value, unit = unit, validFrom = validFrom, validThrough = validThrough)
+               self.setType(RESOURCE.TIMEDEPENDENTPRICESPECIFICATION)
+               
+       def _parseStatement(self, statement, custom_classes = None):
+               super(TimeDependentPriceSpecification, self)._parseStatement(statement, custom_classes = custom_classes)
+               
\ No newline at end of file
diff --git a/Common/Python/SmartAPI/model/TravelDistanceDependentPriceSpecification.py b/Common/Python/SmartAPI/model/TravelDistanceDependentPriceSpecification.py
new file mode 100644 (file)
index 0000000..d793bd5
--- /dev/null
@@ -0,0 +1,51 @@
+from SmartAPI.model.DependentPriceSpecification import DependentPriceSpecification
+from SmartAPI.model.CalculationMethod import CalculationMethod
+from SmartAPI.model.LinearCalculation import LinearCalculation
+from SmartAPI.common.RESOURCE import RESOURCE
+from SmartAPI.common.PROPERTY import PROPERTY
+
+
+class TravelDistanceDependentPriceSpecification(DependentPriceSpecification):
+
+       def __init__(uri = None, value = None, unit = None, validFrom = None, validThrough = None):
+               super(TravelDistanceDependentPriceSpecification, self).__init__(uri = uri, value = value, unit = unit, validFrom = validFrom, validThrough = validThrough)
+               self.setType(RESOURCE.TRAVELDISTANCEDEPENDENTPRICESPECIFICATION)
+               
+               self.init_property(PROPERTY.CALCULATIONMETHOD, 'calculationMethod', self.hasCoordinates, self.getCoordinates)
+       
+       
+       def hasCalculationMethod(self):
+               return self.calculationMethod is not None
+
+       def getCalculationMethod(self):
+               return self.calculationMethod
+
+       def setCalculationMethod(self, m):
+               if isinstance(m, LinearCalculation):
+                       self.addType(RESOURCE.LINEARPRICESPECIFICATION)
+               self.calculationMethod = m
+
+       def addCondition(condition):
+               self.addType(RESOURCE.STEPPRICESPECIFICATION)
+               super(TravelDistanceDependentPriceSpecification, self).addCondition(condition)
+       
+       def isStepPriceSpecification():
+               self. hasType(RESOURCE.STEPPRICESPECIFICATION)
+       
+       def isLinearPriceSpecification():
+               self. hasType(RESOURCE.LINEARPRICESPECIFICATION)
+
+       def calculatePrice(distance):
+               if self.hasCalculationMethod():
+                       return self.getCalculationMethod().calculate(distance)
+               else:
+                       print "Unable to calculate price for a distance dependent price specification because the calculation method is not defined. Returning none."
+                       return None
+       
+       def _parseStatement(self, statement, custom_classes = None):
+               self.parse_property(statement, PROPERTY.CALCULATIONMETHOD, self.setCalculationMethod, CalculationMethod, custom_classes = custom_classes)
+               
+               super(TravelDistanceDependentPriceSpecification, self)._parseStatement(statement, custom_classes = custom_classes)
+               
+
+       
\ No newline at end of file
diff --git a/Common/Python/SmartAPI/model/TravelDistanceDurationDependentPriceSpecification.py b/Common/Python/SmartAPI/model/TravelDistanceDurationDependentPriceSpecification.py
new file mode 100644 (file)
index 0000000..68325ae
--- /dev/null
@@ -0,0 +1,14 @@
+from SmartAPI.model.DependentPriceSpecification import DependentPriceSpecification
+from SmartAPI.common.RESOURCE import RESOURCE
+
+
+class TravelDistanceDurationDependentPriceSpecification(DependentPriceSpecification):
+
+       def __init__(uri = None, value = None, unit = None, validFrom = None, validThrough = None):
+               super(TravelDistanceDurationDependentPriceSpecification, self).__init__(uri = uri, value = value, unit = unit, validFrom = validFrom, validThrough = validThrough)
+               self.setType(RESOURCE.TRAVELDISTANCEDURATIONDEPENDENTPRICESPECIFICATION)
+               
+       def _parseStatement(self, statement, custom_classes = None):
+               super(TravelDistanceDurationDependentPriceSpecification, self)._parseStatement(statement, custom_classes = custom_classes)
+               
+               
\ No newline at end of file
diff --git a/Common/Python/SmartAPI/model/ZoneDependentPriceSpecification.py b/Common/Python/SmartAPI/model/ZoneDependentPriceSpecification.py
new file mode 100644 (file)
index 0000000..af385e2
--- /dev/null
@@ -0,0 +1,14 @@
+from SmartAPI.model.DependentPriceSpecification import DependentPriceSpecification
+from SmartAPI.common.RESOURCE import RESOURCE
+
+
+class ZoneDependentPriceSpecification(DependentPriceSpecification):
+
+       def __init__(uri = None, value = None, unit = None, validFrom = None, validThrough = None):
+               super(ZoneDependentPriceSpecification, self).__init__(uri = uri, value = value, unit = unit, validFrom = validFrom, validThrough = validThrough)
+               self.setType(RESOURCE.ZONEDEPENDENTPRICESPECIFICATION)
+               
+       def _parseStatement(self, statement, custom_classes = None):
+               super(ZoneDependentPriceSpecification, self)._parseStatement(statement, custom_classes = custom_classes)
+               
+               
\ No newline at end of file
diff --git a/Common/Python/SmartAPI/model/ZoneTravelDependentPriceSpecification.py b/Common/Python/SmartAPI/model/ZoneTravelDependentPriceSpecification.py
new file mode 100644 (file)
index 0000000..16d1c68
--- /dev/null
@@ -0,0 +1,15 @@
+from SmartAPI.model.DependentPriceSpecification import DependentPriceSpecification
+from SmartAPI.common.RESOURCE import RESOURCE
+
+
+class ZoneTravelDependentPriceSpecification(DependentPriceSpecification):
+
+       def __init__(uri = None, value = None, unit = None, validFrom = None, validThrough = None):
+               super(ZoneTravelDependentPriceSpecification, self).__init__(uri = uri, value = value, unit = unit, validFrom = validFrom, validThrough = validThrough)
+               self.setType(RESOURCE.ZONETRAVELDEPENDENTPRICESPECIFICATION)
+               
+       def _parseStatement(self, statement, custom_classes = None):
+               super(ZoneTravelDependentPriceSpecification, self)._parseStatement(statement, custom_classes = custom_classes)
+               
+               
+               
\ No newline at end of file
diff --git a/Common/Python/SmartAPI/model/ZoneTravelDurationDependentPriceSpecification.py b/Common/Python/SmartAPI/model/ZoneTravelDurationDependentPriceSpecification.py
new file mode 100644 (file)
index 0000000..b1f7e5a
--- /dev/null
@@ -0,0 +1,13 @@
+from SmartAPI.model.DependentPriceSpecification import DependentPriceSpecification
+from SmartAPI.common.RESOURCE import RESOURCE
+
+
+class ZoneTravelDurationDependentPriceSpecification(DependentPriceSpecification):
+
+       def __init__(uri = None, value = None, unit = None, validFrom = None, validThrough = None):
+               super(ZoneTravelDurationDependentPriceSpecification, self).__init__(uri = uri, value = value, unit = unit, validFrom = validFrom, validThrough = validThrough)
+               self.setType(RESOURCE.ZONETRAVELDURATIONDEPENDENTPRICESPECIFICATION)
+               
+       def _parseStatement(self, statement, custom_classes = None):
+               super(ZoneTravelDurationDependentPriceSpecification, self)._parseStatement(statement, custom_classes = custom_classes)
+               
\ No newline at end of file
index 83da47341dd6eb862639989a356bb2f8f0265c82..8dab4efdce0e79f8b42eadbba6cdede18c93feb6 100644 (file)
@@ -174,9 +174,9 @@ class Variant(object):
                        return "Obj"
                elif self.isList():
                        return "List"
-               elif self.isVariant():                  
+               elif self.isVariant():
                        return "Variant"
-               else:                                                                           
+               else:
                        return None
 
        def getAsString(self):