Package qm :: Package test :: Module result_reader
[hide private]
[frames] | no frames]

Source Code for Module qm.test.result_reader

 1  ######################################################################## 
 2  # 
 3  # File:   result_reader.py 
 4  # Author: Nathaniel Smith 
 5  # Date:   2003-06-23 
 6  # 
 7  # Contents: 
 8  #   QMTest ResultReader class. 
 9  # 
10  # Copyright (c) 2003 by CodeSourcery, LLC.  All rights reserved.  
11  # 
12  # For license terms see the file COPYING. 
13  # 
14  ######################################################################## 
15   
16  ######################################################################## 
17  # Imports 
18  ######################################################################## 
19   
20  import qm.extension 
21   
22  ######################################################################## 
23  # Classes 
24  ######################################################################## 
25   
26 -class ResultReader(qm.extension.Extension):
27 """A 'ResultReader' provides access to stored test results. 28 29 For instance, a 'ResultReader' may load 'Result's from a pickle 30 file or an XML file. 31 32 This is an abstract class. 33 34 See also 'ResultStream'.""" 35 36 kind = "result_reader" 37
38 - def __init__(self, arguments, **args):
39 40 if arguments: args.update(arguments) 41 super(ResultReader, self).__init__(**args)
42 43
44 - def GetAnnotations(self):
45 """Return this run's dictionary of annotations.""" 46 47 # For backwards compatibility, don't raise an exception. 48 return {}
49 50
51 - def GetResult(self):
52 """Return the next 'Result' from this reader. 53 54 returns -- A 'Result', or 'None' if there are no more results. 55 """ 56 57 raise NotImplementedError
58 59
60 - def __iter__(self):
61 """A 'ResultReader' can be iterated over.""" 62 63 return iter(self.GetResult, None)
64 65 ######################################################################## 66 # Local Variables: 67 # mode: python 68 # indent-tabs-mode: nil 69 # fill-column: 72 70 # End: 71