- Timestamp:
- 07/21/06 10:04:44 (7 years ago)
- Files:
-
- branches/mk/cheesecake/cheesecake_index.py (modified) (2 diffs)
- branches/mk/cheesecake/codeparser.py (modified) (2 diffs)
- branches/mk/cheesecake/util.py (modified) (5 diffs)
- branches/mk/tests/unit/test_index_class.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/mk/cheesecake/cheesecake_index.py
r97 r98 106 106 >>> discover_file_type('examples/runthis.py') 107 107 'demo' 108 >>> discover_file_type('optimized.pyo') 109 'pyo' 108 110 109 111 >>> test_files = ['ut/test_this_and_that.py', … … 467 469 msg = pad_msg("%s INDEX (RELATIVE)" % self.name, percentage) 468 470 msg += " (%d out of a maximum of %d points is %d%%)" %\ 469 (self.value, max_value, percentage)471 (self.value, max_value, percentage) 470 472 471 473 print msg branches/mk/cheesecake/codeparser.py
r89 r98 3 3 import re 4 4 5 import logger 5 6 from model import System, Module, Class, Function, parseFile, processModuleAst 6 7 … … 112 113 self.log = log.codeparser 113 114 else: 114 import logger115 115 self.log = logger.default.codeparser 116 116 self.modules = [] branches/mk/cheesecake/util.py
r78 r98 12 12 def run_cmd(cmd, env=None): 13 13 """Run command and return its return code and its output. 14 15 >>> run_cmd('/bin/true') 16 (0, '') 14 17 """ 15 18 arglist = cmd.split() … … 23 26 def command_successful(cmd): 24 27 """Returns True if command exited normally, False otherwise. 28 29 >>> command_successful('/bin/true') 30 True 31 >>> command_successful('this-command-doesnt-exist') 32 False 25 33 """ 26 34 rc, output = run_cmd(cmd) … … 30 38 31 39 class StdoutRedirector(object): 40 """Redirect stdout to a temporary file. 32 41 """ 33 Redirect stdout to a temp file34 """35 36 42 def __init__(self, filename=None): 37 43 if filename: … … 47 53 48 54 def read_buffer(self): 49 """ 50 Return contents of the temp file 55 """Return contents of the temporary file. 51 56 """ 52 57 self.fh.seek(0) … … 54 59 55 60 def pad_with_dots(msg, length=PAD_TEXT): 56 """ 57 Pad text with dots up to given length 61 """Pad text with dots up to given length. 58 62 """ 59 63 length = len(msg) branches/mk/tests/unit/test_index_class.py
r92 r98 10 10 >>> index.max_value 11 11 0 12 13 To learn a class name, ask for its representation. 14 >>> Index 15 <Index class: unnamed> 16 >>> class NamedIndex(Index): 17 ... pass 18 >>> NamedIndex 19 <Index class: NamedIndex> 12 20 13 21 *****
