Index: lnt/external/stats/stats.py =================================================================== --- lnt/external/stats/stats.py +++ lnt/external/stats/stats.py @@ -235,7 +235,7 @@ ############# DISPATCH CODE ############## -class Dispatch: +class Dispatch(object): """ The Dispatch class, care of David Ascher, allows different functions to be called depending on the argument types. This way, there can be one Index: lnt/server/config.py =================================================================== --- lnt/server/config.py +++ lnt/server/config.py @@ -9,7 +9,7 @@ import lnt.server.db.v4db -class EmailConfig: +class EmailConfig(object): @staticmethod def from_data(data): # The email to field can either be a string, or a list of tuples of @@ -37,7 +37,7 @@ return address -class DBInfo: +class DBInfo(object): @staticmethod def from_data(baseDir, config_data, default_email_config, default_baseline_revision): @@ -88,7 +88,7 @@ return "DBInfo(" + self.path + ")" -class Config: +class Config(object): @staticmethod def from_data(path, data): # Paths are resolved relative to the absolute real path of the Index: lnt/server/db/regression.py =================================================================== --- lnt/server/db/regression.py +++ lnt/server/db/regression.py @@ -7,7 +7,7 @@ from lnt.testing.util.commands import timed -class RegressionState: +class RegressionState(object): # A new regression, not approved by the user yet. DETECTED = 0 # Approved, but waiting for cooldown. Index: lnt/server/reporting/analysis.py =================================================================== --- lnt/server/reporting/analysis.py +++ lnt/server/reporting/analysis.py @@ -50,7 +50,7 @@ return stats.geometric_mean(values) - MIN_VALUE_PRECISION -class ComparisonResult: +class ComparisonResult(object): """A ComparisonResult is ultimatly responsible for determining if a test improves, regresses or does not change, given some new and old data.""" @@ -99,7 +99,7 @@ self.stddev = None self.MAD = None - self.stddev_mean = None # Only calculate this if needed. + self.__set_stddev_mean(None) # Only calculate this if needed. self.failed = cur_failed self.prev_failed = prev_failed self.samples = samples @@ -108,13 +108,17 @@ self.confidence_lv = confidence_lv self.bigger_is_better = bigger_is_better - @property - def stddev_mean(self): + def __get_stddev_mean(self): """The mean around stddev for current sampples. Cached after first call. """ - if not self.stddev_mean: - self.stddev_mean = stats.mean(self.samples) - return self.stddev_mean + if not self.__stddev_mean: + self.__stddev_mean = stats.mean(self.samples) + return self.__stddev_mean + + def __set_stddev_mean(self, value): + self.__stddev_mean = value + + stddev_mean = property(__get_stddev_mean, __set_stddev_mean) def __repr__(self): """Print this ComparisonResult's constructor. Index: lnt/server/reporting/report.py =================================================================== --- lnt/server/reporting/report.py +++ lnt/server/reporting/report.py @@ -56,7 +56,7 @@ # Helper classes to make the sparkline chart construction easier in the jinja # template. -class RunResult: +class RunResult(object): def __init__(self, comparisonResult): self.cr = comparisonResult self.hash = self.cr.cur_hash @@ -64,7 +64,7 @@ if self.samples is None: self.samples = [] -class RunResults: +class RunResults(object): """ RunResults contains pre-processed data to easily construct the HTML for a single row in the results table, showing how one test on one board Index: lnt/server/ui/util.py =================================================================== --- lnt/server/ui/util.py +++ lnt/server/ui/util.py @@ -135,7 +135,7 @@ return tuple([av * t_ + bv * t for av, bv in zip(a, b)]) -class PctCell: +class PctCell(object): # Color levels kNeutralColor = (1, 1, 1) kNegativeColor = (0, 1, 0) @@ -302,7 +302,7 @@ return val -class PrecomputedCR(): +class PrecomputedCR(object): """Make a thing that looks like a comprison result, that is derived from a field change.""" previous = 0 Index: lnt/testing/__init__.py =================================================================== --- lnt/testing/__init__.py +++ lnt/testing/__init__.py @@ -31,7 +31,7 @@ return t.strftime('%Y-%m-%d %H:%M:%S') -class Report: +class Report(object): """Information on a single testing run. In the LNT test model, every test run should define exactly one @@ -102,7 +102,7 @@ sort_keys=True, indent=indent, encoding='latin-1') -class Machine: +class Machine(object): """Information on the machine the test was run on. The info dictionary can be used to describe additional information @@ -143,7 +143,7 @@ 'Info': self.info} -class Run: +class Run(object): """Information on the particular test run. At least one parameter must be supplied and is used as ordering @@ -228,7 +228,7 @@ 'Info': info} -class Test: +class Test(object): """Information on a particular test in the run and its associated samples. @@ -292,7 +292,7 @@ return d -class TestSamples: +class TestSamples(object): """Information on a given test and its associated samples data. Samples data must all relate to the same metric. When several @@ -349,7 +349,7 @@ self.info) -class MetricSamples: +class MetricSamples(object): """Samples data for a given metric of a given test. An arbitrary number of samples for a given metric is allowed for Index: lnt/util/multidict.py =================================================================== --- lnt/util/multidict.py +++ lnt/util/multidict.py @@ -1,4 +1,4 @@ -class multidict: +class multidict(object): def __init__(self, elts=()): self.data = {} for key, value in elts: