DataViews/CodeMetrics.py

changeset 2953
703452a2876f
parent 2302
f29e9405c851
child 2986
cd4e2cab7eb2
equal deleted inserted replaced
2952:94fc661a54a2 2953:703452a2876f
36 """ 36 """
37 def __init__(self, **kw): 37 def __init__(self, **kw):
38 """ 38 """
39 Constructor 39 Constructor
40 40
41 @param **kw list of key, value pairs 41 @keyparam **kw list of key, value pairs
42 """ 42 """
43 self.__dict__.update(kw) 43 self.__dict__.update(kw)
44 44
45 45
46 class Parser(object): 46 class Parser(object):
124 def dedent(self, tok): 124 def dedent(self, tok):
125 """ 125 """
126 Public method used to decrement the indentation level. 126 Public method used to decrement the indentation level.
127 127
128 @param tok the token to be processed (Token) 128 @param tok the token to be processed (Token)
129 @exception ValueError raised to indicate an invalid indentation level
129 """ 130 """
130 self.indent_level -= 1 131 self.indent_level -= 1
131 if self.indent_level < 0: 132 if self.indent_level < 0:
132 raise ValueError("INTERNAL ERROR: Negative indent level") 133 raise ValueError("INTERNAL ERROR: Negative indent level")
133 134
257 return stats 258 return stats
258 259
259 260
260 def main(): 261 def main():
261 """ 262 """
262 Modules main function used when called as a script. 263 Module main function used when called as a script.
263 264
264 This function simply loops over all files given on the commandline 265 Loop over all files given on the command line and collect the individual
265 and collects the individual and overall source code statistics. 266 and overall source code statistics.
266 """ 267 """
267 import sys 268 import sys
268 269
269 files = sys.argv[1:] 270 files = sys.argv[1:]
270 271

eric ide

mercurial