- Timestamp:
- 04/16/09 21:34:52 (4 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
lang/python/tremolo/tremolo/indications/moving_average.py
r32495 r32496 32 32 MovingAverage.__init__(self, asset, parent) 33 33 if type(length) == int and length > 0: self.length = length 34 else: raise TypeError("the variable'length' is not valid.")34 else: raise TypeError("the argument 'length' is not valid.") 35 35 36 36 def getDescription(self): … … 56 56 self.__denominator = length*(length+1)/2.0 57 57 self.__cache_list = [(length-i) for i in xrange(length)] 58 else: raise AttributeError ("the attribute 'length' is not valid.")58 else: raise AttributeError 59 59 60 60 def getDescription(self): … … 98 98 if alpha == -1 or (type(alpha)==float and 0.0 < alpha < 1.0): 99 99 self.__alpha = alpha 100 else: raise TypeError("the variable'alpha' is not valid.")100 else: raise TypeError("the argument 'alpha' is not valid.") 101 101 if type(length) == int and length > 0: 102 102 self.__length = length 103 else: raise TypeError("the variable'length' is not valid.")103 else: raise TypeError("the argument 'length' is not valid.") 104 104 105 105 self.__initCache() … … 115 115 if alpha == -1 or (type(alpha)==float and 0.0 < alpha < 1.0): 116 116 self.__alpha = alpha 117 else: raise TypeError("the variable 'alpha' is not valid.")117 else: raise AttributeError 118 118 self.__initCache() 119 119 alpha = property(getAlpha, setAlpha) … … 123 123 if type(length) == int and length > 0: 124 124 self.__length = length 125 else: raise TypeError("the variable 'length' is not valid.")125 else: raise AttributeError 126 126 self.__initCache() 127 127 length = property(getLength, setLength)
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)