MCPcopy Create free account
hub / github.com/ActiveState/code / doFile

Function doFile

recipes/Python/577546_linecountpy/recipe-577546.py:173–195  ·  view source on GitHub ↗
(file, options)

Source from the content-addressed store, hash-verified

171filecount = 0
172
173def doFile(file, options):
174 global formatstr
175 global filecount
176 if options.syntax:
177 if options.syntax == 'S':
178 count = doShFile(file)
179 elif options.syntax == 'C':
180 count = doCFile(file)
181 elif options.syntax == 'M':
182 count = doMFile(file)
183 else:
184 ext = getExt(file)
185 count = 0
186 if ext in sh_exts:
187 count = doShFile(file)
188 elif ext in c_exts:
189 count = doCFile(file)
190 elif ext in m_exts:
191 count = doMFile(file)
192
193 print formatstr.format(file, count)
194 filecount += 1
195 return count
196
197
198def doDir(dir, options):

Callers 2

doDirFunction · 0.85
recipe-577546.pyFile · 0.85

Calls 5

doShFileFunction · 0.85
doCFileFunction · 0.85
doMFileFunction · 0.85
getExtFunction · 0.85
formatMethod · 0.45

Tested by

no test coverage detected